Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 1.01 KB

File metadata and controls

43 lines (34 loc) · 1.01 KB

xcelerators-backend

Tools and resource used

  • NodeJS v20.10.0
  • ExpressJS
  • Prisma ORM
  • MySQL
  • Google Cloud Run
  • Service account key with Cloud Storage access
  • gcloud CLI

Local development setup

  1. Git clone this repo
  2. Set up your service account.
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/key.json"
  1. Run your MySQL database on local
  2. Run npm install on your terminal
  3. Make .env file, declare your DATABASE_URL:

Refer Prisma Docs for DATABASE_URL format.

DATABASE_URL="mysql://<user>:<password>@127.0.0.1:3306/capstone"

Instead .env file, you also can declare it via your shell session.

  1. Run npx prisma generate to generate Prisma model.
  2. Run npm run dev

Deployment

  1. Of course git clone this repo
  2. Create a new secret for the DATABASE_URL at Google Cloud Console
  3. Run this command:
gcloud run deploy \
    --allow-unauthenticated \
    --set-env-vars DATABASE_URL=@DATABASE_URL