A simple web application built with the MERN (MongoDB, Express.js, React.js, Node.js) stack to perform CRUD (Create, Read, Update, Delete) operations on company data.
This project is a full-stack web application that allows users to manage company information. It includes the following features:
- Create: Add new company entries with details like company name, phone, email, location, website link, and description.
- Read: View a list of all companies and access detailed information about each company.
- Update: Edit and update company information.
- Delete: Remove company entries from the database.
- Authentication: Users can register and log in to the application.
- Authorization: Authenticated users have access to CRUD operations.
- Responsive UI: The application is designed to work on both desktop and mobile devices.
- Error Handling: Comprehensive error handling for various scenarios.
- Validation: Input validation and error messages for user-friendly interactions.
-
Clone the repository:
git clone https://github.com/yourusername/mern-crud-project.git
Navigate to the client and server directories and install dependencies:
bash Copy code cd client npm install bash Copy code cd server npm install Set up your MongoDB database and configure the connection in server/db.js.
Create a .env file in the server directory and add your environment variables, such as database connection details and JWT secret:
makefile Copy code MONGODB_URI=your_database_uri JWT_SECRET=your_secret_key Start the development server for both the client and server:
bash Copy code
cd client npm start bash Copy code
cd server npm start Usage Open your web browser and navigate to http://localhost:3000 to access the application.
Register for an account or log in with your credentials.
Use the application to perform CRUD operations on company data.
Folder Structure /client: Frontend React application. /server: Backend Express.js application. /server/controllers: Controllers for handling CRUD operations. /server/models: MongoDB models. /server/routes: Express routes for API endpoints. Contributing Contributions to this project are welcome. Please follow these steps:
Fork the project. Create a new branch for your feature or bug fix: git checkout -b feature/your-feature. Commit your changes and push to your forked repository. Create a pull request to the original repository's main branch. License This project is licensed under the MIT License.
Feel free to customize this README according to your project's specific details and requirements. You can also add sections like "Deployment," "Testing," or "Acknowledgments" based on your project's complexity and needs.