Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/BrandonCVale/SISTEMA-HABITOS/llms.txt

Use this file to discover all available pages before exploring further.

By the end of this guide you will have a fully working Hábito. instance running on your local machine at http://127.0.0.1:5000. You will create your first account, land on the dashboard, and be ready to add your first habit. No cloud accounts, no Docker setup, and no database server to configure — Hábito. creates its own SQLite file the first time it starts.
1

Prerequisites

Make sure you have the following installed before you begin:
  • Python 3.8 or newer — verify with python --version or python3 --version
  • pip — comes bundled with Python; verify with pip --version
  • Git — verify with git --version
All other dependencies are installed automatically in Step 4.
2

Clone the Repository

Clone the Hábito. source code to your local machine and navigate into the project directory:
git clone https://github.com/BrandonCVale/SISTEMA-HABITOS.git
cd SISTEMA-HABITOS
3

Create a Virtual Environment

A virtual environment isolates Hábito.’s dependencies from your global Python installation. Create and activate one with the commands for your operating system:
python3 -m venv venv
source venv/bin/activate
Once activated, your terminal prompt will be prefixed with (venv), confirming the environment is active.
4

Install Dependencies

Install all required packages from requirements.txt:
pip install -r requirements.txt
This installs the full dependency tree. The key packages are:
PackageVersionPurpose
Flask3.1.3Web framework and routing
Flask-SQLAlchemy3.1.1ORM and database integration
Flask-Login0.6.3Session and authentication management
bcrypt5.0.0Secure password hashing
plotly6.8.0Interactive progress charts
pandas3.0.3Date-range data processing for charts
Jinja23.1.6HTML template rendering
5

Run the Application

Start the development server with:
python main.py
On startup, main.py does two things before the server begins accepting requests:
from app import create_app, db
from app.models import Usuario, Habito

app = create_app()

with app.app_context():
    db.create_all()
    print("Base de datos y tablas verificadas/creadas con éxito.")

if __name__ == '__main__':
    app.run(debug=True, host='0.0.0.0')
  1. db.create_all() — inspects all registered SQLAlchemy models (Usuario, Habito, RegistroHabito) and creates the corresponding tables in instance/habitos.db if they do not already exist. If the database file is already present, this call is a safe no-op.
  2. app.run(debug=True, host='0.0.0.0') — starts Flask’s built-in development server on all network interfaces, port 5000.
You will see output similar to:
Base de datos y tablas verificadas/creadas con éxito.
 * Running on http://127.0.0.1:5000
 * Running on http://0.0.0.0:5000
 * Debug mode: on
debug=True enables Flask’s automatic reloader and the interactive debugger, which is useful during development. You must set debug=False before deploying Hábito. to any production or public-facing environment, as the interactive debugger can expose sensitive information.
6

Open in Your Browser

Visit the application in your browser:
http://127.0.0.1:5000
The root URL / is handled by the index function in app/__init__.py, which immediately issues a redirect:
@app.route('/')
def index():
    return redirect(url_for('auth.inicio_sesion'))
You will land on /auth/inicio_sesion — the login page — automatically. This also means that any unauthenticated request to a protected page will bounce the user to the same login URL via Flask-Login’s login_view = 'auth.inicio_sesion' setting.

First-Run Walkthrough

Once the server is running, follow these three steps to complete your first session:
  1. Register an account — Click the link to the registration page (/auth/registro). Fill in your email, username, and password. Hábito. stores only a bcrypt hash of your password — the plaintext is never saved. See Authentication for details.
  2. Log in — You will be redirected to the login page after registration. Enter the same credentials to start a session.
  3. Explore the dashboard — After login you land on /pagina_principal/inicio. This is your Dashboard, where you can create your first habit, mark it complete for today, and watch the heat-map calendar and streak counter update in real time. Head to Habit Management to learn how to create, edit, deactivate, and delete habits, or to Progress Charts to visualise your completion history.

Build docs developers (and LLMs) love