https://github.com/flaviohsprado/endurofortri-api
A secure Node.js API server with Strava integration, JWT authentication, and Redis caching. Built with PostgreSQL (Neon DB) for data persistence and configured for cloud deployments.
https://github.com/flaviohsprado/endurofortri-api
api cloud-computing jwt-authentication neon-db nodejs postgresql redis strava-api
Last synced: 6 months ago
JSON representation
A secure Node.js API server with Strava integration, JWT authentication, and Redis caching. Built with PostgreSQL (Neon DB) for data persistence and configured for cloud deployments.
- Host: GitHub
- URL: https://github.com/flaviohsprado/endurofortri-api
- Owner: flaviohsprado
- Created: 2024-11-06T05:03:30.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-19T20:51:52.000Z (over 1 year ago)
- Last Synced: 2025-01-26T20:17:16.298Z (over 1 year ago)
- Topics: api, cloud-computing, jwt-authentication, neon-db, nodejs, postgresql, redis, strava-api
- Language: TypeScript
- Homepage: https://endurofortri-api.onrender.com
- Size: 394 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# EnduroForTri API
A RESTful API built with NestJS for managing athlete activities and Strava integration.
## Features
- Athlete Management
- Activity Tracking
- Strava Integration
- OAuth2 Authentication
## API Endpoints
### Athletes
```
GET /athlete/:id - Get athlete by ID
POST /athlete - Create new athlete
PUT /athlete/:id - Update athlete
DELETE /athlete/:id - Delete athlete
```
### Activities
```
GET /activities/:athleteId - Get activities by athlete ID
POST /activities/:athleteId - Create new activity
PUT /activities/:id - Update activity
DELETE /activities/:id - Delete activity
```
### Strava Integration
The API integrates with Strava's API v3 for:
- Fetching athlete activities
- OAuth2 authentication
- Token management
## Technical Stack
- NestJS
- TypeScript
- Swagger/OpenAPI
- Axios for HTTP requests
- Clean Architecture with Use Cases
## Project Structure
```
src/
├── modules/
│ ├── activities/ # Activities module
│ │ ├── usecases/ # Activity-related use cases
│ │ └── ...
│ ├── athlete/ # Athlete module
│ │ ├── usecases/ # Athlete-related use cases
│ │ └── ...
│ └── usecase-proxy # Use case proxy implementation
├── services/
│ └── strava/ # Strava integration service
└── common/ # Common decorators and utilities
```
## Environment Variables
```
STRAVA_CLIENT_ID=your_strava_client_id
STRAVA_CLIENT_SECRET=your_strava_client_secret
```
## Getting Started
1. Clone the repository
2. Install dependencies:
```bash
npm install
```
3. Set up environment variables
4. Run the development server:
```bash
npm run start:dev
```
## API Documentation
API documentation is available through Swagger UI at `/api` endpoint when running the server.