By the end of this guide you will have a fully working Hábito. instance running on your local machine atDocumentation 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.
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.
Prerequisites
Make sure you have the following installed before you begin:
- Python 3.8 or newer — verify with
python --versionorpython3 --version - pip — comes bundled with Python; verify with
pip --version - Git — verify with
git --version
Clone the Repository
Clone the Hábito. source code to your local machine and navigate into the project directory:
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:Once activated, your terminal prompt will be prefixed with
- macOS / Linux
- Windows
(venv), confirming the environment is active.Install Dependencies
Install all required packages from This installs the full dependency tree. The key packages are:
requirements.txt:| Package | Version | Purpose |
|---|---|---|
| Flask | 3.1.3 | Web framework and routing |
| Flask-SQLAlchemy | 3.1.1 | ORM and database integration |
| Flask-Login | 0.6.3 | Session and authentication management |
| bcrypt | 5.0.0 | Secure password hashing |
| plotly | 6.8.0 | Interactive progress charts |
| pandas | 3.0.3 | Date-range data processing for charts |
| Jinja2 | 3.1.6 | HTML template rendering |
Run the Application
Start the development server with:On startup,
main.py does two things before the server begins accepting requests:db.create_all()— inspects all registered SQLAlchemy models (Usuario,Habito,RegistroHabito) and creates the corresponding tables ininstance/habitos.dbif they do not already exist. If the database file is already present, this call is a safe no-op.app.run(debug=True, host='0.0.0.0')— starts Flask’s built-in development server on all network interfaces, port 5000.
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.Open in Your Browser
Visit the application in your browser:The root URL You will land on
/ is handled by the index function in app/__init__.py, which immediately issues a redirect:/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:-
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. - Log in — You will be redirected to the login page after registration. Enter the same credentials to start a session.
-
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.