Skip to content

About

This is Project is Mainly Focused for my Learning Purpose so Hope I Will Learn Lot of Stuffs from this..

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎯 Habiture - Smart Habit Tracker

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.

Habiture Banner Python FastAPI License

✨ Features

πŸ” User Authentication

  • Secure user registration and login
  • JWT-based authentication
  • Password hashing with bcrypt
  • Session management

πŸ“Š Habit Management

  • Create, read, update, and delete habits
  • Add descriptions to habits
  • Organize habits with intuitive UI
  • Separate pending and completed habits

πŸ”₯ Streak Tracking

  • Daily completion tracking
  • Current streak calculation
  • Best streak records
  • Total completion counts

πŸ“ˆ Statistics & Analytics

  • Detailed habit statistics
  • 30-day completion rate
  • Visual progress bars
  • Per-habit analytics cards

βš™οΈ User Profile

  • Update username and email
  • Change password securely
  • Profile management interface

🎨 Modern UI/UX

  • Dark mode design
  • Gradient accents
  • Smooth animations
  • Responsive layout
  • Mobile-friendly

πŸš€ Quick Start

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)
  • Modern web browser

Installation

  1. Clone the repository
git clone https://github.com/Devendiran2007/Smart-Habbit-Tracker.git
cd Smart-Habbit-Tracker
  1. Create virtual environment
python -m venv myvenv
  1. Activate virtual environment
  • Windows:
myvenv\\Scripts\\activate
  • macOS/Linux:
source myvenv/bin/activate
  1. Install dependencies
pip install -r requirements.txt
  1. Run the application
uvicorn app.main:app --reload
  1. Open in browser Navigate to: frontend/html/home_page.html

The API will be running at http://127.0.0.1:8000

πŸ“ Project Structure

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

πŸ› οΈ Technology Stack

Backend

  • 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

Frontend

  • HTML5 - Structure
  • CSS3 - Styling with modern features
  • Vanilla JavaScript - No frameworks
  • Google Fonts (Inter) - Typography

πŸ“– API Documentation

Once the server is running, visit:

  • Swagger UI: http://127.0.0.1:8000/docs
  • ReDoc: http://127.0.0.1:8000/redoc

Key Endpoints

Authentication

  • POST /users/register - Register new user
  • POST /users/login - Login user
  • GET /users/me - Get current user
  • PUT /users/me - Update profile
  • PUT /users/me/password - Change password

Habits

  • GET /habbits/habbits - Get all habits
  • POST /habbits/create - Create habit
  • PUT /habbits/habbits/{id} - Update habit
  • DELETE /habbits/habbits/{id} - Delete habit

Completions

  • POST /completions/{habit_id} - Mark habit complete
  • DELETE /completions/{habit_id} - Unmark completion
  • GET /completions/{habit_id}/today - Check if completed today
  • GET /completions/{habit_id}/streak - Get current streak
  • GET /completions/{habit_id}/stats - Get detailed stats

🎯 Usage Guide

1. Create an Account

  • Navigate to the homepage
  • Click "Sign Up"
  • Enter username, email, and password
  • Submit to create account

2. Add Habits

  • Login to your account
  • Click "Add Habit" button
  • Enter habit name and optional description
  • Save to create habit

3. Track Completions

  • Check the checkbox next to a habit to mark it complete
  • Completed habits move to "Completed Today" section
  • Uncheck to remove completion

4. View Statistics

  • Navigate to "Statistics" tab
  • View detailed analytics for each habit
  • See streaks, completion rates, and progress

5. Manage Profile

  • Navigate to "Profile" tab
  • Update username or email
  • Change password securely

πŸ”’ Security Features

  • Password hashing with bcrypt
  • JWT token-based authentication
  • CORS middleware configured
  • Input validation with Pydantic
  • SQL injection protection via ORM
  • Secure password requirements

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Author

Devendiran K

πŸ™ Acknowledgments

  • FastAPI for the amazing framework
  • Google Fonts for Inter typeface
  • The open-source community

πŸ“§ Contact

For questions or feedback, please open an issue on GitHub.


Built with ❀️ by Devendiran K

About

This is Project is Mainly Focused for my Learning Purpose so Hope I Will Learn Lot of Stuffs from this..

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages