This project is a MERN (MongoDB, Express.js, React.js, Node.js) full-stack web application with robust features, a modern user interface, and a secure backend architecture. The application is designed for real-world scenarios, including user authentication, state management, and responsive design.
With a focus on scalability and performance, this app is optimized for seamless functionality on all devices. Built with Redux Toolkit for efficient state management and styled with Tailwind CSS, it ensures a smooth user experience with reusable, modular components.
project-root
├── client
│ ├── public
│ ├── src
│ │ ├── components # Reusable React components
│ │ ├── pages # Page-specific components
│ │ ├── redux # Redux slices and API integration
│ │ └── App.js # Main entry point for the frontend
│ └── package.json
├── server
│ ├── config # Configuration files (e.g., DB connection)
│ ├── controllers # Controller functions for handling requests
│ ├── middlewares # Middleware functions (e.g., auth, error handling)
│ ├── models # Mongoose models
│ ├── routes # API route definitions
│ ├── utils # Helper functions and utilities
│ └── server.js # Main entry point for the backend
└── README.md
Clone the repository:
git clone https://github.com/krotrn/MERN-Project.git
Navigate to the project directory:
cd MERN-Project
Install dependencies for both backend and frontend:
# Install backend dependencies
npm install
# Navigate to the client directory and install frontend dependencies
cd client
npm install
Create a .env
file in the server
directory and configure the following variables:
PORT=3000
MONGO_URI=your-mongodb-connection-string
JWT_SECRET=your-jwt-secret
NODE_ENV=development
Start the backend server:
npm run server
Start the frontend application:
npm run client
Run both the frontend and backend simultaneously:
npm run dev
Open the application in your browser at http://localhost:5173
or other.
Method | Endpoint | Description |
---|---|---|
POST | /api/users/login |
Logs in a user |
POST | /api/users/register |
Registers a new user |
GET | /api/users/profile |
Retrieves the user's profile |
PUT | /api/users/profile |
Updates the user's profile |
Contributions are welcome! Follow these steps to contribute:
git checkout -b feature/AmazingFeature
git commit -m "Add some AmazingFeature"
git push origin feature/AmazingFeature
This project is licensed under the MIT License. See the LICENSE file for details.