Dev setup:
- Install
- MongoDB Community Edition: https://docs.mongodb.com/manual/administration/install-community/
- NodeJS: https://nodejs.org
- Python: https://python.org
-
Clone this repository
git clone https://github.com/thegirlcode/backend.git
-
Install required packages
cd backend npm install npm install -g nodemon
-
Create keyfile as auth/keys.js:
module.exports = { googleID: 'googleSignInID', googleSecret: 'googleSignInSecret', facebookID: 'facebookSignInID', facebookSecret: 'facebookSignInSecret' };
-
Start server
In one Terminal, open and leave running:
mkdir ~/mongo
mongod --dbpath ~/mongo
In another Terminal:
nodemon bin/www
- Site will be at localhost:62442
Note: In order for Facebook and Google login to work on localhost, you will need to do the following:
-
Create a self-signed SSL certificate: https://github.com/FiloSottile/mkcert
-
Install and setup nginx: https://nginx.org
-
Use nginx to serve the self-signed certificate: https://stackoverflow.com/a/25857318
Or any other method of serving localhost:3000 as https://localhost. Site will be live at latter URL.
Prod setup:
- Install
- MongoDB Community Edition: https://docs.mongodb.com/manual/administration/install-community/
- NodeJS: https://nodejs.org
- Python: https://python.org
- Firejail: https://firejail.wordpress.com
-
Clone this repository
git clone https://github.com/thegirlcode/backend.git
-
Install required packages
cd backend npm install npm install -g forever
-
Create keyfile as auth/keys.js:
module.exports = { googleID: 'googleSignInID', googleSecret: 'googleSignInSecret', facebookID: 'facebookSignInID', facebookSecret: 'facebookSignInSecret' };
-
Start server
Start Mongo as system service: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/#run-mongodb-community-edition
Start forever.js server
sudo NODE_ENV=production forever start bin/www
- Site will be at localhost:3000. Must use nginx and certbot to create an SSL certificate and serve site over https://domain as Google and Facebook login will not work without it.