https://github.com/simranshaikh20/taskify
A modern, responsive task management application built with React. Features include task creation, completion tracking, and intuitive user interface for productivity management.
https://github.com/simranshaikh20/taskify
Last synced: 9 months ago
JSON representation
A modern, responsive task management application built with React. Features include task creation, completion tracking, and intuitive user interface for productivity management.
- Host: GitHub
- URL: https://github.com/simranshaikh20/taskify
- Owner: SimranShaikh20
- Created: 2025-05-13T05:12:15.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-16T15:36:56.000Z (about 1 year ago)
- Last Synced: 2025-06-19T09:12:08.231Z (12 months ago)
- Language: Python
- Homepage: https://taskify-1e72c.web.app/
- Size: 22 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Taskify - Todo Application
A full-stack todo application built with **React** (frontend), **FastAPI** (backend), and **MongoDB** (database). This application allows users to create, read, update, and delete todo items with a modern, responsive interface.
## ๐ Live Demo
- **Frontend**: [https://taskify-todo-app.web.app](https://taskify-todo-app.web.app)
- **API Documentation**: [https://your-backend-url.com/docs](https://your-backend-url.com/docs)
## ๐ Features
- โ
**Create** new todo items
- ๐ **Edit** existing todos inline
- โ๏ธ **Mark** todos as complete/incomplete
- ๐๏ธ **Delete** todos with confirmation
- ๐ **Progress tracking** with completion percentage
- ๐จ **Modern UI** with Tailwind CSS
- ๐ฑ **Responsive design** for all devices
- โก **Real-time updates** with loading states
- ๐ **Error handling** and user feedback
- ๐ **REST API** with automatic documentation
## ๐ ๏ธ Tech Stack
### Frontend
- **React 18** - Modern JavaScript library for building user interfaces
- **Tailwind CSS** - Utility-first CSS framework for styling
- **Lucide React** - Beautiful icons for React applications
- **JavaScript ES6+** - Modern JavaScript features
### Backend
- **FastAPI** - Modern, fast Python web framework
- **Pydantic** - Data validation using Python type annotations
- **Motor** - Async MongoDB driver for Python
- **Uvicorn** - ASGI server for running FastAPI applications
### Database
- **MongoDB** - NoSQL document database for flexible data storage
### Deployment
- **Firebase Hosting** - Frontend deployment
- **Railway/Heroku** - Backend deployment options
## ๐ Prerequisites
Before running this application, make sure you have the following installed:
- **Node.js** (v16 or higher) - [Download here](https://nodejs.org/)
- **Python** (v3.8 or higher) - [Download here](https://python.org/)
- **MongoDB** - [Download here](https://www.mongodb.com/try/download/community) or use [MongoDB Atlas](https://www.mongodb.com/cloud/atlas)
- **Git** - [Download here](https://git-scm.com/)
## ๐ Installation & Setup
### 1. Clone the Repository
```bash
git clone https://github.com/SimranShaikh20/taskify.git
cd taskify
```
### 2. Backend Setup (FastAPI + MongoDB)
```bash
# Navigate to backend directory
cd backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install fastapi uvicorn motor pymongo python-multipart
# Or using requirements.txt (if available)
pip install -r requirements.txt
```
### 3. Frontend Setup (React)
```bash
# Navigate to frontend directory
cd todo-frontend
# Install dependencies
npm install
# Install additional dependencies
npm install lucide-react
# Install Tailwind CSS (if not already configured)
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
```
### 4. Database Setup (MongoDB)
#### Option A: Local MongoDB Installation
1. Install MongoDB Community Edition
2. Start MongoDB service:
```bash
# On Windows (as service)
net start MongoDB
# On macOS with Homebrew
brew services start mongodb-community
# On Linux
sudo systemctl start mongod
```
#### Option B: MongoDB Atlas (Cloud)
1. Create a free account at [MongoDB Atlas](https://www.mongodb.com/cloud/atlas)
2. Create a new cluster
3. Get your connection string
4. Update the `MONGODB_URL` in your backend configuration
### 5. Environment Configuration
Create a `.env` file in the backend directory:
```env
# Database Configuration
MONGODB_URL=mongodb://localhost:27017
# For MongoDB Atlas, use your connection string:
# MONGODB_URL=mongodb+srv://username:password@cluster.mongodb.net/
# API Configuration
HOST=0.0.0.0
PORT=8000
DEBUG=True
```
## ๐โโ๏ธ Running the Application
### 1. Start the Backend Server
```bash
cd backend
uvicorn main:app --reload --host 0.0.0.0 --port 8000
```
The backend will be available at:
- **API**: http://localhost:8000
- **API Documentation**: http://localhost:8000/docs
- **Alternative Docs**: http://localhost:8000/redoc
### 2. Start the Frontend Development Server
```bash
cd todo-frontend
npm start
```
The frontend will be available at:
- **Application**: http://localhost:3000
## ๐ Project Structure
```
taskify/
โโโ __pycache__/ # Python cache files
โโโ config/
โ โโโ __pycache__/
โ โโโ database.py # Database connection configuration
โโโ model/
โ โโโ __pycache__/
โ โโโ todos.py # Pydantic models for data validation
โโโ routes/
โ โโโ __pycache__/
โ โโโ route.py # API route handlers
โโโ schema/
โ โโโ __pycache__/
โ โโโ schemas.py # Data schemas
โโโ todo-frontend/
โ โโโ node_modules/ # Node.js dependencies
โ โโโ public/
โ โ โโโ favicon.ico
โ โ โโโ index.html
โ โ โโโ logo192.png
โ โ โโโ logo512.png
โ โ โโโ manifest.json
โ โ โโโ robots.txt
โ โโโ src/
โ โ โโโ components/
โ โ โ โโโ TodoForm.js # Form for creating new todos
โ โ โ โโโ TodoItem.js # Individual todo item component
โ โ โ โโโ TodoList.js # List container for todos
โ โ โโโ App.css # Application styles
โ โ โโโ App.js # Main React application
โ โ โโโ App.test.js # Application tests
โ โ โโโ index.css # Global styles
โ โ โโโ index.js # React entry point
โ โ โโโ logo.svg # React logo
โ โ โโโ reportWebVitals.js # Performance monitoring
โ โโโ package.json # Node.js dependencies
โ โโโ package-lock.json # Dependency lock file
โโโ firebase.json # Firebase configuration
โโโ .firebaserc # Firebase project settings
โโโ main.py # FastAPI application entry point
```
## ๐ API Endpoints
The backend provides the following REST API endpoints:
| Method | Endpoint | Description |
|--------|----------|-------------|
| `GET` | `/todos/` | Get all todos |
| `POST` | `/todos/` | Create a new todo |
| `GET` | `/todos/{id}` | Get a specific todo |
| `PUT` | `/todos/{id}` | Update a todo |
| `DELETE` | `/todos/{id}` | Delete a todo |
| `GET` | `/` | API status |
| `GET` | `/health` | Health check |
## ๐ง Configuration
### Backend Configuration
Edit `.env` file in the root directory to configure:
```env
# Database
MONGODB_URL=mongodb://localhost:27017
DATABASE_NAME=taskify_db
# Server
HOST=0.0.0.0
PORT=8000
DEBUG=True
# CORS (add your frontend URLs)
CORS_ORIGINS=["http://localhost:3000", "https://taskify-todo-app.web.app"]
```
### Frontend Configuration
Update API base URL in your frontend service files:
```javascript
// For development
const API_BASE_URL = 'http://localhost:8000';
// For production
const API_BASE_URL = 'https://your-backend-url.com';
```
## ๐ Deployment
### ๐ฅ Firebase Deployment (Frontend)
Deploy your React frontend to Firebase Hosting for free:
#### 1. ๐ฆ Build the React App
```bash
cd todo-frontend
npm run build
```
#### 2. ๐ง Set Up Firebase Hosting
Install Firebase CLI and login (one-time setup):
```bash
# Install Firebase CLI globally
npm install -g firebase-tools
# Login to Firebase
firebase login
```
#### 3. ๐ฏ Initialize Firebase
```bash
cd todo-frontend
firebase init
```
**Configuration Options:**
- โ **Which Firebase features?** โ Select "Hosting"
- โ **Select a default Firebase project** โ Choose existing or create new project
- โ **Public directory** โ Enter: `build`
- โ **Configure as single-page app?** โ **Yes**
- โ **Set up automatic builds with GitHub?** โ **No** (for now)
- ๐ซ **Don't overwrite** `index.html` if prompted
This creates a `firebase.json` file:
```json
{
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
```
#### 4. ๐ Deploy to Firebase
```bash
firebase deploy
```
After deployment, you'll get a live URL:
```
โ
Deploy complete!
Project Console: https://console.firebase.google.com/project/taskify-todo-app
Hosting URL: https://taskify-todo-app.web.app
```
#### 5. ๐ Future Deployments
For subsequent deployments:
```bash
# Build the latest changes
npm run build
# Deploy to Firebase
firebase deploy
```
### ๐ Backend Deployment (Render)
Deploy your FastAPI backend easily using [Render](https://render.com):
## ๐ Troubleshooting
### Common Issues
#### 1. MongoDB Connection Error
```
pymongo.errors.ServerSelectionTimeoutError
```
**Solution**: Make sure MongoDB is running and the connection string is correct.
#### 2. CORS Error
```
Access to fetch at 'http://localhost:8000' from origin 'http://localhost:3000' has been blocked by CORS policy
```
**Solution**: Ensure CORS middleware is properly configured in `main.py`.
#### 3. Firebase Deployment - Blank Page
**Solution**:
- Ensure `"public": "build"` in `firebase.json`
- Check SPA rewrite rule exists
- Clear browser cache
#### 4. Port Already in Use
```
OSError: [Errno 48] Address already in use
```
**Solution**: Kill the process using the port or use a different port:
```bash
# Kill process on port 8000
lsof -ti:8000 | xargs kill -9
# Or use different port
uvicorn main:app --reload --port 8001
```
### Debug Mode
Enable debug mode by setting `DEBUG=True` in `.env` file or running:
```bash
uvicorn main:app --reload --log-level debug
```
## ๐ API Documentation
FastAPI automatically generates interactive API documentation:
- **Swagger UI**: http://localhost:8000/docs
- **ReDoc**: http://localhost:8000/redoc
These interfaces allow you to:
- Explore all available endpoints
- Test API calls directly from the browser
- View request/response schemas
- Download OpenAPI specification
## ๐งช Testing
### Backend Testing
```bash
# Install testing dependencies
pip install pytest httpx
# Run tests
pytest
```
### Frontend Testing
```bash
cd todo-frontend
# Run tests
npm test
# Run tests with coverage
npm test -- --coverage
```
## ๐ค Contributing
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ๐จโ๐ป Author
**Simran Shaikh**
- GitHub: [SimranShaikh20](https://github.com/SimranShaikh20)
- Project: [Taskify](https://github.com/SimranShaikh20/taskify)
## ๐ Acknowledgments
- [FastAPI](https://fastapi.tiangolo.com/) for the amazing Python web framework
- [React](https://reactjs.org/) for the powerful frontend library
- [MongoDB](https://www.mongodb.com/) for the flexible database solution
- [Tailwind CSS](https://tailwindcss.com/) for the utility-first CSS framework
- [Lucide](https://lucide.dev/) for the beautiful icons
- [Firebase](https://firebase.google.com/) for free and reliable hosting
---
โญ **If you found Taskify helpful, please give it a star!** โญ
๐ **Live Demo**: [App](https://taskify-1e72c.web.app/)