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:
- Clone the repository:
git clone https://github.com/mvaibhav77/mern-jwt-boiler.git
- Install dependencies:
cd mern-jwt-boiler
npm install
cd frontend
npm install
- Configure environment variables:
- Create a
.env
file in the root directory using.env.example
file.
- Run the application:
npm run dev
- 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:
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.