A simple To-Do List app built with React, Vite.js, Golang Fiber, and MongoDB. This app allows users to add, edit, and delete tasks. The tasks are stored in a MongoDB database.
- User registration and login
- Add new tasks
- Edit existing tasks
- Delete tasks
- Store tasks in MongoDB
- User authentication with JWT (JSON Web Token)
- Frontend:
- React
- Vite.js
- Backend:
- Golang Fiber
- MongoDB
- JWT (for authentication)
Before running this project, make sure you have the following installed:
- Node.js (for running React app)
- Golang (for the backend server)
First, clone this repository to your local machine:
git clone https://github.com/Sandhya-Pratama/todo-app.git-
Navigate to the frontend directory:
cd client -
Install dependencies:
npm install
-
Run the development server:
npm run dev
This will start the React app on
http://localhost:5173.
-
Navigate to the backend directory:
cd server -
Install dependencies:
go mod tidy
-
Set up MongoDB:
- Ensure you have a running instance of MongoDB.
- Update the MongoDB connection URL in the backend code.
-
Run the server:
go run main.go
The backend will run on
http://localhost:5000.
Make sure to update the following environment variables in the backend:
- MONGO_URI: MongoDB connection URI.
-
User Registration:
- Go to the register page (
/register) to create a new account. - Provide the required details: username, email, and password.
- Go to the register page (
-
User Login:
- Go to the login page (
/login) to authenticate. - After logging in, you will receive a JWT token that is used for subsequent API requests.
- Go to the login page (
-
Managing Tasks:
- Once logged in, you can add, edit, or delete tasks.
- Tasks are stored in MongoDB and are associated with your user.


