This project is configured for easy deployment on Render.com.
- Push this code to a GitHub/GitLab repository.
- Create a Render account.
- Go to Blueprints on Render Dashboard.
- Click New Blueprint Instance.
- Connect your repository.
- Render will automatically detect
render.yamland set up:- PostgreSQL Database (Managed)
- Web Service (Next.js App)
- It will auto-link
DATABASE_URL.
If you prefer to set up manually:
-
Create PostgreSQL Service:
- Name:
weblab-db(or any) - Note the Internal Connection String.
- Name:
-
Create Web Service:
- Build Command:
npm install && npm run build - Start Command:
npm start - Environment Variables:
- Build Command:
| Variable | Value | Description |
|---|---|---|
DATABASE_URL |
YOUR_POSTGRES_INTERNAL_URL |
Connection string from Step 1 |
JWT_SECRET |
YOUR_SECURE_RANDOM_STRING |
E.g. locally generated distinct hash |
NODE_ENV |
production |
Optimizes for performance |
- Seeding Data: After deployment, if you want to reset/seed the database:
- Go to your Web Service > Shell.
- Run:
npm run prisma:seed(ornode prisma/seed-native.jsdirectly).
# Start DB
docker-compose up -d postgres
# Push Schema
npx prisma db push
# Seed Data (Optional)
npm run prisma:seed
# Start App
npm run dev