How chentim1011/dbms-final-backend works
Project Type and Purpose
• This is a monolithic full-stack Book Management System.
• Purpose: Let users add, view, search, and annotate books and authors; track reading history and plans; manage notes and favorites; store and view PDFs.
File Structure
• Top‐level folders:
• backend/ – Flask application code, route handlers, configuration, database modules, uploads.
• frontend/ – Static HTML pages (index.html, notes.html).
• PDF/ – Design documents (DB schema, ER model, system spec).
• backend/app.py: Entry point for Flask server.
• backend/config.py: Flask and database configuration.
• backend/database.py: SQLite connection and helper methods.
• backend/routes/*.py: One module per resource (books, authors, notes, etc.).
• backend/uploads/: File storage for uploaded PDFs.
• SQLite database file: backend/library.db.
README
• Confirms Flask + SQLite stack.
• Lists tables (Book, ReadingHistory, ReadingPlan, Note, FavoriteList, Author) and indexes.
• Describes each backend feature and CRUD endpoints.
Components
a. Frontend (Client Browser)
• Static HTML (index.html, notes.html), JavaScript (if any), CSS.
• User actions: search books, view/add notes, upload PDFs, etc.
b. Backend (Flask Application)
• app.py (Flask app)
• config.py (settings)
• database.py (DB connection)
• routes/ (REST endpoints for books, authors, history, plans, notes, favorites, search)
c. Database (SQLite)
• Tables: Book, Author, ReadingHistory, ReadingPlan, Note, FavoriteList
• Indexes for performance
d. File Storage
• uploads/ directory containing PDF files
e. External Clients/Services
• Web browser only (no third-party APIs in current scope)
Relationships and Data Flows
• In Backend:
• Routes modules handle HTTP and call database.py for SQL operations.
• config.py provides DB path and upload folder.
• Backend → SQLite: SQL queries (CRUD) to tables; index usage speeds lookups.
• Backend ↔ File Storage: Read/write PDF files on upload/view.
• Backend returns JSON or file streams to frontend.
• Frontend renders data and PDF embeds.
Architectural Patterns & Design Principles
• Monolithic MVC-style layering:
• Routes = Controllers
• database.py + SQL scripts = Model
• frontend HTML = View
• Single process Flask server, no microservices.
• Separation of concerns: config, database access, route logic, file storage.
Relevant Technologies & Libraries
• Flask (Python)
• SQLite (embedded DB)
• Jinja2 or static HTML for views
• Standard Python modules for file I/O