[go: up one dir, main page]

Skip to content

code4recovery/central

Repository files navigation

Central

Central is a free content management system to help service entities manage their directory of recovery meetings. It is currently in active development. Once it's ready, it will be deployed and usable by service entities for free with minimal configuration.

Developer info

Central is developed on the MERN stack (MongoDB, Express, React, Node.js). It uses these frameworks:

You can set up and run Central yourself. It requires these third-party services:

Run locally

Start by creating a .env file in your project root with the following content, then continue to the next steps to configure services.

# Base URL (to populate edit URLs)
BASE_URL="http://localhost:3000"

# Random security salt (to protect sessions)
SESSION_SECRET="<make.up.a.cryptographic.salt>"

# MongoDB connection URL (to store data)
DATABASE_URL="mongodb+srv://<user>:<password>@cluster0.<cluster>.mongodb.net/<database>"

# Google Geocoding, Sheets, and Time Zone APIs
GOOGLE_API_KEY="<your.google.api.key>"

# SendGrid (to send email)
SENDGRID_API_KEY="<your.sendgrid.api.key>"
SENDGRID_SENDER="<your.sender@address.com>"

Set a base URL

This will be the base for the edit_urls in your JSON which link back to meeting entries. Use your Central URL without the trailing slash.

Create a session secret

You can type any string of random characters here, or use a random string generator.

Set up MongoDB

  1. Install MongoDB (requires a replica set) or sign up for Atlas
  2. Create a database
  3. Copy the connection string to your .env

Set up Google Geocoding and Time Zone APIs

  1. In Cloud Console, enable the Geocoding and Time Zone APIs
  2. Go to Credentials > Create Credentials
  3. Restrict to these two APIs (if you can figure out how to restrict it to the proper IP addresses for Cloud Run, let us know!)
  4. Copy the API key and add it to your .env

Set up SendGrid

  1. Set up an account at SendGrid
  2. Get API key and sender email, add them to .env

Run locally

  1. Run npm i (you don't need to do this every time but should do it when you pull changes)
  2. Now run npm run dev. Your site should be running at http://localhost:3000/

Deploy

We are evaluating options for the best method of deploying Central. Currently we have this working on Google Cloud Run and a VPS using Laravel Forge.

Releases

No releases published

Packages

No packages published

Languages