This is a small todo application built using ReactJS with Vite, Styled-components, React-query, Node.js, and Express. The application allows users to manage their todo tasks efficiently.
- Todo Management: Users can create, read, update, and delete todo tasks.
- External API Integration: The application seeds the database with todo data obtained from an external API (https://dummyjson.com/todos) during the initial request.
- Containerized Deployment: You can easily run the application using Docker Compose.
- Native Development: Alternatively, you can run the application natively on your machine.
Before running the application, ensure you have the following installed:
- Node.js (version 18)
- Docker (if using Docker Compose)
- MongoDB (if running natively)
To run the application, follow these steps:
- Clone the repository to your local machine.
- Open a terminal and navigate to the main directory of the application.
If you prefer using Docker Compose to run the application, follow these steps:
- Update the database connection URL in the
backend/.envfile. ChangeDB_CONNECTIONtomongodb://mongo:27017/todos. - In the terminal, run the following command:
This command will start the application and set up the necessary containers.
docker-compose up
If you choose to run the application natively, follow these steps:
- Ensure you have MongoDB up and running on your local machine.
- Open a terminal and navigate to the
backendfolder of the application. - Update the database connection URL in the
.envfile. ChangeDB_CONNECTIONtomongodb://127.0.0.1:27017/todos. - Install the backend dependencies by running the following command:
npm install
- Start the backend server by running the following command:
npm run dev
- Open another terminal window and navigate to the
frontendfolder of the application. - Install the frontend dependencies by running the following command:
npm install
- Start the frontend development server by running the following command:
npm start
Once the application is up and running, you can access it by opening a web browser and navigating to http://localhost:5173. You will be presented with the todo application interface.
- To create a new todo task, enter the task details in the input field and press Enter or click the "Add" button.
- To mark a task as complete, click the checkbox next to it.
- To edit a task, click the task name and modify it in the input field. Press Enter or click outside the field to save the changes.
- To delete a task, click the "Delete" button next to it.
This project is licensed under the MIT License. Feel free to modify and use it according to your needs.
- This application was built using various open-source libraries and frameworks, including ReactJS, Styled-components, React-query, Node.js, and Express.
- Thanks to the dummyjson.com API for providing sample todo data.