A modern, full-stack habit tracking web application built with FastAPI and vanilla JavaScript. Track your daily habits, build streaks, and visualize your progress with beautiful statistics.
- Secure user registration and login
- JWT-based authentication
- Password hashing with bcrypt
- Session management
- Create, read, update, and delete habits
- Add descriptions to habits
- Organize habits with intuitive UI
- Separate pending and completed habits
- Daily completion tracking
- Current streak calculation
- Best streak records
- Total completion counts
- Detailed habit statistics
- 30-day completion rate
- Visual progress bars
- Per-habit analytics cards
- Update username and email
- Change password securely
- Profile management interface
- Dark mode design
- Gradient accents
- Smooth animations
- Responsive layout
- Mobile-friendly
- Python 3.8 or higher
- pip (Python package manager)
- Modern web browser
- Clone the repository
git clone https://github.com/Devendiran2007/Smart-Habbit-Tracker.git
cd Smart-Habbit-Tracker- Create virtual environment
python -m venv myvenv- Activate virtual environment
- Windows:
myvenv\\Scripts\\activate- macOS/Linux:
source myvenv/bin/activate- Install dependencies
pip install -r requirements.txt- Run the application
uvicorn app.main:app --reload- Open in browser
Navigate to:
frontend/html/home_page.html
The API will be running at http://127.0.0.1:8000
Smart-Habbit-Tracker/
βββ app/ # Backend application
β βββ routers/ # API route handlers
β β βββ users.py # User authentication & profile
β β βββ habbits.py # Habit CRUD operations
β β βββ completions.py # Completion tracking
β βββ models.py # Database models
β βββ schemas.py # Pydantic schemas
β βββ database.py # Database configuration
β βββ auth.py # JWT authentication
β βββ main.py # FastAPI application
βββ frontend/ # Frontend application
β βββ html/ # HTML pages
β β βββ home_page.html # Landing page
β β βββ login.html # Login page
β β βββ signup.html # Registration page
β β βββ dashboard.html # Main dashboard
β βββ css/ # Stylesheets
β β βββ home_page.css
β β βββ auth.css
β β βββ dashboard.css
β βββ js/ # JavaScript files
β βββ api.js # API service
β βββ auth.js # Auth management
β βββ dashboard.js # Dashboard logic
β βββ home_page.js # Homepage logic
βββ requirements.txt # Python dependencies
βββ README.md # This file
- FastAPI - Modern Python web framework
- SQLAlchemy - SQL toolkit and ORM
- SQLite - Lightweight database
- Pydantic - Data validation
- python-jose - JWT tokens
- bcrypt - Password hashing
- Uvicorn - ASGI server
- HTML5 - Structure
- CSS3 - Styling with modern features
- Vanilla JavaScript - No frameworks
- Google Fonts (Inter) - Typography
Once the server is running, visit:
- Swagger UI:
http://127.0.0.1:8000/docs - ReDoc:
http://127.0.0.1:8000/redoc
POST /users/register- Register new userPOST /users/login- Login userGET /users/me- Get current userPUT /users/me- Update profilePUT /users/me/password- Change password
GET /habbits/habbits- Get all habitsPOST /habbits/create- Create habitPUT /habbits/habbits/{id}- Update habitDELETE /habbits/habbits/{id}- Delete habit
POST /completions/{habit_id}- Mark habit completeDELETE /completions/{habit_id}- Unmark completionGET /completions/{habit_id}/today- Check if completed todayGET /completions/{habit_id}/streak- Get current streakGET /completions/{habit_id}/stats- Get detailed stats
- Navigate to the homepage
- Click "Sign Up"
- Enter username, email, and password
- Submit to create account
- Login to your account
- Click "Add Habit" button
- Enter habit name and optional description
- Save to create habit
- Check the checkbox next to a habit to mark it complete
- Completed habits move to "Completed Today" section
- Uncheck to remove completion
- Navigate to "Statistics" tab
- View detailed analytics for each habit
- See streaks, completion rates, and progress
- Navigate to "Profile" tab
- Update username or email
- Change password securely
- Password hashing with bcrypt
- JWT token-based authentication
- CORS middleware configured
- Input validation with Pydantic
- SQL injection protection via ORM
- Secure password requirements
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your 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.
Devendiran K
- GitHub: @Devendiran2007
- FastAPI for the amazing framework
- Google Fonts for Inter typeface
- The open-source community
For questions or feedback, please open an issue on GitHub.
Built with β€οΈ by Devendiran K