Music platform with user auth, releases, reviews, artist pages and admin moderation.
- Node.js + Express
- PostgreSQL
- Static frontend (HTML/CSS/JS)
- API in
api/
- Install dependencies:
npm install
- Create
.envfrom.env.exampleand set real values. - Run SQL schema/migrations in your PostgreSQL.
- Start app:
npm run dev
- Open http://localhost:3000.
DATABASE_URL- PostgreSQL connection stringJWT_SECRET- secret for auth tokensFRONTEND_URL- frontend origin for CORS (for local:http://localhost:3000)
Example:
DATABASE_URL=postgresql://user:password@host:5432/dbname
JWT_SECRET=change-me
FRONTEND_URL=http://localhost:3000- Push repository to GitHub.
- Create Render Web Service from this repo (Blueprint):
render.yaml. - In Render set secrets:
DATABASE_URLJWT_SECRETBLOB_READ_WRITE_TOKEN(optional, if uploads are stored in Vercel Blob)FRONTEND_URL(your Vercel frontend domain)
- Deploy frontend on Vercel (static
public/). - Frontend API base is resolved in
public/js/api.js:- Localhost -> same origin (
/api) - Production -> default Render API host
- Optional override in browser console:
localStorage.setItem('MI_API_BASE', 'https://your-api.onrender.com')
- Localhost -> same origin (
Notes:
- Render uses
server.jsfor API and static serving. - Cookies are configured for cross-site auth when frontend and API domains differ.
npm run dev- run local servernpm start- production server startnpm run setup-db- setup databasenpm run migrate- run migrationsnpm run promote-admin- grant admin rolenpm run set-mi-reviewers- set MI reviewers
- Never commit real
.envfiles to GitHub. - Keep only
.env.examplein repository. - Rotate secrets if any key was accidentally committed.