atandrewlee / CRM_Server

0 stars 0 forks source link

CRM_Server

This project is a backend server for my personal CRM.

Refer to my post for a more general overview about this project + the whole system.

  • I want to potentially write a detailed overview of the whole system in a blog post (but that's for another day). NOTE: This is still a work-in-progress. Hopefully there will come a point where it's developed enough where I don't have to be actively building/tinkering with it.

How to deploy?

There are multiple ways to deploy. A few of them are

  1. Build & Deploy the provided Docker Container (make adjustments as necessary)
  2. Run directly using npm run start

A Few Considerations

  1. Environment variables: .env file, "Cloud Provider" (AWS,GCP,Azure) method of handling secrets/env-variables
  2. npm run start uses a .env file. If you have another way of loading env variables, use npm run start-no-env

What environment variables do you need

My Current Deployment

Considerations

  1. All of the CRM systems work within Google Cloud Platform
    • Cloud Build (Build new Docker image & add to artifact repository)
    • Every new commit to main -> build new Docker Container
    • Cloud Run (Run the requests)
    • Cloud Scheduler (Schedule calls to the API to run at specific times)
  2. Environment & Secrets
    • All are added through the GUI in Cloud Run

FUTURE: Want a better way to handle secrets + continuous deployment

How to test?

There is a directory called /tests that contain all the tests for the code. To run the tests, run npm run test which launches the jest testing suite.