Skip to content

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.

Notifications You must be signed in to change notification settings

flaviohsprado/endurofortri-api

Repository files navigation

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:
    npm install
  3. Set up environment variables
  4. Run the development server:
    npm run start:dev

API Documentation

API documentation is available through Swagger UI at /api endpoint when running the server.

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published