How labhansh2/duemap works
Project Type and Purpose
• This project is a simple Flask web application that helps students upload course schedules/syllabi. It automatically parses these documents for assignments, tasks, projects, and exam deadlines, then integrates the information with a Notion Calendar Page.
• The README indicates that the application uses external APIs (including OpenAI’s API for parsing and potentially the Notion API for calendar integration) and is primarily aimed at assignment progress tracking.
File Structure
• Top-level Files:
• main.py – This is likely the entry point for the Flask application.
• requirements.txt – Indicates dependencies.
• README.md – Provides an overview and usage instructions.
• vercel.json – Suggests potential deployment configuration for Vercel.
• dueMap Folder:
• __init__.py – Initializes the dueMap module.
• Notion.py – Contains integration logic for interfacing with the Notion API.
• aiParser.py – Contains code likely responsible for parsing input documents, probably making use of the OpenAI API given the context in the README and environment variables.
• data/ – Contains sample or persistent text files (finalParse.txt, parserInfo.txt, parserInstructions.txt) that might be used for storing parsing results or instructions.
• Static and Templates Folders:
• static/style.css – Holds CSS for frontend styling.
• templates/ – Contains HTML templates (such as add_assgn.html, add_course.html, home.html, layout.html) to render the user interface.
Main Components and Their Relationships
a. Web Server / Flask Application:
• main.py serves as the main entry point where Flask routes are defined.
• It orchestrates request handling, rendering HTML templates, and connecting frontend actions to backend processing.
b. Document Parsing Module:
• The dueMap/aiParser.py module handles parsing of uploaded course schedules/syllabi.
• It likely uses some AI capabilities (via the OpenAI API) to extract relevant deadline information.
• The dueMap/data directory provides configuration/instructions or might store parsed outputs.
c. Notion Integration Module:
• The dueMap/Notion.py module manages the integration with Notion, pushing the parsed deadlines into a Notion Calendar.
d. Frontend/UI Layer:
• Includes the templates for displaying pages (home, course, assignment forms) and static assets for styling.
e. External Dependencies:
• OpenAI API (as indicated by OPENAI_API_KEY) for parsing.
• Notion API for calendar integration.
• Environment variables (set up in a .env file) are critical for enabling secure access to these services.
Architectural Patterns and Design Principles
• Separation of Concerns: The project separates responsibilities across different modules – web server (Flask), parsing logic, and Notion integration.
• Modularization: All domain-specific logic is housed inside the dueMap module, while the presentation layer (templates and static) is clearly separated and served.