How ayoubbencheikhi/income-expense-website works
Project Type and Purpose
• This is a monolithic full-stack web application built on Django, named “income-expense-website.”
• Its primary purpose is to let users register/login, track incomes and expenses, and manage user preferences.
• It bundles three Django apps—authentication, expenses, and userpreferences—under a single project.
File Structure Analysis
• Top-level files: .env (environment variables), Pipfile/Pipfile.lock (dependencies via Pipenv), Procfile (Heroku deploy).
• Project root app folder: expenseswebsite/ contains Django settings, URL routing, ASGI/WSGI entry points, and static assets.
• Apps:
• authentication/: user account management, login, registration, password resets.
• expenses/: expense/income models, CRUD views and templates.
• userpreferences/: per-user settings (e.g. currency).
• templates/: global and per-app HTML templates, partials for messages and sidebar.
• static/: CSS and JavaScript for client-side interactivity (dashboard, search, register flows).
• db.sqlite3: development database. In production likely replaced by Postgres or MySQL.
README Insights
• Very minimal; reinforces the project’s identity as an income/expense tracking website.
a. Main Components
• Web Client (browser)
• Django Web Server
− URL dispatcher (project-level urls.py)
− Authentication app
− Expenses app
− UserPreferences app
• Static File Handler (serving CSS/JS)
• Database (SQLite in dev, replaceable with RDBMS)
• External Services (e.g., Email SMTP for password resets)
• Currencies JSON (as a data resource)
b. Relationships and Interactions
• Browser sends HTTP/HTTPS requests to Django via WSGI/ASGI.
• Django routes requests to the correct app based on URL config.
• Views in each app interact with models and the database.
• Templates are rendered with context data and returned to the client.
• Static files served either by Django’s static handler or CDN in production.
• Password-reset flows trigger email service calls.
c. Architectural Patterns and Principles
• Monolithic MVC (Models in models.py, Views in views.py, Templates as the V layer).
• Apps are cohesive modules: authentication, expense tracking, preferences.
• Separation of concerns: routing, business logic, persistence, and presentation are distinct.
d. Key Technologies and Frameworks
• Python 3 + Django framework
• SQLite (dev) / Postgres or MySQL (prod)
• Pipenv for dependency management
• HTML5, CSS3, vanilla JavaScript
• Heroku deployment via Procfile or similar PaaS