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>"

# Only necessary to seed OIAA data
GOOGLE_SHEET_API_KEY="<your.google.sheets.api.key>"
USER_NAME="<your.name>"
USER_EMAIL="<your.email@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 or sign up for Atlas
  2. Create a database
  3. Copy the connection string to your .env

Set up FTP

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 ever time but should do it when you pull changes)
  2. Seeding with a Meeting Guide JSON feed and setting up a blank instance are both coming soon
  3. For now you must seed a sample of OIAA data by running npm run seed
  4. Now run npm run dev. Your site should be running at http://localhost:3000/

Deploy to Cloud Run

  1. Add this repository (or a clone of it) to Cloud Run
  2. Set your environment variables with the values in your .env

Releases

No releases published

Packages

No packages published

Languages