Skip to content

awksrj/SyllabusSync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

SyllabusSync

SyllabusSync is a FastAPI web application that allows users to upload course syllabi (PDF/DOCX), extract structured information using an LLM, and manage uploaded syllabi through a dashboard.


Project Structure

app/
├── routers/
│   ├── routes_user.py      # Login, dashboard UI endpoints
│   ├── review.py           # Review & Notion sync logic
│   ├── extract.py          # Extraction flow
│   └── api.py              # JSON API endpoints
├── templates/              # HTML templates
├── crud.py                 # Database CRUD operations
├── models.py               # SQLAlchemy data models
├── db.py                   # Database connection & DI
└── main.py                 # Application entry point

Data Model and Data Flow

Data Model

users Table

Column Name Type
id Integer (PK)
email String
name String (nullable)

syllabus_uploads Table

Column Name Type
id Integer (PK)
filename String
extracted_json Text (nullable)
created_at DateTime
user_id Integer (FK → users.id)

Data Flow

[ User logs in ]
        |
        v
[ users table ]
  - create user if not exists
        |
        v
[ User uploads syllabus ]
        |
        v
[ syllabus_uploads table ]
  - store filename
  - store extracted syllabus JSON
  - store timestamp
  - link to user_id
        |
        v
[ Dashboard ]
  - read syllabus_uploads for user
        |
        v
[ User deletes syllabus ]
        |
        v
[ syllabus_uploads table ]
  - delete selected upload
        |
        v
[ Dashboard refreshes ]

Setup Instructions

1. Unzip the Project

Unzip the submitted file and navigate into the project directory:

unzip syllabus-sync.zip
cd syllabus-sync

2. Create and Activate a Virtual Environment

python -m venv venv
source venv/bin/activate   # macOS/Linux
venv\Scripts\activate      # Windows

3. Install Dependencies

pip install -r requirements.txt

4. Environment Configuration

Create a .env file in the project root:

DATABASE_URL=postgresql://user:password@localhost:5432/syllabus_sync
GEMINI_API_KEY=your_gemini_api_key

Note: The Gemini API key is optional if using the developer mode described below.


5. Database Setup

  • Ensure PostgreSQL is running and accessible via DATABASE_URL
  • The application uses SQLAlchemy ORM models to create and persist data

Running the Application

Start the FastAPI server from the project root:

uvicorn app.main:app --reload

Then open your browser at:

http://localhost:8000/

Test the Application

  1. Open the landing page
  2. Click Extract Now (guest flow) or log in with an email address (no authentication yet, used only to support database persistence)
  3. Upload a syllabus (PDF or DOCX)
  4. Review the extracted syllabus data
  5. View uploaded syllabi on the dashboard
  6. Delete uploads

Testing Without a Gemini API Key (Developer Mode)

To support grading and testing without external API keys, the application includes a developer review endpoint that bypasses Gemini and uses mock data.

Dev Review Endpoint

GET /dev/review

How to Test

  1. Start the server
  2. Navigate to:
http://localhost:8000/dev/review
  1. The review page will load using mock syllabus data
  2. All UI functionality can be tested without Gemini configuration

This allows full evaluation of the application flow without requiring an LLM API key. Code reference is in main.py.

About

Extract syllabus content and automatically populate Notion pages.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published