faizmhd / passport-app

MERN stack application using Passport Js and Docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Passport App

This is a MERN (Mongo, Express, React, Node) stack application which put forward several types of authentication strategy (Local, JWT, Facebook, Google) using Passport JS.

Commands to run the application

In the project directory, you can

  • Use npm package manager:
# First, run the backend
cd back/
npm install
npm start
# Then, run the frontend
cd front/
npm install
npm start
docker-compose build
docker-compose up

Open http://localhost:3000 to view it in the browser.

Technologies

Enable Facebook and Google Authentication

To obtain your API ID for Facebook and Google, please create a project on the two following links :

Then, define a .env file on the back folder like this :

# Facebook ID
FACEBOOK_CLIENT_ID=
FACEBOOK_CLIENT_SECRET=
FACEBOOK_CALLBACK_URL=http://localhost:8000/auth/facebook/callback
# Google ID
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_CALLBACK_URL=http://localhost:8000/auth/google/callback

Additionnal informations

Defaults ports :

Frontend : 3000
Backend : 8000

You can also put some variables informations on the .env file :

# Back-end informations
TITLE=MyApp
SERVER_PORT=8000
NODE_ENV=production
# Mongo DB url
MONGODB_URL=mongodb://localhost:27017/passport-app
# JWT secret key
JWT_KEY=<my_secret_key>

Screenshots

default_page

About

MERN stack application using Passport Js and Docker


Languages

Language:JavaScript 87.2%Language:HTML 5.9%Language:CSS 5.5%Language:Dockerfile 1.4%