This template is perfect for deploying the frontend to Vercel and hosting the backend on a seperate server
You have two options, Internal Databases (use Postgres and Redis in the docker-compose stack) or External Databases (your databases are hosted elsewhere, such as RedisLabs). By default, this template is configured for Internal Databases.
Also by default, this template assumes you are using docker-letsencrypt-nginx-proxy-companion, which makes handling SSL certificates and container restarts easier. If you are not using it as your proxy, then you will likely have to manually configure your proxy yourself.
- Copy all files and subdirectories in this directory to your server
- Copy
.env.sampleto.envand edit the variables - Copy the contents of the template
publicfolder to the location where you mounted the container'spublicfolder - Get recaptcha v2 invisible keys from google
- Edit
app-docker.json, particularly database names and passwords,allowedOrigins, andcaptchaSecret(not recommended to changehostandport) - Run
docker-compose upordocker-compose up -dto start the backend
Note: If you ever need to dump a backup of the postgres db, run this command in the terminal:
docker exec -e PGPASSWORD=<pg password> <pg container name> pg_dump -U <pg user> <pg database name> > backup.sqlFollow the same steps as Internal Databases, but for step 4, make sure to edit the databases host, port, username, password, etc. to the correct values.
- Fork the repo on GitHub and edit
frontend/config.jsonto fit the backend parameters and customization options - Add your PWA icons in
frontend/public/static/iconsand updatefrontend/public/static/manifest.jsonaccordingly. Note that you don't have to replace them all (more are given than neccessary), but you should remove the icons you don't replace. - Follow the instructions for connecting Vercel to your forked repo
- Your first deployment on Vercel may fail, this is expected. Add the following environment variables in the Vercel deployment and redeploy:
- NEXT_PUBLIC_CAPTCHA_KEY: this should have the value of a site (not secret) ReCaptcha v2 key
- NEXT_PUBLIC_API_URL: this should have the value of your API url (including https://)
- NEXT_PUBLIC_GA_TRACKING_ID: this should have the value of your Google Analytics tracking ID
- Once your vercel deployment is up, goto
WEBSITE_URL/auth/portal/loginwhich show give you a setup page for your first admin:
Consider using Cloudflare as a CDN for your API assests route. If you do decide to use Cloudflare, remember to follow Cloudflare's recommended page rules (apply these page rules to API_URL/api). If you also add the domain to your Vercel (frontend) deployment to Cloudflare as a DNS record, make sure it's set to "DNS Only", not "Proxied".
