Skip to content
Server backend for The Girl Code
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
__pycache__
auth
bin
prefiles
public
routes
sandbox
views
.gitignore
LICENSE
README.md
app.js
faketty.sh
package-lock.json
package.json

README.md

Server backend for The Girl Code

Dev setup:

  1. Install
  1. Clone this repository

     git clone https://github.com/thegirlcode/backend.git
    
  2. Install required packages

     cd backend
    
     npm install
    
     npm install -g nodemon
    
  3. Create keyfile as auth/keys.js:

     module.exports = {
     	googleID: 'googleSignInID',
     	googleSecret: 'googleSignInSecret',
     	facebookID: 'facebookSignInID',
     	facebookSecret: 'facebookSignInSecret'
     };
    
  4. Start server

In one Terminal, open and leave running:

    mkdir ~/mongo
    mongod --dbpath ~/mongo

In another Terminal:

    nodemon bin/www
  1. 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:

  1. Create a self-signed SSL certificate: https://github.com/FiloSottile/mkcert

  2. Install and setup nginx: https://nginx.org

  3. 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:

  1. Install
  1. Clone this repository

     git clone https://github.com/thegirlcode/backend.git
    
  2. Install required packages

     cd backend
    
     npm install
    
     npm install -g forever
    
  3. Create keyfile as auth/keys.js:

     module.exports = {
       googleID: 'googleSignInID',
       googleSecret: 'googleSignInSecret',
       facebookID: 'facebookSignInID',
       facebookSecret: 'facebookSignInSecret'
     };
    
  4. 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
  1. 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.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.