- 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).
Backend
: NodeJS
Database
: MongoDB
Frontend
: ReactJS
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