Deploying Atomic CRM to Production
Deploying The Backend
Section titled “Deploying The Backend”The entire backend of Atomic CRM is hosted on Supabase. The backend is composed of a Postgres database, a REST API, and edge functions. Check out the Supabase Configuration section for details.
After configuring your Supabase instance, you can deploy the backend changes with the following command:
make supabase-deployMake sure you access the frontend once to initialize the main admin account.
Testing Production Mode
Section titled “Testing Production Mode”If you want to test you local frontend code using the remote Supabase instance and the production settings, you can run the following command:
make prod-startNote: It will apply migrations and deploy edge functions.
You can then access the app via http://localhost:3000/.
Deploying The Frontend
Section titled “Deploying The Frontend”The frontend of the CRM is a Single-Page App that can be deployed to any CDN, or to GitHub Pages.
First, build the frontend bundle with:
make buildThis will create a dist directory with the built application made of static HTML, CSS, and JS files. Upload this directory to the CDN of your choice (e.g. Netlify, Vercel, etc.).
If you want to deploy it to GitHub pages, you can use the following command:
npm run ghpages:deployThe CRM will be available at https://<username>.github.io/atomic-crm/.
Deploying Updates
Section titled “Deploying Updates”If you’ve modified the code, run the following command to deploy a new version of your CRM:
make prod-deployIt will apply migrations, deploy edge functions and push the built applications to the gh-pages branch.
Automating Deployments With GitHub Actions
Section titled “Automating Deployments With GitHub Actions”Atomic CRM contains GitHub actions for continuous integration and delivery. To enable these actions, you will have to create the following secrets on GitHub:
SUPABASE_ACCESS_TOKEN: Your personal access token, can be found at https://supabase.com/dashboard/account/tokensSUPABASE_DB_PASSWORD: Your supabase database passwordSUPABASE_PROJECT_ID: Your supabase project idSUPABASE_URL: Your supabase project URLSUPABASE_ANON_KEY: Your supabase project anonymous keyPOSTMARK_WEBHOOK_USER: User configured in Postmark to secure the webhookPOSTMARK_WEBHOOK_PASSWORD: Password configured in Postmark to secure the webhookPOSTMARK_WEBHOOK_AUTHORIZED_IPS: List of IPs (comma separated) authorized to send requests to the Postmark webhookNote: The
POSTMARK_*variables are required for Atomic CRM’s inbound email features. Have a look at the the inbound email configuration to learn more about their usage and setup.
The GitHub action will run the prod-deploy command on every push to the main branch, deploying the frontend to GitHub pages and updating the Supabase instance.