A fullstack running tracker application that helps users log runs, track progress, and earn achievements. Built with Angular and NestJS.
- User Authentication - Register, login, forgot/reset password with JWT tokens
- Run Tracking - Log runs with timer, distance, pace, calories, and elevation
- Dashboard - View running statistics with interactive Chart.js visualizations
- Achievement System - Unlock achievements based on milestones (first run, 10K club, etc.)
- Profile Management - Update personal info, physical metrics, and fitness goals
- Responsive Design - Dark-themed UI optimized for desktop and mobile
- API Documentation - Interactive Swagger docs at
/api
Xtrail/
├── frontend/ # Angular application
│ ├── src/app/
│ │ ├── core/ # Services, guards, interceptors
│ │ ├── features/ # Auth, dashboard, runs, achievements, profile
│ │ └── shared/ # Reusable components
│ └── environments/ # Environment configs
│
└── backend/ # NestJS API
├── src/
│ ├── auth/ # Authentication module
│ ├── users/ # User management
│ ├── runs/ # Run tracking
│ └── achievements/ # Achievement system
└── test/ # E2E tests
- Node.js 18+
- npm package manager
- Docker (recommended) or PostgreSQL installed locally
git clone https://github.com/yoanastamenova/Xtrail
cd XtrailStart a PostgreSQL container with Docker:
docker run -d \
--name xtrail-db \
-e POSTGRES_USER=xtrail \
-e POSTGRES_PASSWORD=xtrail123 \
-e POSTGRES_DB=xtrail \
-p 5432:5432 \
postgres:16Create a .env file in the backend/ folder:
PORT=3000
# PostgreSQL
DB_TYPE=postgres
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=xtrail
DB_PASSWORD=xtrail123
DB_NAME=xtrail
# JWT
JWT_SECRET=your-secret-key-change-in-production
JWT_EXPIRATION=1dcd backend
npm install
npm run seed # Populate achievements data
npm run start:dev # Start in development modeThe API will be available at http://localhost:3000
Open a new terminal:
cd frontend
npm install
npm startThe app will be available at http://localhost:4200
- Register - Create an account with your email, username, and fitness details
- Login - Sign in to access your dashboard
- Log a Run - Use the built-in timer to track your runs
- View Stats - Check your progress on the dashboard with charts
- Achievements - Track your milestones and unlock achievements
Once the backend is running, visit http://localhost:3000/api for interactive Swagger documentation.
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/register |
Register new user |
| POST | /auth/login |
Login and get JWT |
| GET | /runs |
Get user's runs |
| POST | /runs |
Create a new run |
| GET | /runs/stats |
Get aggregated stats |
| GET | /achievements |
Get user achievements |
| GET | /users/profile |
Get user profile |
| PATCH | /users/profile |
Update profile |
| Command | Description |
|---|---|
npm run start:dev |
Start in watch mode |
npm run build |
Build for production |
npm run start:prod |
Run production build |
npm run seed |
Seed achievements data |
npm run make-admin <email> |
Promote user to admin |
npm test |
Run unit tests |
npm run test:e2e |
Run e2e tests |
| Command | Description |
|---|---|
npm start |
Start dev server |
npm run build |
Build for production |
npm test |
Run unit tests |
| Variable | Description | Default |
|---|---|---|
PORT |
API port | 3000 |
DB_HOST |
Database host | localhost |
DB_PORT |
Database port | 5432 |
DB_USERNAME |
Database user | - |
DB_PASSWORD |
Database password | - |
DB_NAME |
Database name | xtrail |
JWT_SECRET |
JWT signing secret | - |
JWT_EXPIRATION |
Token expiry | 1d |
Environment files are located in frontend/src/environments/:
environment.ts- Development (points tolocalhost:3000)environment.prod.ts- Production
Frontend:
- Angular 21 with standalone components
- TailwindCSS 4 for styling
- Chart.js for data visualization
- RxJS for reactive programming
Backend:
- NestJS 11 framework
- TypeORM with PostgreSQL
- Passport + JWT authentication
- Swagger for API docs
- class-validator for validation



