{"id":27455531,"url":"https://github.com/atopx/rsapi","last_synced_at":"2025-04-15T16:43:59.861Z","repository":{"id":287601512,"uuid":"965235457","full_name":"atopx/rsapi","owner":"atopx","description":"A high-performance API template built with Axum, designed for rapid development of secure and maintainable web services.","archived":false,"fork":false,"pushed_at":"2025-04-12T18:28:47.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T19:22:33.629Z","etag":null,"topics":["axum","postgresql","rest-api","rust","sea-orm","template"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atopx.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,"zenodo":null}},"created_at":"2025-04-12T17:56:26.000Z","updated_at":"2025-04-12T18:28:50.000Z","dependencies_parsed_at":"2025-04-12T19:22:41.550Z","dependency_job_id":"06e7813c-05c0-443a-8cf9-5b4fd8eb38ce","html_url":"https://github.com/atopx/rsapi","commit_stats":null,"previous_names":["atopx/rsapi"],"tags_count":1,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atopx%2Frsapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atopx%2Frsapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atopx%2Frsapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atopx%2Frsapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atopx","download_url":"https://codeload.github.com/atopx/rsapi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249110795,"owners_count":21214402,"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":["axum","postgresql","rest-api","rust","sea-orm","template"],"created_at":"2025-04-15T16:43:58.264Z","updated_at":"2025-04-15T16:43:59.848Z","avatar_url":"https://github.com/atopx.png","language":"Rust","readme":"# RSAPI - Rust API Framework\n\nA high-performance API template built with Axum, designed for rapid development of secure and maintainable web services.\n\n[![Rust](https://img.shields.io/badge/Language-Rust-green.svg?style=flat)](https://www.rust-lang.org/)\n[![GitHub release](https://img.shields.io/github/release/atopx/rsapi.svg)](https://github.com/atopx/rsapi/releases)\n[![GitHub stars](https://img.shields.io/github/stars/atopx/rsapi)](https://github.com/atopx/rsapi/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/atopx/rsapi)](https://github.com/atopx/rsapi/network)\n[![GitHub issues](https://img.shields.io/github/issues/atopx/rsapi)](https://github.com/atopx/rsapi/issues)\n\n## Features\n\n- 🚀 **Production-Ready**\n  Fast and minimalistic web framework\n- 🔐 **JWT Authentication**\n  Secure token-based authentication system\n- ⏰ **Cron Scheduler**\n  Built-in task scheduling with `tokio-cron-scheduler`\n- 📦 **ORM Integration**\n  Database operations via SeaORM with PostgreSQL\n- 📡 **Observability**\n  Integrated tracing and structured logging\n- 🛡️ **Security**\n  CORS middleware and secure headers\n- 🐳 **Minimal docker image**\n  12.9MB Docker image with Alpine base\n\n## Tech Stack\n\n**Core Components**:\n- Axum 0.6 (Web Framework)\n- SeaORM 1.x (PostgreSQL ORM)\n- JSON Web Tokens (JWT)\n- Tokio 1.x (Async Runtime)\n\n**Infrastructure**:\n\n- Dockerized deployment\n- Multi-stage build optimization\n- Alpine Linux base image\n\n## Quick Start\n\n1. **Environment Setup**\n   ```bash\n   cp .env.sample .env\n   # Update variables in .env file\n   ```\n\n2. **Database Setup**\n\nEnsure PostgreSQL is running with credentials matching your [.env](./.env.sample) configuration.\n\nInitialize the database and table: [sys_tables](./docs/sys_table.sql)\n\n1. Run with Docker\n\n    ```bash\n    docker-compose up --build -d\n    ```\n\n\n## API Examples\n\n#### User Login :\n\n```bash\ncurl -X POST http://localhost:6000/api/login \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"username\":\"admin\",\"password\":\"your_password\"}'\n```\n\n#### Get User Claims :\n\n```bash\ncurl -X GET http://localhost:6000/api/claims \\\n  -H \"Authorization: Bearer YOUR_JWT_TOKEN\"\n```\n\n## Scheduled Tasks\n\n```bash\nCRONTAB_EXAMPLE=\"*/5 * * * * *\"  # Every 5 seconds\n```\n\nTask implementations are in `[schedule::example](./src/schedule/mod.rs)` .\n\n## Development\n\nBuild optimized binary:\n\n```bash\ncargo build --release\n```\n\nRun tests (ensure test database is configured):\n\n```bash\ncargo test -- --test-threads=1\n```\n\n---\n\nLicense: [MIT](./LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatopx%2Frsapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatopx%2Frsapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatopx%2Frsapi/lists"}