{"id":27961735,"url":"https://github.com/johnbasrai/cr8s","last_synced_at":"2026-05-09T15:03:55.918Z","repository":{"id":291471002,"uuid":"896545099","full_name":"JohnBasrai/cr8s","owner":"JohnBasrai","description":"Production-ready Rocket API stack (Rust · Diesel/PostgreSQL · Redis · Tera) — Docker-first dev env \u0026 GitHub Actions CI","archived":false,"fork":false,"pushed_at":"2025-05-04T20:51:41.000Z","size":30,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-04T21:29:30.815Z","etag":null,"topics":["argon2","diesel","full-stack","nosql","postgressql","redis","rocket","rust","tera","web"],"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/JohnBasrai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-11-30T16:43:47.000Z","updated_at":"2025-05-04T20:54:34.000Z","dependencies_parsed_at":"2025-05-04T21:40:44.108Z","dependency_job_id":null,"html_url":"https://github.com/JohnBasrai/cr8s","commit_stats":null,"previous_names":["johnbasrai/cr8s"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnBasrai%2Fcr8s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnBasrai%2Fcr8s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnBasrai%2Fcr8s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnBasrai%2Fcr8s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JohnBasrai","download_url":"https://codeload.github.com/JohnBasrai/cr8s/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252940934,"owners_count":21828769,"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":["argon2","diesel","full-stack","nosql","postgressql","redis","rocket","rust","tera","web"],"created_at":"2025-05-07T19:11:20.233Z","updated_at":"2026-05-09T15:03:55.909Z","avatar_url":"https://github.com/JohnBasrai.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cr8s\n\nSample full‑stack **Rust** web service demonstrating clean architecture, trait-based design, SQLx/PostgreSQL, Redis, Docker, and automated CI.\n\n---\n\n## ✨ What's inside?\n\n| Layer | Tech | Purpose |\n|-------|------|---------|\n| HTTP  | **Rocket 0.5** | Async web framework |\n| DB    | **SQLx** + **PostgreSQL** | Async SQL with runtime verification |\n| Cache | **Redis** | Session / ephemeral storage |\n| Admin | CLI binary (`cargo run --bin cli`) | User management, DB setup, and admin utilities |\n| Tests | `tokio`, `reqwest` | CLI \u0026 HTTP API integration tests with authentication |\n| Dev   | **Docker Compose** | One‑command reproducible stack |\n| CI    | **GitHub Actions** | Lint → migrate → build → test |\n\n---\n\n## 🏗️ Architecture\n\n- **Domain-Driven Design** - Business logic separated from infrastructure\n- **Trait-Based Abstractions** - Clean boundaries between layers\n- **Repository Pattern** - Database access abstracted behind traits\n- **Dependency Injection** - Components use trait objects, not concrete types\n- **Multi-layered Testing** - Unit tests + integration tests for CLI \u0026 HTTP API\n\n---\n\n## 🛠️ Prerequisites\n\n```text\nDocker ≥ 24.x           # Engine\nDocker Compose v2       # Already bundled with modern Docker\n```\n\n---\n\n## 🚀 Getting Started\n\n### Development Mode (WIP)\n\n```bash\ndocker compose up -d postgres redis\ncargo run                      # backend starts on :8000\n```\n\n### Initialize Database\n\nSee [docs/CR8S - Database Schema.md](docs/CR8S%20-%20Database%20Schema.md) for database setup instructions.\n\n### With Frontend (`cr8s-fe`)\n\nSee the **cr8s-fe** repository for full-stack development instructions.\n\n---\n\n## 🧪 Testing\n\n### Run All Tests\n```bash\n# Set up development environment\nsource scripts/dev-test-setup.sh\n\n# Start services and run all tests\nstart-services \u0026\u0026 run-tests\n```\n\n### Individual Test Suites\n```bash\nrun-cli-tests        # Test CLI commands\nrun-server-tests     # Test HTTP API endpoints\n```\n\nSee [docs/development.md](docs/development.md) for detailed testing workflows.\n\n---\n\n## 📂 Project layout\n\n```text\ncr8s/\n├── Cargo.toml                 # workspace + crate metadata\n├── Rocket.toml.template       # config template with env substitution\n├── Dockerfile                 # backend container (tests \u0026 prod)\n├── docker-compose.yml         # Postgres + Redis + Rocket\n│\n├── src/                       # application code\n│   ├── bin/                   # cli.rs, server.rs entry-points\n│   ├── domain/                # business logic traits \u0026 models\n│   ├── repository/            # SQLx implementations \u0026 database layer\n│   ├── rocket_routes/         # HTTP handlers \u0026 REST API\n│   ├── auth.rs                # authentication \u0026 password handling\n│   ├── mail/                  # email service implementation\n│   └── tests/                 # unit tests \u0026 architectural validation\n│\n├── tests/                     # integration tests\n│   ├── cli_integration.rs     # CLI command testing\n│   └── server_integration.rs  # HTTP API testing\n│\n├── templates/email/           # Tera email templates\n├── scripts\n│   ├── build-images.sh        # Builds cr8s server and cli Docker images\n│   ├── build-verification-test.sh # Comprehensive system smoke test\n│   └── sql\n│       └── db-init.sql\n└── docs/                      # Docker tips \u0026 native workflow\n```\n\n---\n\n## Development\n\nSee [docs/development.md](docs/development.md) for detailed information about:\n- CLI argument testing (with/without database)\n- Route state analysis\n- Local development setup\n\n---\n\n## 🧪 Continuous Integration\n\nGitHub Actions runs the CI pipeline inside the `cr8s-dev` container, ensuring full parity with local development.\n\nNon-gating advisory checks (e.g., `cargo audit`, `cargo outdated`) are also included for visibility.\n\n---\n\nMIT © 2025 John Basrai\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnbasrai%2Fcr8s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnbasrai%2Fcr8s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnbasrai%2Fcr8s/lists"}