https://github.com/rugvedb/mern-boilerplate
MERN stack boilerplate with store implemented using useReducer + useContext api
https://github.com/rugvedb/mern-boilerplate
authentication boilerplate higher-order-component jsonwebtoken mongodb node-js nodejs react-hooks react-js store usecontext usereducer
Last synced: about 1 year ago
JSON representation
MERN stack boilerplate with store implemented using useReducer + useContext api
- Host: GitHub
- URL: https://github.com/rugvedb/mern-boilerplate
- Owner: RugvedB
- Created: 2020-06-14T17:40:30.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-19T16:50:01.000Z (almost 6 years ago)
- Last Synced: 2025-04-07T00:07:46.677Z (about 1 year ago)
- Topics: authentication, boilerplate, higher-order-component, jsonwebtoken, mongodb, node-js, nodejs, react-hooks, react-js, store, usecontext, usereducer
- Language: JavaScript
- Homepage:
- Size: 2.26 MB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
MERN-Boilerplate
[](https://nodejs.org/en/)
[](https://reactjs.org/docs/getting-started.html)
[](mongodb.com "MongoDB")
### Features
- This boilerplate contains react hooks components, higher order components ,mail verification (sign up ,password reset) ,login ,sample secured and open routes.
- No user with non existing mail id will have access to secured routes.
- No need to use complex redux boiler plate for creating store.
- Store is implemented using useRedux + useContext.
- Ready to use for any MERN stack project.
- Responsive.
- Error handled with proper actions(Eg redirect to login page when trying to access authenticated pages).
------------------------------------------
### Demo
------------------------------------------
### Tech stack
`Backend` : NodeJS
`Database` : MongoDB
`Frontend` : ReactJS
------------------------------------------
### Installation
Clone the repository and install node modules
```
git clone https://github.com/RugvedB/MERN-Boilerplate.git
cd MERN-Boilerplate/
cd client
npm i
cd ../backend
npm i
```
Now create .env file
```
touch .env
```
Fill .env with relevant information as follows
```
PORT=8000
mongoURI= ENTER YOUR MONGOURI HERE
server_base_url=http://localhost:8000
mail_id= ENTER YOUR MAIL ID FROM WHICH VERIFICATION,PASSWORD RESET MAIL WILL BE SENT.
mail_pass= ENTER PASSWORD OF YOUR MAIL ID
SECRET_KEY= somerandomcomplexstring
```
Now we can start the backend server by using the following command
```
node index.js
```
To start frontend server go to root directory and follow the steps(on a new terminal)
```
cd client
npm start
```
Checkout the site on http://localhost:3000/register
------------------------------------------
Developed with :heart: by Rugved