{"id":15989499,"url":"https://github.com/skvggor/strava-api-wrapper-clojure","last_synced_at":"2026-04-28T11:04:28.173Z","repository":{"id":161238541,"uuid":"619357357","full_name":"skvggor/strava-api-wrapper-clojure","owner":"skvggor","description":"(WIP) I developed a program that integrates with the Strava API to retrieve and display my total running distance for the current year.","archived":false,"fork":false,"pushed_at":"2024-10-18T01:34:08.000Z","size":31,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T04:48:57.452Z","etag":null,"topics":["api","clojure","compute-engine","gcp","google-cloud","hacktoberfest","java","jvm","leiningen","strava","strava-api","wrapper-api"],"latest_commit_sha":null,"homepage":"http://strava-api.trve.in:3000/api/v1/strava/total-distance/current-year","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skvggor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-27T01:18:23.000Z","updated_at":"2024-10-18T01:38:29.000Z","dependencies_parsed_at":"2024-10-20T05:46:02.990Z","dependency_job_id":null,"html_url":"https://github.com/skvggor/strava-api-wrapper-clojure","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skvggor%2Fstrava-api-wrapper-clojure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skvggor%2Fstrava-api-wrapper-clojure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skvggor%2Fstrava-api-wrapper-clojure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skvggor%2Fstrava-api-wrapper-clojure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skvggor","download_url":"https://codeload.github.com/skvggor/strava-api-wrapper-clojure/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247261605,"owners_count":20910108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","clojure","compute-engine","gcp","google-cloud","hacktoberfest","java","jvm","leiningen","strava","strava-api","wrapper-api"],"created_at":"2024-10-08T04:43:01.458Z","updated_at":"2026-04-28T11:04:28.165Z","avatar_url":"https://github.com/skvggor.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# strava-api-wrapper-clojure\n\n[![wakatime](https://wakatime.com/badge/user/6fd82e7b-8d36-4419-85dc-58cd397667a8/project/0cc5c842-0060-4667-b377-78b66c418b6d.svg)](https://wakatime.com/badge/user/6fd82e7b-8d36-4419-85dc-58cd397667a8/project/0cc5c842-0060-4667-b377-78b66c418b6d) [![CI and Deploy](https://github.com/skvggor/strava-api-wrapper-clojure/actions/workflows/ci-and-deploy.yml/badge.svg)](https://github.com/skvggor/strava-api-wrapper-clojure/actions/workflows/ci-and-deploy.yml)\n\nI developed a program that integrates with the Strava API to retrieve and display total distance for the current year. By connecting to your Strava account, it fetches the necessary data and outputs the total distance for different sports, providing an easy way to track annual progress. I created this project as a way to learn and explore the [Clojure](https://clojure.org/) programming language.\n\n## Features\n\n- Retrieve total distance for current year\n- Support for multiple sports (run, ride)\n- RESTful API with JSON responses\n- Authentication via refresh token\n\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/skvggor/strava-api-wrapper-clojure.git\n   cd strava-api-wrapper-clojure\n   ```\n\n2. Create a `config.edn` file based on `config.edn.example`:\n   ```clojure\n   {:strava-domain \"https://www.strava.com\"\n    :strava-api-url \"/api/v3\"\n    :strava-client-id \"YOUR_CLIENT_ID\"\n    :strava-client-secret \"YOUR_CLIENT_SECRET\"\n    :strava-refresh-token \"YOUR_REFRESH_TOKEN\"\n    :strava-user-id \"YOUR_USER_ID\"\n    :port 3000}\n   ```\n\n3. Install dependencies:\n   ```bash\n   lein deps\n   ```\n\n## Usage\n\nStart the server:\n```bash\nbash start.sh\n```\n\nOr manually:\n```bash\nlein run\n```\n\nThe server will start on port 3000 (or the port specified in config.edn).\n\n## Docker Deployment\n\nFor production deployment with Docker and Caddy reverse proxy, create a `compose.yml` file:\n\n```yaml\nservices:\n  strava-api:\n    build:\n      context: .\n      dockerfile: Dockerfile\n    restart: unless-stopped\n    networks:\n      - caddy_net\n    labels:\n      - caddy=your-subdomain.yourdomain.com\n      - caddy.reverse_proxy={{upstreams 3002}}\n      - caddy.encode=zstd gzip\n    expose:\n      - 3002\n    volumes:\n      - ./config.edn:/usr/src/app/config.edn\n\nnetworks:\n  caddy_net:\n    external: true\n```\n\nReplace `your-subdomain.yourdomain.com` with your actual domain. Ensure your `config.edn` file is present and properly configured.\n\n## API Endpoints\n\n### Get Total Distance\n\nRetrieve total distance for the current year.\n\n**Endpoint:** `GET /api/v1/strava/total-distance/current-year`\n\n**Query Parameters:**\n- `sport` (optional): Sport type. Supported values: `run` (default), `ride`\n\n**Examples:**\n```bash\n# Get running distance (default)\ncurl http://localhost:3000/api/v1/strava/total-distance/current-year\n\n# Get running distance\ncurl http://localhost:3000/api/v1/strava/total-distance/current-year?sport=run\n\n# Get cycling distance\ncurl http://localhost:3000/api/v1/strava/total-distance/current-year?sport=ride\n```\n\n**Response:**\n```json\n{\n  \"distance\": 123.4\n}\n```\n\n## Running Tests\n\n```bash\nlein test\n```\n\n## Project Structure\n\n```\nstrava-api-wrapper-clojure/\n├── src/\n│   └── strava_api/\n│       ├── core.clj         # Main application and server setup\n│       ├── handlers.clj     # HTTP request handlers\n│       ├── strava.clj       # Strava API integration\n│       └── utils.clj        # Utility functions\n├── test/\n│   └── strava_api/\n│       └── utils_test.clj   # Unit tests\n├── config.edn               # Configuration file (not tracked)\n├── config.edn.example       # Example configuration\n└── start.sh                 # Script to start the server\n```\n\n## Tech Stack\n\n- **Clojure 1.12.4** - Functional programming language\n- **Compojure** - Routing library\n- **http-kit** - HTTP server\n- **clj-http** - HTTP client\n- **cheshire** - JSON parsing\n\n## License\n\nThis project is licensed under the Eclipse Public License - v 2.0.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskvggor%2Fstrava-api-wrapper-clojure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskvggor%2Fstrava-api-wrapper-clojure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskvggor%2Fstrava-api-wrapper-clojure/lists"}