A real-time, community-driven monitoring system that reports on the status and quality of study spaces at various NYU locations. Students can submit reviews with ratings for silence, crowdedness, and overall quality, helping others find the best study spaces before making trips across campus.
URL: http://159.65.43.42
The application is deployed on Digital Ocean with automated CI/CD via GitHub Actions.
- Docker and Docker Compose installed
- Git for cloning the repository
- A Docker Hub account (for pushing custom images)
Copy the example environment file:
cp .env.example .envEdit .env with your configuration:
SECRET_KEY=your-secret-key-here-change-in-production
FLASK_ENV=productionImportant: Never commit the actual .env file to version control!
No additional configuration needed. MongoDB will automatically:
- Create the database (default:
proj4) on first run - Store data in a Docker volume for persistence
- Clone the repository:
git clone https://github.com/swe-students-fall2025/5-final-superfunteam.git
cd 5-final-superfunteam- Configure environment variables:
cp .env.example .env
# Edit .env with your SECRET_KEY- Build and start all containers:
docker-compose up --build-
Access the application:
- Web App: http://localhost:5001
- MongoDB: localhost:27017
-
Stop the application:
# Stop containers (keeps data)
docker-compose down
# Stop containers and remove volumes (clean slate)
docker-compose down -v- Install dependencies:
cd webapp
pip install -r requirements.txt- Set environment variables:
export MONGO_URI=mongodb://localhost:27017/proj4
export SECRET_KEY=dev-secret-key
export FLASK_ENV=development- Start MongoDB (if not using Docker):
mongod --dbpath /path/to/data/db- Run the application:
python app.pyTo populate the database with sample study spaces:
# Start the containers
docker-compose up -d
# Add sample study spaces via API
curl -X POST http://localhost:5001/api/spaces \
-H "Content-Type: application/json" \
-d '{
"building": "Bobst Library",
"sublocation": "2nd Floor Study Area"
}'
# Add a review (requires authentication)
curl -X POST http://localhost:5001/api/reviews \
-H "Content-Type: application/json" \
-H "Cookie: session=YOUR_SESSION_COOKIE" \
-d '{
"space_id": "SPACE_ID_HERE",
"rating": 4,
"silence": 5,
"crowdedness": 3,
"review": "Great quiet space with good lighting"
}'GET /api/spaces- Get all study spacesGET /api/spaces/<id>- Get specific study space with recent reviewsPOST /api/spaces- Add new study spacePUT /api/spaces/<id>- Update study space infoDELETE /api/spaces/<id>- Delete study space
POST /api/reviews- Submit a study space review (requires authentication)GET /api/reviews- Get all reviews (most recent first)GET /api/reviews?space_id=<id>- Get reviews for specific study space
Run the test suite:
cd webapp
pytest tests/ -v --cov=app --cov-report=htmlView coverage report:
open htmlcov/index.html # On macOS
# or
start htmlcov/index.html # On WindowsThe project uses GitHub Actions for continuous integration and deployment:
- Workflow File:
.github/workflows/webapp-ci.yml - Triggers: Push or PR to
mainbranch - Steps:
- Run unit tests with pytest
- Check code coverage (minimum 80%)
- Build Docker image
- Push to Docker Hub
- Deploy to Digital Ocean
5-final-superfunteam/
βββ .github/
β βββ workflows/
β βββ webapp-ci.yml # CI/CD pipeline
β βββ webapp-deploy.yml # Deployment workflow
βββ webapp/ # Flask web application
β βββ static/
β β βββ css/
β β β βββ style.css
β β βββ js/
β β βββ main.js
β βββ templates/
β β βββ base.html
β β βββ index.html
β βββ tests/
β β βββ __init__.py
β β βββ test_app.py
β βββ .dockerignore
β βββ .env.example
β βββ app.py
β βββ Dockerfile
β βββ README.md
β βββ requirements.txt
βββ .dockerignore
βββ .env.example
βββ .gitignore
βββ docker-compose.yml
βββ instructions.md
βββ LICENSE
βββ pyproject.toml
βββ README.md
- Backend: Python 3.11, Flask 3.0.0, PyMongo 4.6.0
- Frontend: HTML5, CSS3, JavaScript
- Database: MongoDB 7.0
- Containerization: Docker, Docker Compose
- Web Server: Gunicorn
- Testing: Pytest
- CI/CD: GitHub Actions
- Deployment: Digital Ocean
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Database Schema: See webapp/README.md for database setup and schema documentation
- Deployment Guide: See DEPLOYMENT.md for complete Digital Ocean droplet deployment instructions
- Quick Start: See QUICKSTART.md for quick deployment reference
This application can be deployed to a Digital Ocean droplet with automated CI/CD via GitHub Actions.
Quick Setup:
- Create a Digital Ocean droplet
- Run the setup script:
./setup-droplet.sh - Configure GitHub Secrets (Docker Hub credentials, droplet SSH key)
- Push to main branch - automatic deployment!
See DEPLOYMENT.md for detailed instructions.
This project is part of an academic exercise for NYU's Software Engineering course.