One database URL
Your app should read the database connection from an environment variable, usually DATABASE_URL. Do not hard-code the database password in your code.
Local development can use a local database. Production must use the hosted database URL set in your host dashboard.
Pick the right database
Use the same database type your app already uses. If your project uses PostgreSQL locally, choose hosted PostgreSQL. If it uses MySQL, choose hosted MySQL.
Free tiers are enough for most hackathon projects. Neon, Supabase, Render PostgreSQL, Railway, PlanetScale, and MongoDB Atlas are common choices, depending on your database type.
Create the database
Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.
0 of 5 done
Common wrong move
Many builders paste the hosted database URL into a .env file and commit it. That exposes your password in the public repo.
Your repo should show the variable name, not the real value. Put real secrets only in your host dashboard and your local .env file, which should be ignored by Git.
Env file pattern
Your README can show this example without leaking secrets. Your real .env file should not be committed.
# .env.example
DATABASE_URL="postgresql://USER:PASSWORD@HOST:5432/DB_NAME?sslmode=require"
# .gitignore
.env
.env.localSet up schema
Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.
0 of 5 done
Prisma migration example
If your Node app uses Prisma, run migrations against the hosted database. Do not use db push blindly on a shared production database.
# macOS/Linux
DATABASE_URL="postgresql://USER:PASSWORD@HOST:5432/DB_NAME?sslmode=require" npx prisma migrate deploy
# Windows PowerShell
$env:DATABASE_URL="postgresql://USER:PASSWORD@HOST:5432/DB_NAME?sslmode=require"
npx prisma migrate deployTest one real flow
After deploy, do the smallest database action your app supports. Sign up, create a note, add a listing, place a test order, or save a profile.
Then refresh the page. If the data is still there, your hosted app is using the hosted database correctly.
Do this now
Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.
0 of 5 done