Skip to content

aa10150/swe-project5

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

113 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Final Project

An exercise to put to practice software development teamwork, subsystem communication, containers, deployment, and CI/CD pipelines. See instructions for details.

NYU CS & Math Course Planner

A course recommender designed to help a Computer Science or Math student at NYU create a four-year plan by using an LLM to suggest courses from the CAS catalog that fulfill their requirements and classes relevant to their interests.

Live Deployment: http://159.65.190.132:5000/

log github events Web App Subsystem CI Database Subsystem CI

Container Images

This project uses the following custom container images, hosted on Docker Hub:

The application also depends on the official MongoDB image:

Team Members

Instructions

Environment variables

Create a file at web-app/.env by copying web-app/.env.example and filling in values appropriate for your environment. Do not commit production secrets to version control — only commit web-app/.env.example with dummy/example values.

Example web-app/.env (copy into web-app/.env and edit):

MONGO_URI = mongodb://mongo:27017/course_planner
MONGO_DB_NAME = course_planner
ENVIRONMENT = development
WAIT_BEFORE_CONNECT = 2
OPENAI_API_KEY = sk-proj
  • MONGO_URI: MongoDB connection string. When using Docker Compose, mongodb://mongo:27017 points to the mongo service in docker-compose.yml.
  • MONGO_DB_NAME: name of the database used by the app.
  • WAIT_BEFORE_CONNECT: seconds the seeder will wait before attempting a DB connection (helps when starting containers together).
  • ENVIRONMENT: development or production — controls seeding/debug behavior.
  • FLASK_SECRET: secret key for Flask session management. Keep this private in production.

If additional secrets/configuration files are required, include an example file (for example web-app/.env.example) and document exact steps for creating the real file(s) with the course admins.

Running the Webapp

You can run the app with Docker Compose (recommended) or directly in a local Python environment.

Run with Docker Compose (recommended)

  1. Copy the example environment file and edit it as needed:
cp web-app/.env.example web-app/.env
# edit web-app/.env as needed
  1. Build and start the services:
docker-compose up --build
  1. Open http://127.0.0.1:5000 in your browser.

Notes:

  • The web container runs start.sh, which attempts to seed the database (python -m database.seed) before starting the Flask app. If the database is already seeded, the script will warn and continue.
  • To run the seeder manually while containers are running:
docker-compose run --rm web python -m database.seed

Run locally without Docker (optional)

  1. From the repository root, change into web-app, create and activate a virtual environment, and install dependencies:
cd web-app
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
  1. Ensure web-app/.env points to your MongoDB instance and seed the DB:
python -m database.seed
  1. Start the Flask server:
python run.py
  1. Open http://localhost:5000 to verify the app is running.

Stopping

  • If started with Docker Compose: docker-compose down.
  • If started locally: stop the server (Ctrl+C) and run deactivate to exit the virtual environment.

Testing

The web-app subsystem includes a comprehensive unit test suite targeting 80%+ code coverage of core business logic.

Test Suite Overview

  • 44 unit tests covering user management, course parsing, semester planning, and database operations
  • Coverage by module:
    • api/plan_utils.py: 84%
    • api/user_model.py: 80%
    • database/app_db.py: 97%
  • Testing framework: pytest with mongomock for in-memory database testing

Running Tests

Install test dependencies (included in web-app/requirements.txt):

cd web-app
pip install -r requirements.txt

Run all tests:

pytest tests/

Run tests with coverage report:

pytest tests/ --cov=api --cov=database --cov-report=term-missing

Generate HTML coverage report:

pytest tests/ --cov=api --cov=database --cov-report=html

Then open htmlcov/index.html in a browser.

Test Structure

Tests are organized by module in web-app/tests/:

  • test_user_model.py — User CRUD, authentication, profile management (13 tests)
  • test_plan_utils.py — Course parsing, formatting, semester plan operations (18 tests)
  • test_app_db.py — Database connection, seeding, indexing (12 tests)
  • conftest.py — Shared pytest fixtures and environment setup
  • README.md — Detailed testing documentation

About

software-engineering-fall-2025-5-final-final-project created by GitHub Classroom

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 80.1%
  • JavaScript 8.7%
  • HTML 7.5%
  • CSS 2.8%
  • Other 0.9%