# sarveshwarsenthilkumar/devtick architecture

> Architecture diagram of the GitHub repository sarveshwarsenthilkumar/devtick, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sarveshwarsenthilkumar/devtick
- Repository: https://github.com/sarveshwarsenthilkumar/devtick

## Overview

Step 1: Identify the Project Type and Purpose
- This project is a developer-focused todo and productivity application called “DevTick.”
- It is a full-stack web application built using Flask (a Python web framework) for the backend and HTML/CSS templates for the frontend.
- The app offers features such as task management (Developer Todo List), contact management (Contact Book), API key management, project ideas/categories, AI-powered text chat, and progress tracking.

Step 2: Analyze the File Structure
- Top-Level Files:
- Main application scripts: app.py, auth.py, SarvAuth.py (handle server initialization, authentication logic, and routing).
- Database creation scripts (createDatabase.py, createProjectsDB.py, createTasksDB.py, createContactbook.py, createAPIstorage.py) denote separate modules for setting up different persistent storage areas.
- sql.py likely provides functions or classes to interact with SQLite3, the chosen database.
- Template files in the “templates/” directory (with nested “auth/” subdirectory) indicate that the frontend is rendered using HTML templates for endpoints like login, signup, homepage, and index.
- Supplementary files: README.md, requirements.txt, LICENSE, etc., for documentation, dependency management, and licensing.

Step 3: Examine the README for Additional Insights
- The README clearly describes the purpose and features, emphasizing:
- The separation of concerns: multiple scripts to build and initialize databases.
- Usage of the Flask Development Template, implying organized routing, database migrations, and modular development.
- A clearly defined tech stack: Python (Flask) on the backend, SQLite3 for database management, and HTML/CSS for the frontend.

a. Main Components to Represent:
- Client/User Interface: Represented by the HTML/CSS templates in the “templates/” directory (including authentication pages and homepage).
- Backend Application Server: Represented by app.py (with supportive modules: auth.py and SarvAuth.py) that handle HTTP requests, authentication, and API routing.
- Database and Data Storage: Represent SQLite databases created and managed by createDatabase.py, createProjectsDB.py, createTasksDB.py, createContactbook.py, createAPIstorage.py, along with the SQL utility functions in sql.py.

b. Relationships and Interactions:
- The web client (browser) interacts with the Flask server via HTTP requests.
- The Flask server serves HTML pages and handles API calls by routing requests to the appropriate modules (authentication, todo list management, contact book, API key management, etc.).
- The server interacts with the relevant SQLite databases through SQL queries (facilitated by sql.py) to store and retrieve user data.

c. Architectural Patterns and Design Principles:
- Separation of concerns: Different scripts for different functionalities (authentication, database initialization, and feature-specific modules) emphasize modularity.
- MVC-like pattern: HTML templates (view) are kept separate from the business logic in Python files (controller) and the database management (model), even if implicitly.
- Use of a Flask development template implies best practices in routing and structure.

d. Relevant Technologies and Frameworks:
- Flask (Python) acts as the backend framework.
- SQLite3 serves as the lightweight local database.
- HTML/CSS (and potential future incorporation of JavaScript/modern frameworks) for the frontend interface.

- Since DevTick is a full-stack application:
- Distinguish clearly between the frontend (client-side templates) and the backend (Flask server and business logic).
- API/HTTP communication from the client to the server.
- How the backend interacts with multiple SQLite databases for different features (e.g., tasks, projects, contacts, API keys).
- Modular components for authentication and data management.

- Flask Application: A central node representing app.py with subordinate nodes for “Authentication Module” (auth.py, SarvAuth.py) and other business logic.
- Database Components: Separate nodes labeled “Main Database”, “Projects Database”, “Tasks Database”, “Contact Book DB”, “API Key Storage DB” – or a unified “SQLite Database” node mentioning these tables/features.
- Use labels for clarity (e.g., “Authentication”, “Task Management”, “Contact Book”, etc.).

Step 7: Summary of Detailed Instructions
1. Client Layer: “User Interface” (HTML templates).
2. Application Layer: “Flask Server” containing submodules for authentication and other feature-specific functionalities.
3. Persistence Layer: "SQLite Databases" with annotations for each specific purpose (task tracking, projects, contacts, API keys).
- How an HTTP request flows from the user to the Flask app, which then interacts with the databases, processes logic, and returns the result to the user.
- Dependencies on the Flask Development Template for routing and structure.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        FE["Frontend (HTML/CSS Templates)"]:::frontend
        login["login.html"]:::frontend
        signup["signup.html"]:::frontend
        homepage["homepage.html"]:::frontend
        index["index.html"]:::frontend
        FE -->|"serves"| login
        FE -->|"serves"| signup
        FE -->|"serves"| homepage
        FE -->|"serves"| index
    end

    %% Application Layer
    subgraph "Application Layer"
        FS["Flask Server (app.py)"]:::backend
        subgraph "Authentication Module"
            A1["auth.py"]:::backend
            A2["SarvAuth.py"]:::backend
        end
        FS -->|"handles"| A1
        FS -->|"handles"| A2
    end

    %% Persistence Layer
    subgraph "Persistence Layer"
        SQL["SQL Utility Functions (sql.py)"]:::database
        MD["Main Database"]:::database
        PD["Projects Database"]:::database
        TD["Tasks Database"]:::database
        CBD["Contact Book DB"]:::database
        AKD["API Key Storage DB"]:::database
        SQL --> MD
        SQL --> PD
        SQL --> TD
        SQL --> CBD
        SQL --> AKD
    end

    %% Interactions between Layers
    FE -->|"HTTP_Request"| FS
    FS -->|"SQL_Query"| SQL

    %% Styles
    classDef frontend fill:#FFF2B2,stroke:#B8860B,stroke-width:2px;
    classDef backend fill:#C1E1C1,stroke:#228B22,stroke-width:2px;
    classDef database fill:#B0C4DE,stroke:#4682B4,stroke-width:2px;

    %% Click Events
    click FE "https://github.com/sarveshwarsenthilkumar/devtick/tree/main/templates/"
    click login "https://github.com/sarveshwarsenthilkumar/devtick/blob/main/templates/login.html"
    click signup "https://github.com/sarveshwarsenthilkumar/devtick/blob/main/templates/signup.html"
    click homepage "https://github.com/sarveshwarsenthilkumar/devtick/blob/main/templates/homepage.html"
    click index "https://github.com/sarveshwarsenthilkumar/devtick/blob/main/templates/index.html"
    click FS "https://github.com/sarveshwarsenthilkumar/devtick/blob/main/app.py"
    click A1 "https://github.com/sarveshwarsenthilkumar/devtick/blob/main/auth.py"
    click A2 "https://github.com/sarveshwarsenthilkumar/devtick/blob/main/SarvAuth.py"
    click MD "https://github.com/sarveshwarsenthilkumar/devtick/blob/main/createDatabase.py"
    click PD "https://github.com/sarveshwarsenthilkumar/devtick/blob/main/createProjectsDB.py"
    click TD "https://github.com/sarveshwarsenthilkumar/devtick/blob/main/createTasksDB.py"
    click CBD "https://github.com/sarveshwarsenthilkumar/devtick/blob/main/createContactbook.py"
    click AKD "https://github.com/sarveshwarsenthilkumar/devtick/blob/main/createAPIstorage.py"
    click SQL "https://github.com/sarveshwarsenthilkumar/devtick/blob/main/sql.py"
```
