MERN authentication flow
MIT License
git clone https://github.com/ABSphreak/mern-auth.git
root
& client
folder.
npm install
cd client
npm install
.env
in root
folder.PORT
→ Mention a custom port for running the Express server (default is 5000).MONGO_URI
→ Put your MONGO_DB connection string here.JWT_SECRET
→ Put anything you like, it will be used for auth_token
validation.
PORT=6969
MONGO_URI=mongodb+srv://<user>:<pwd>@<cluster>-onltw.mongodb.net/<collection_name>?retryWrites=true&w=majority
JWT_SECRET=RandomTextString
root
(backend)npm run dev
→ Runs the server in development mode.nodemon
to monitor changes to the API.morgan
to log the request data.npm start
→ Runs the server in production mode.client
(frontend)npm start
→ Invokes react-scripts start
.npm build
→ Invokes react-scripts build
.npm test
→ Invokes react-scripts test
.npm eject
→ Invokes react-scripts eject
.For now there are two ongoing branches:
master
→ Has the Bootstrap based client application.material-ui
→ Has MaterialUI based client application.More info coming soon!