Skip to content

quarantineaid/quarantineaid-backend

Repository files navigation

Quarantine Aid

Quarantine Aid - NodeJS Backend

About

Quarantine Aid connects those who need help with organisations and volunteers who can help during Covid-19. This is particularly important during this period of quarantine and self-isolation due to COVID-19.

Implementations in other languages:

GO Rust
TBD TBD

How it works

This application is a REST backend for Quarantine Aid Frontend, built using Express.JS. However, the API server can be used to build a client app in any web or mobile client.

Features

How to use it

  1. Create a copy using GitHub's repository template functionality

  2. Copy .env.example as .env and update with the respective values.

  3. Start your app with npm run dev

Set up

Requirements

Obtaining API Keys

To use any of the included APIs or OAuth authentication methods, you will need to obtain appropriate credentials: Client ID, Client Secret, API Key, or Username & Password. You will need to go through each provider to generate new credentials.

  • Visit Google Cloud Console
  • Click on the Create Project button
  • Enter Project Name, then click on Create button
  • Next, under APIs & auth in the sidebar click on Credentials tab
  • Click on Create new Client ID button
  • Select Web Application and click on Configure Consent Screen
  • Fill out the required fields then click on Save
  • In the Create Client ID modal dialog:
  • Application Type: Web Application
  • Click on Create Client ID button
  • Copy and paste Client ID and Client secret keys into .env

  • Visit Facebook Developers
  • Click My Apps, then select *Add a New App from the dropdown menu
  • Enter a new name for your app
  • Click on the Create App ID button
  • Find the Facebook Login Product and click on Facebook Login
  • Instead of going through their Quickstart, click on Settings for your app in the top left corner
  • Copy and paste App ID and App Secret keys into .env
  • Note: App ID is FACEBOOK_ID, App Secret is FACEBOOK_SECRET in .env
  • Enter Site URL under App Domains
  • Choose a Category that best describes your app
  • Click on + Add Platform and select Website
  • Enter Site URL
  • Click on the Settings tab in the left nav under Facebook Login

Local development

After the above requirements have been met:

  1. Clone this repository and cd into it
git clone https://github.com/solancer/quarantineaid-backend.git

cd quarantineaid-backend
  1. Install dependencies
npm install
  1. Set your environment variables

See Twilio Account Settings to locate the necessary environment variables.

  1. Run the application
npm run start

Alternatively, you can use this command to start the server in development mode. It will reload whenever you change any files.

npm run dev
  1. Navigate to http://localhost:3000

That's it!

Production

You can use npm run start to start the app in production mode with pm2:

Cloud deployment

Additionally to trying out this application locally, you can deploy it to a variety of host services. Here is a small selection of them.

Zeit Deploy with ZEIT Now
Digital Ocean Install on DigitalOcean

Contributing

This project is open source and welcomes contributions. All contributions are subject to our Code of Conduct.

Visit the project on GitHub

Say Thanks!

License

MIT

Disclaimer

No warranty expressed or implied. Software is as is.