cd interntask
docker-compose up --buildcd backend
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000cd frontend
npm install
npm startBackend (.env or environment):
DATABASE_URL=postgresql://taskuser:taskpass@postgres:5432/taskdb
SECRET_KEY=your-secret-key-change-in-production
Frontend (.env or environment):
REACT_APP_API_URL=http://localhost:8000/api/v1
```# SETUP & RUNNING GUIDE
## Prerequisites Installation
### 1. Install Docker (Easiest Way)
- Download from: https://www.docker.com/products/docker-desktop
- Follow installation steps for your OS
### 2. OR Install Components Separately
**Python 3.11+**
- Download from: https://www.python.org/downloads/
- Add Python to PATH during installation
**Node.js 18+**
- Download from: https://nodejs.org/
- Choose LTS version
**PostgreSQL 15+**
- Download from: https://www.postgresql.org/download/
- Set superuser password during installation
---
## QUICK START (Docker Recommended)
### Step 1: Start Services
```bash
cd c:\Users\DELL\Rohith\interntask
docker-compose up --build
Wait for all services to start:
✓ postgres: ready
✓ backend: running on http://localhost:8000
✓ frontend: running on http://localhost:3000
- Frontend UI: http://localhost:3000
- API Documentation: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- Click "Register" and create an account
- Login with your credentials
- Add tasks, mark them complete, delete them
- Logout
# 1. Navigate to backend directory
cd backend
# 2. Create virtual environment
python -m venv venv
# 3. Activate virtual environment
# On Windows:
venv\Scripts\activate
# On Mac/Linux:
source venv/bin/activate
# 4. Install dependencies
pip install -r requirements.txt
# 5. Create .env file
copy .env.example .env
# 6. Configure database in .env
# Edit .env file and set:
# DATABASE_URL=postgresql://taskuser:taskpass@localhost:5432/taskdb
# 7. Initialize database
python init_db.py
# You should see: ✓ Database initialization complete!
# 8. Run server
python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
# Server running at http://localhost:8000# 1. Navigate to frontend directory
cd frontend
# 2. Install dependencies
npm install
# 3. Create .env file
copy .env.example .env
# 4. Start development server
npm start
# Frontend running at http://localhost:3000If using PostgreSQL directly:
-- Connect to PostgreSQL as superuser
-- Create database user
CREATE USER taskuser WITH PASSWORD 'taskpass';
-- Create database
CREATE DATABASE taskdb OWNER taskuser;
-- Grant privileges
GRANT ALL PRIVILEGES ON DATABASE taskdb TO taskuser;- Go to: http://localhost:8000/docs
- Click "Try it out" on endpoints
- Test Register → Login → Create Task
# 1. Register
curl -X POST "http://localhost:8000/api/v1/auth/register" \
-H "Content-Type: application/json" \
-d {
"email": "test@example.com",
"username": "testuser",
"full_name": "Test User",
"password": "SecurePass123!"
}
# 2. Login (save the token!)
curl -X POST "http://localhost:8000/api/v1/auth/login" \
-H "Content-Type: application/json" \
-d {
"email": "test@example.com",
"password": "SecurePass123!"
}
# Copy the "access_token" from response
# 3. Create Task (replace TOKEN with actual token)
curl -X POST "http://localhost:8000/api/v1/tasks" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer TOKEN" \
-d {
"title": "My First Task",
"description": "Testing the API",
"priority": "high"
}
# 4. Get Tasks
curl -X GET "http://localhost:8000/api/v1/tasks" \
-H "Authorization: Bearer TOKEN"# Backend (8000)
netstat -ano | findstr :8000
taskkill /PID <PID> /F
# Frontend (3000)
netstat -ano | findstr :3000
taskkill /PID <PID> /F- Ensure PostgreSQL is running
- Check credentials in .env match database
- Verify DATABASE_URL format
# Reinstall dependencies
pip install -r requirements.txt --force-reinstall# Clear npm cache and reinstall
rm -rf node_modules package-lock.json
npm install- Check CORS_ORIGINS in backend .env
- Ensure frontend URL is listed
docker-compose down
# Remove containers and volumes:
docker-compose down -v- Stop backend: Ctrl+C in backend terminal
- Stop frontend: Ctrl+C in frontend terminal
✅ JWT Authentication ✅ Role-Based Access Control ✅ CRUD APIs ✅ Input Validation ✅ Error Handling ✅ Logging ✅ Auto API Documentation
✅ Login/Register Pages ✅ Protected Routes ✅ Task Dashboard ✅ CRUD Operations ✅ Real-time Status Updates ✅ Responsive Design
✅ PostgreSQL ✅ User Management ✅ Task Storage ✅ Role System
- Explore API Documentation: http://localhost:8000/docs
- Test All Endpoints: Use Swagger UI
- Review Code: Well-commented and structured
- Customize: Add more models, endpoints, features
- Deploy: Use Docker for production deployment
User Browser
↓ (HTTP)
React Frontend (Port 3000)
↓ (API Calls)
FastAPI Backend (Port 8000)
↓ (SQL)
PostgreSQL Database
For detailed documentation, see README.md
Happy coding! 🚀