congenial-train-app-server

All-Around Athlete MVC SPA

Rebuilt from scratch for CIS 486 - Spring 2026 to meet the full-stack MVC SPA requirements. The project ships a web-based routine planner that stores data in MongoDB, exposes a RESTful Express API, and renders a Bootstrap + jQuery single-page experience.

Architecture & Stack

Features

Getting Started

  1. Install dependencies
      npm install
    
  2. Environment
    • Copy .env.example to .env and fill in:
        PORT=3000
        MONGODB_URI=mongodb://127.0.0.1:27017/allaroundathlete_dev
      
  3. MongoDB
    • Run a local Mongo instance (Docker example):
        docker run --name mongo -p 27017:27017 -d mongo:7
      
  4. Development server
      npm run dev
    
  5. Production build
      npm start
    

REST API

Method Endpoint Description
GET /api/routines List routines
POST /api/routines Create routine
PUT /api/routines/:id Update routine
DELETE /api/routines/:id Delete routine

Payload example:

{
	"title": "Upper Push Flow",
	"focusArea": "Chest",
	"equipment": "Dumbbells",
	"intensity": "Steady",
	"sessionsPerWeek": 3,
	"notes": "Slow tempo and breathe." 
}

Testing & CI/CD

Deployment

Target Location Notes
Dev render.yaml Deploy via Render web service (Node).
Prod Dockerfile, infra/gcp-deployment.md Container for Cloud Run / GCE with static IP + domain mapping instructions.

Render

  1. Create a new Render Web Service from this repo.
  2. Set build command npm install and start command npm run start (already captured in render.yaml).
  3. Add MONGODB_URI as an environment variable.

GCP + Static External IP

Project Layout

src/
	app.js             Express config + SPA fallback
	server.js          Entry point with Mongo connection
	config/db.js       Mongoose connection helper
	controllers/       MVC controller layer
	models/            Mongoose schemas
	routes/            REST routers
	middleware/        Error + notFound handlers
public/
	index.html         Bootstrap + jQuery SPA
	scripts/app.js     Front-end logic with CRUD calls
styles/main.css      Custom theme layered on Bootstrap
render.yaml          Render PaaS definition
Dockerfile           Production container (GCP)
infra/gcp-deployment.md  Static IP + DNS guide

Authorship & License


Questions, issues, or grading clarifications? Open an issue or leave PR feedback on GitHub.