mirror of
https://github.com/farcasclaudiu/learn-build-apps-copilot-agent.git
synced 2026-06-28 17:01:41 +03:00
Initial commit
This commit is contained in:
@@ -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.
|
||||
Reference in New Issue
Block a user