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 |
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.
-
Node.js web server using Express.js
-
OAuth 2.0 Authentication via Facebook, Google, GitHub
-
MVC Project Structure
-
Project specific environment variables using
.env
files anddotenv-safe
by comparing.env.example
and.env
.
-
Create a copy using GitHub's repository template functionality
-
Copy
.env.example
as.env
and update with the respective values. -
Start your app with npm run dev
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
After the above requirements have been met:
- Clone this repository and
cd
into it
git clone https://github.com/solancer/quarantineaid-backend.git
cd quarantineaid-backend
- Install dependencies
npm install
- Set your environment variables
See Twilio Account Settings to locate the necessary environment variables.
- 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
- Navigate to http://localhost:3000
That's it!
You can use npm run start
to start the app in production mode with pm2:
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 | |
---|---|
Digital Ocean |
This project is open source and welcomes contributions. All contributions are subject to our Code of Conduct.
No warranty expressed or implied. Software is as is.