How abhirajadhikary06/openfeedback works
Project type and purpose
• Openfeed is a monolithic full-stack web application.
• Purpose: allow users to submit/view real-time company feedback with sentiment analysis, served via Flask and persisted in SQLite.
File structure
• Top-level modules:
• app.py – main Flask app, defines routes and view logic
• auth.py – user authentication/authorization
• export_feedback.py – data export endpoints
• migrate_db.py – schema migrations
• requirements.txt, Dockerfile – dependencies & container setup
• Directories:
• static/ – front-end assets (css, js, logos)
• templates/ – Jinja2 HTML templates
• instance/ – runtime SQLite database file
• tests/ – pytest unit tests
• .github/workflows & .gitlab-ci.yml – CI/CD pipelines
• Implied MVC pattern: Flask routes (Controller) → templates/static (View) → SQLAlchemy/SQLite (Model).
Extract insights from the README
• Tech stack: Flask, Flask-SQLAlchemy, SQLite, HTML/CSS/JS, Docker, pytest, GitHub Actions & GitLab CI/CD.
• Features: real-time feedback cards, sentiment analysis (likely via a Python library), local logos for fast loading.
Main components
a. Client Layer (Browsers)
• Browser loads HTML/CSS/JS assets
• Sends REST/Ajax requests to backend
b. Web Server Layer (Flask Application)
• Route handlers in app.py & auth.py
• Business logic: submit feedback, run sentiment analysis, fetch logos
• export_feedback.py for CSV/JSON dumps
c. Data Layer
• Flask-SQLAlchemy ORM
• SQLite database file under instance/openfeed.db
d. Asset Store
• static/logos for company images
• static/js & static/css for front-end behavior
e. CI/CD Pipeline
• GitHub Actions & GitLab CI building Docker image, running pytest
f. Infrastructure (Optional)
• Docker container running Flask on port 5000
• Host OS or cloud VM
Relationships & interactions
1. Browser → Flask routes (HTTP GET/POST)
2. Flask application → Sentiment analyzer library (in-process call)
3. Flask application ↔ SQLite via SQLAlchemy
4. Flask application → static assets served to client
5. CI/CD pipelines → build/test Docker image → deploy
Architectural patterns & design principles
• MVC-style separation: controllers (Flask routes), views (Jinja templates + JS), models (SQLAlchemy).
• Single codebase monolith containerized via Docker.
• CI/CD integration ensures quality gates (pytest) and reproducible builds.
Detail
• How tests plug into the codebase (pytest → app.py & modules)