Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

369 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HawksRFit Fitness App

Created by the HawksRFit Development Team at the University of North Carolina Wilmington. HawksRFit is a web-based fitness application designed for UNCW students that helps streamline workout planning at the campus recreation center. The application allows users to create workouts, check gym busyness levels, track workout streaks with friends, and stay informed about rec center updates such as broken equipment, events, and closures.

  • Lead Developer: Patrick Hachicho

Tech Stack

  • Frontend: React 19, Vite, TypeScript, Tailwind CSS
  • Backend: Express.js, TypeScript, Prisma ORM
  • Database: PostgreSQL (RDS on AWS in production)
  • Deployment: AWS EC2 + RDS, GitHub Actions CI/CD
  • Container: Docker, Docker Compose

Local Development

Prerequisites

  • Node.js 22+
  • Docker Desktop

Setup

1. Install dependencies:

npm install
cd server && npm install

2. Create server/.env:

FACILITY_API_KEY=your_api_key_here
PORT=3000
DATABASE_URL="postgresql://hawksrfit:hawksrfit@localhost:5433/hawksrfit"

3. Start the app with Docker (recommended):

docker compose -f docker-compose.dev.yml up --build

The app will be available at http://localhost:5173.

Without Docker

Start the backend:

cd server
npx prisma migrate dev
npx tsx index.ts

Start the frontend (in a separate terminal):

npm run dev

Deployment

The app is deployed on AWS:

  • Live URL: https://hawksrfit.tech
  • Frontend + Backend: EC2 instance (3.209.58.122) behind Nginx
  • Database: RDS PostgreSQL
  • SSL: Let's Encrypt certificate (auto-renews via cron)

Deployments are automatic — every merge to main triggers a GitHub Actions workflow that SSHes into EC2, pulls the latest code, and rebuilds the Docker containers.

Manual redeploy (if needed)

ssh -i ~/hawksrfit-key-new.pem ec2-user@3.209.58.122
cd ~/hawksrfit
sudo /usr/local/bin/docker-compose down
sudo docker system prune -f
sudo /usr/local/bin/docker-compose up -d --build

SSL certificate renewal

Certificates expire every 90 days and are automatically renewed via a cron job on EC2:

0 3 * * * cd ~/hawksrfit && sudo /usr/local/bin/docker-compose run --rm certbot renew --quiet && sudo /usr/local/bin/docker-compose exec nginx nginx -s reload

Environment Variables

Variable Description
FACILITY_API_KEY API key for UNCW rec center occupancy data
PORT Backend server port (default: 3000)
DATABASE_URL PostgreSQL connection string

API Endpoints

GET /api/health

Returns the current server status. Useful for uptime checks and confirming a deployment succeeded.

Response:

{
  "status": "ok",
  "version": "42",
  "uptime": 3600
}
Field Description
status Always "ok" if the server is running
version Build number set by VITE_APP_VERSION at deploy time
uptime Seconds the server process has been running

Notes

  • Only @uncw.edu email addresses are allowed to register
  • The backend runs Prisma migrations automatically on startup
  • Live facility count data refreshes every 5 minutes on the home page
  • Footer displays the current build version (auto-increments on each deploy)

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages