Deploy API

As Kickstart is built on top of Next.js, vercel platform will be our default choice to hosting both API and Web application as it provides serverless and server-side rendering out of the box.

Deploy to Vercel via GIT

  • Login to vercel
  • Click Import Project
  • Click Import Git Repository
  • Enter github url for the api repo
  • Click continue to setup default project root folder
  • No need to set Build and Output Settings as we already specified in vercel.json within github repo
  • Setup the Environment Variables one by one

Below is the sample for environment variables

WEBAPP_URL=https://demo.kickstart.app
WEBAPP_PORT=80
API_URL=https://api.demo.kickstart.app
API_PORT=80
FIREBASE_DATABASE_URL=YOUR_DATABASE_URL
FIREBASE_PROJECT_ID=YOUR_PROJECT_ID
FIREBASE_STORAGE_BUCKET=YOUR_STORAGE_BUCKET
FIREBASE_CLIENT_EMAIL=YOUR_CLIENT_EMAIL
STRIPE_SECRET=YOUR_SECRET
STRIPE_WEBHOOK_SECRET=YOUR_WEBHOOK_SECRET
SENTRY_DSN=YOUR_SENTRY_DSN

For FIREBASE PRIVATE KEY it will be a little tricky to set it up in vercel. We will need to replace \n to real newline and paste it into vercel. Below is the example of the result private key.

-----BEGIN PRIVATE KEY-----
MIIEuwIBADANBgkqhkiG9w0BAQEFAASCBKUwggShAgEAAoIBAQCVxkZ0Ara/eRdq
7LJOlP3DPzRHctIcno3jc0RvAYmI0Ta6x5fVpZizLnB3V6Wt0KjCUui8KVFQjG19
B77HL1lVxvJbsD21Ym9MQL0lbFMhmDAA7FD19LHP449voEVvKs9tRjn7yjRul2F5
KY7ZtB1kjfdshfdfkdfdgweggefgkwlegwuegJBSI1WvlIEvi4vT05bG4+QPmZZK
VN+JVRAwJJmofCXjCtc0WsChehfbHGGyEvgZOxTj9lLBYCgRBBmjdp7duEvnWoco
On0iArADqVgzjsRU3LOv/e8hVhVnBxaIcT+VwG6Mx8OTav/hFIRYo3V5ZBzNJchu
hIquU9v1AgMBAAECgf8tunYqKiJtD62LZQwLvVsXiUdwtkdKyHhzMe8+QHnm3sx4
2KxooW42Vfs1R6AzyBQ25iD0JOWM6rySIPSp44N15YCZo5PKQ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2v/hL0B6MS5Lf2tGCBixXP9/ZBklIpC8sHkd7
hhDWLakYslDSCjlIZ/tI
-----END PRIVATE KEY-----

If you have custom domain, add it via Settings > Domains to bind the domain to your api server.