Skip to content

douglasdotv/fitness-tracker-api

Repository files navigation

Fitness Tracker API

en pt-br

Fitness Tracker API is a REST API that enables uploading and downloading fitness tracker data. Developers can register on the platform, register their applications and receive unique API keys for authentication. The API implements different rate limit policies for basic and premium application categories.

This project was mainly built with Spring Boot, Spring Data JPA and Spring Security, and uses custom API-Key authentication to protect endpoints.

Key Features

  • Upload and download fitness activity data
  • Developer and application registration
  • Custom API-Key authentication
  • Request rate limiting (1 request/second for basic apps)
  • Application categories (basic and premium) with different service levels
  • Data storage in a relational database (e.g. H2)

API Examples

Developer Registration

curl -X POST http://localhost:8080/api/developers/signup \
  -H "Content-Type: application/json" \
  -d '{
    "email": "developer@example.com",
    "password": "securePassword123"
  }'

Get Developer Profile

curl -X GET http://localhost:8080/api/developers/{id} \
  -u developer@example.com:securePassword123

Register Application

curl -X POST http://localhost:8080/api/applications/register \
  -H "Content-Type: application/json" \
  -u developer@example.com:securePassword123 \
  -d '{
    "name": "MyFitnessApp",
    "description": "Tracks user fitness activities",
    "category": "premium"
  }'

Upload Fitness Data

curl -X POST http://localhost:8080/api/tracker \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key-here" \
  -d '{
    "username": "user123",
    "activity": "running",
    "duration": 1800,
    "calories": 450
  }'

Get All Fitness Data

curl -X GET http://localhost:8080/api/tracker \
  -H "X-API-Key: your-api-key-here"

About

A Spring Boot backend for fitness data with API key authentication and rate limiting.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages