This project is a solution to the MERN Stack Coding Challenge. The goal is to build a web application that leverages the full MERN stack (MongoDB, Express, React, and Node.js). The application adheres to the requirements specified in the challenge document. This includes user authentication, data management, and providing a responsive interface for interacting with the data.
- User Authentication: Secure authentication using JWT (JSON Web Tokens) to protect routes and manage sessions.
- CRUD Operations: Full Create, Read, Update, Delete functionality for managing resources (e.g., posts, comments).
- Responsive Frontend: Built with React to provide a dynamic, responsive user experience across various devices.
- State Management: Utilizes Redux (if applicable) to manage application state across the frontend.
- Error Handling & Validation: Proper error handling on both frontend and backend, with validation for user inputs.
- Frontend: React, React Router, Redux (if applicable)
- Backend: Node.js, Express.js
- Database: MongoDB, Mongoose
- Additional Tools: Axios (for API requests), JWT (for authentication), Bcrypt (for password hashing), dotenv (for managing environment variables)
Follow these steps to set up the project locally:
-
Clone the repository:
git clone [repository-url]
-
Navigate to the project directory:
cd [project-directory] -
Install dependencies for both the backend and frontend:
cd backend npm install cd ../frontend npm install
-
Create a
.envfile in the backend directory and add the following environment variables:PORT=5000 MONGO_URI=your-mongodb-uri JWT_SECRET=your-jwt-secret -
Start the development servers:
cd backend npm run dev cd ../frontend npm start
-
Open your browser and navigate to
http://localhost:3000to access the application.
- Register an Account: Navigate to the registration page and fill out the form to create an account.
- Login: Once registered, log in using your credentials to access the protected routes.
- Perform CRUD Operations: After logging in, you can create, view, edit, and delete resources (e.g., posts or comments).
- Logout: Use the logout functionality to safely exit the application.
Contributions are welcome! Follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name). - Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/your-feature-name). - Open a pull request.
This project is licensed under the MIT License.