A powerful, modern full-stack habit tracking application that helps you build consistency and track your daily progress with an elegant, responsive interface.
Features β’ Tech Stack β’ Installation β’ API Reference β’ Contributing
|
|
|
|
- FastAPI - Modern, fast web framework for building APIs
- SQLAlchemy - SQL toolkit and ORM
- Alembic - Database migration tool
- Pydantic - Data validation using Python type hints
- Python-Jose - JWT implementation
- Next.js 15 - React framework with App Router
- React 19 - UI library
- TypeScript - Type-safe JavaScript
- Tailwind CSS v4 - Utility-first CSS framework
- shadcn/ui - Re-usable component library
- Lucide Icons - Beautiful icon set
- SQLite - Lightweight, serverless database
- Playwright MCP - End-to-end testing framework
AIProjects/
βββ π backend/
β βββ π src/
β β βββ π api/
β β β βββ auth.py # Authentication endpoints
β β β βββ habits.py # Habit CRUD endpoints
β β βββ π models/
β β β βββ usuario.py # User model
β β β βββ habito.py # Habit model
β β β βββ tarefa.py # Task model
β β βββ database.py # Database configuration
β β βββ main.py # FastAPI application
β βββ π alembic/ # Database migrations
β βββ requirements.txt
β βββ alembic.ini
β
βββ π frontend/
β βββ π my-app/
β βββ π app/
β β βββ π dashboard/ # Dashboard page
β β βββ π login/ # Login page
β β βββ layout.tsx
β β βββ page.tsx
β βββ π components/
β β βββ π dashboard/ # Dashboard components
β β βββ π ui/ # shadcn/ui components
β βββ π lib/
β β βββ api.ts # API client with JWT auth
β β βββ utils.ts
β βββ π tests/ # Test files
β βββ package.json
β βββ next.config.ts
β
βββ README.md
- Python 3.14+
- Node.js 18+
- npm or yarn
git clone https://github.com/Ansbach-0/AIProjects.git
cd AIProjects# Navigate to backend directory
cd backend
# Install Python dependencies
pip install -r requirements.txt
# Run database migrations
alembic upgrade head
# Start the FastAPI server
uvicorn src.main:app --reload --host 0.0.0.0 --port 8000The backend API will be available at http://localhost:8000
FastAPI Docs: Visit http://localhost:8000/docs for interactive API documentation
# Navigate to frontend directory
cd frontend/my-app
# Install dependencies
npm install
# Start the development server
npm run devThe frontend will be available at http://localhost:3000
Create a .env file in the frontend directory:
NEXT_PUBLIC_API_URL=http://localhost:8000| Method | Endpoint | Description |
|---|---|---|
POST |
/auth/register |
Register a new user |
POST |
/auth/login |
Login and receive JWT token |
GET |
/auth/me |
Get current user info (requires auth) |
Request Body (Login):
{
"email": "user@example.com",
"password": "securepassword"
}Response:
{
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"token_type": "bearer"
}| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/habits/ |
List all user habits | β |
POST |
/habits/ |
Create a new habit | β |
GET |
/habits/{id} |
Get habit by ID | β |
PUT |
/habits/{id} |
Update habit | β |
DELETE |
/habits/{id} |
Delete habit | β |
Request Body (Create Habit):
{
"name": "Morning Exercise",
"description": "30 minutes of cardio every morning"
}Response:
{
"id": 1,
"name": "Morning Exercise",
"description": "30 minutes of cardio every morning",
"usuario_id": 1
}- Register/Login - Create an account or login with existing credentials
- Dashboard - View your habits dashboard with completion stats
- Create Habits - Click "New Habit" to add habits you want to track
- Mark Complete - Click "Mark Complete" when you finish a habit for the day
- Track Progress - View stats: Total habits, Completed today, Remaining
- Delete Habits - Remove habits you no longer want to track
The project uses Playwright MCP for comprehensive E2E testing:
# Run tests
npm test
# Run tests in watch mode
npm test -- --watch- β Authentication flow (login/register)
- β Habit creation
- β Habit completion marking
- β Habit deletion
- β Dashboard stats updates
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Ansbach-0 & AndreRachid-rgb
- GitHub: @Ansbach-0
- GitHub: @AndreRachid-rgb
- FastAPI for the amazing Python web framework
- Next.js for the powerful React framework
- shadcn/ui for the beautiful component library
- Tailwind CSS for the utility-first CSS framework