RugvedB / MERN-Boilerplate

MERN stack boilerplate with store implemented using useReducer + useContext api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MERN-Boilerplate

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 ❤️ by Rugved

About

MERN stack boilerplate with store implemented using useReducer + useContext api


Languages

Language:JavaScript 93.2%Language:HTML 4.4%Language:CSS 2.4%