Initial commit

This commit is contained in:
2026-06-20 04:28:24 +03:00
committed by GitHub
commit 07f02e0958
29 changed files with 1700 additions and 0 deletions
@@ -0,0 +1,25 @@
---
applyTo: "octofit-tracker/backend/**"
---
# Octofit Tracker Logic + Data Tier Guidelines
## Logic tier (Node.js + Express + TypeScript)
- Build API routes under `/api/`.
- Keep API service on port `8000`.
- Use environment-aware Codespaces URLs via `CODESPACE_NAME`.
Example base URL logic:
```ts
const codespaceName = process.env.CODESPACE_NAME;
const baseUrl = codespaceName
? `https://${codespaceName}-8000.app.github.dev`
: 'http://localhost:8000';
```
## Data tier (MongoDB + Mongoose)
- Use Mongoose models for users, teams, activities, leaderboard, and workouts.
- Connect to `octofit_db`.
- Validate endpoints with `curl` after wiring routes.