A full-stack task management application built with FastAPI, PostgreSQL, and Vue.js.
- Create and view tasks
- Real-time updates
- Clean, responsive UI
- Database persistence
- Vue.js 3 with TypeScript
- Tailwind CSS for styling
- Vite for development
- Unit tests with Vitest
- FastAPI
- PostgreSQL database
- SQLAlchemy ORM
- Repository pattern
- Unit tests with pytest
- Install PostgreSQL if not already installed:
# macOS (using Homebrew)
brew install postgresql
brew services start postgresql- Create the database:
createdb task_management- Update database connection (if needed):
- Open
backend/app/database.py - Modify
SQLALCHEMY_DATABASE_URLif your PostgreSQL credentials are different:
- Open
SQLALCHEMY_DATABASE_URL = "postgresql://postgres:postgres@localhost/task_management"- Install Poetry if not already installed:
curl -sSL https://install.python-poetry.org | python3 -- Install dependencies and activate virtual environment:
cd backend
poetry install
poetry shell- Run the development server:
uvicorn app.main:app --reloadThe API will be available at http://localhost:8000
- Install dependencies:
cd frontend
npm install- Run the development server:
npm run devThe application will be available at http://localhost:5173
API documentation available at:
- http://localhost:8000/docs - Swagger UI
- http://localhost:8000/redoc - ReDoc
- Returns a list of all tasks
- Response:
200 OK
[
{
"id": 1,
"description": "Example task",
"created_at": "2024-01-20T10:00:00Z"
}
]- Creates a new task
- Request body:
{
"description": "New task"
}- Response:
201 Created
- Deletes a task by ID
- Response:
204 No Content - Returns
404 Not Foundif task doesn't exist
cd frontend
npm run test:unitcd backend
poetry run pytest- Ensure PostgreSQL is running
- Verify database exists:
psql -l | grep task_management - Check connection URL matches your PostgreSQL setup
- Default credentials are username: 'postgres', password: 'postgres'
- Backend default port: 8000
- Frontend default port: 5173
- If ports are in use, you can modify:
- Backend: Use
uvicorn app.main:app --reload --port <port> - Frontend: Update
vite.config.ts
- Backend: Use