A fun and modern full-stack todo application that demonstrates how backend and frontend work together! Built with Express.js, MongoDB, React, and Vite.
- π― Educational: Clear separation between backend and frontend
- π¨ Beautiful: Modern, responsive UI with fun animations
- π Fast: Vite for lightning-fast development
- π‘οΈ Robust: Input validation, error handling, and proper API design
- π± Mobile-First: Works perfectly on all devices
- π Fun: Emojis, animations, and delightful user experience
inventor/
βββ backend/ # Express.js API server
β βββ server.js # Main server file
β βββ models/ # MongoDB models
β βββ routes/ # API routes
β βββ package.json # Backend dependencies
βββ frontend/ # React + Vite frontend
β βββ src/ # React components and services
β βββ index.html # HTML template
β βββ package.json # Frontend dependencies
βββ memory-bank/ # Project documentation
- Node.js (v18+ recommended)
- MongoDB connection string
- Git
git clone [your-repo-url]
cd inventor
cd backend
npm install
# Create .env file
echo "MONGODB_URI=your_mongodb_connection_string_here" > .env
echo "PORT=3000" >> .env
# Start backend server
npm run dev
cd ../frontend
npm install
# Start frontend development server
npm run dev
- Frontend: http://localhost:5173
- Backend API: http://localhost:3000
- β RESTful API with full CRUD operations
- π Todo statistics and analytics
- π Advanced filtering and sorting
- π‘οΈ Input validation and error handling
- π¨ Fun API responses with emojis
- π‘ CORS enabled for frontend communication
- β‘ Lightning-fast development with Vite
- π¨ Beautiful, responsive UI design
- π± Mobile-friendly interface
- π Real-time updates and notifications
- π― Priority-based color coding
- βοΈ Inline editing capabilities
- π Advanced filtering and sorting options
Method | Endpoint | Description |
---|---|---|
GET | /api/todos |
Get all todos (with filters) |
POST | /api/todos |
Create new todo |
PUT | /api/todos/:id |
Update todo |
DELETE | /api/todos/:id |
Delete todo |
GET | /api/todos/stats/summary |
Get statistics |
GET | /api/health |
Health check |
# Get all todos
curl http://localhost:3000/api/todos
# Create a new todo
curl -X POST http://localhost:3000/api/todos \
-H "Content-Type: application/json" \
-d '{"title":"Learn React","priority":"high"}'
# Filter todos
curl http://localhost:3000/api/todos?completed=false&priority=high
- RESTful: Standard HTTP methods and status codes
- Friendly: API responses include helpful messages with emojis
- Robust: Comprehensive error handling and validation
- Extensible: Easy to add new features and endpoints
- Component-Based: Modular React components
- Responsive: Mobile-first design approach
- Interactive: Smooth animations and transitions
- Accessible: Proper labels and keyboard navigation
- Fun: Delightful user experience with personality
cd backend
npm run dev # Start with nodemon for auto-restart
cd frontend
npm run dev # Start Vite dev server with hot reload
# Backend (no build needed, just deploy)
cd backend
npm start
# Frontend
cd frontend
npm run build
npm run preview # Preview production build
This project demonstrates:
- API Design: How to create a clean, RESTful API
- Database Integration: MongoDB with Mongoose ODM
- Frontend-Backend Communication: HTTP requests and responses
- React Development: Modern React with hooks
- Modern Tooling: Vite for fast development
- Error Handling: Graceful error handling on both ends
- User Experience: Creating delightful interfaces
- Code Organization: Clean, maintainable code structure
{
title: String, // Required, max 200 chars
description: String, // Optional, max 500 chars
completed: Boolean, // Default: false
priority: String, // 'low', 'medium', 'high'
createdAt: Date, // Auto-generated
updatedAt: Date, // Auto-updated
ageInDays: Number // Virtual field
}
- Set environment variables for production
- Use PM2 or similar for process management
- Consider using MongoDB Atlas for cloud database
- Build with
npm run build
- Deploy
dist
folder to static hosting (Vercel, Netlify, etc.) - Update API base URL for production
This is an educational project, but feel free to:
- Report bugs or issues
- Suggest improvements
- Add new features
- Improve documentation
Β© 2024 Inventors Community - Made with β€οΈ for learning and productivity
- Get your MongoDB connection string ready
- Follow the setup steps above
- Start building amazing things!
Happy coding! π