Một ứng dụng Todo List đầy đủ tính năng được xây dựng với React, Node.js, Express, và MongoDB.
- ✅ Thêm, sửa, xóa công việc
- ✅ Đánh dấu hoàn thành công việc
- ✅ Lọc theo trạng thái (Tất cả, Đang làm, Hoàn thành)
- ✅ Phân trang (5 tasks mỗi trang)
- ✅ Hiển thị ngày tháng tạo và hoàn thành
- ✅ Animated shader background
- ✅ Responsive design
- ✅ Dark mode support
- ✅ Toast notifications
- React 19
- Vite
- Tailwind CSS 4
- Shadcn UI
- Sonner (Toast notifications)
- Three.js (Animated background)
- Axios
- Node.js
- Express 5
- MongoDB / Mongoose
- CORS
- Node.js 18+
- MongoDB (local hoặc Atlas)
- Clone repository:
git clone <repository-url>
cd todo-appx- Cài đặt dependencies:
npm run install:all- Cấu hình environment variables:
Tạo file backend/.env:
MONGO_URI=mongodb://localhost:27017/todo-app
PORT=5001
NODE_ENV=development
FRONTEND_URL=http://localhost:5173- Chạy backend:
npm run dev:backend
# hoặc
cd backend && npm run dev- Chạy frontend (terminal mới):
npm run dev:frontend
# hoặc
cd frontend && npm run dev- Mở browser:
- Frontend: http://localhost:5173
- Backend API: http://localhost:5001/api/tasks
# Build frontend
npm run build
# Start production server
npm startGET /api/tasks- Lấy tất cả tasksPOST /api/tasks- Tạo task mới{ "title": "Task title" }PUT /api/tasks/:id- Cập nhật task{ "title": "Updated title", "status": "completed" }DELETE /api/tasks/:id- Xóa task
- Push code lên GitHub
- Tạo Web Service trên Render
- Connect GitHub repository
- Set environment variables:
NODE_ENV=productionMONGO_URI=your_mongodb_connection_stringFRONTEND_URL=https://your-app.onrender.com
- Build Command:
npm install && npm install --prefix frontend && npm install --prefix backend && npm run build --prefix frontend - Start Command:
npm run start --prefix backend
todo-appx/
├── backend/
│ ├── src/
│ │ ├── config/
│ │ │ └── db.js
│ │ ├── controllers/
│ │ │ └── tasksControllers.js
│ │ ├── routes/
│ │ │ └── tasksRouters.js
│ │ └── server.js
│ ├── models/
│ │ └── Task.js
│ └── package.json
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ ├── ui/
│ │ │ └── TodoApp.jsx
│ │ ├── pages/
│ │ ├── services/
│ │ │ └── api.js
│ │ └── App.jsx
│ └── package.json
├── package.json
├── render.yaml
└── README.md
npm run install:all- Cài đặt tất cả dependenciesnpm run build- Build frontendnpm start- Start production servernpm run dev:frontend- Chạy frontend dev servernpm run dev:backend- Chạy backend dev server
ISC