Skip to content

mvaibhav77/mern-jwt-boiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MERN Stack Boilerplate with JWT Authentication and Redux

This repository provides a boilerplate for building a full-stack MERN application with JWT authentication and Redux state management for the frontend.

Features:

  • Backend: Express.js, Node.js, MongoDB
  • Frontend: React.js, Redux
  • Authentication: JWT

Getting Started:

  1. Clone the repository:
git clone https://github.com/mvaibhav77/mern-jwt-boiler.git
  1. Install dependencies:
cd mern-jwt-boiler
npm install
cd frontend
npm install
  1. Configure environment variables:
  • Create a .env file in the root directory using .env.example file.
  1. Run the application:
npm run dev
  1. Redux API Configure
  • Replace baseUrl with '', to point APIs to dev server. Rest vite is configured to handle the proxy.

APIs: (Replace <placeholder> with actual endpoint paths)

  • User registration: POST <placeholder>/users/register (Body: { username, email, password })
  • User login: POST <placeholder>/users/auth (Body: { email, password })
  • Protected routes: GET <placeholder>/users/something (Requires JWT authorization)

Google Docs For Step by Step Setup:

Open Doc

Postman Collection:

The provided Postman collection (Run In Postman) can be imported into your Postman environment to test the API endpoints. You can also update the environment variables within Postman to match your local setup.

Note:

  • This is a boilerplate and needs further customization for your specific application needs.
  • Refer to the documentation for Express.js, MongoDB, React.js, and Redux for more details on each framework.

Releases

No releases published

Packages

No packages published