{"id":24801237,"url":"https://github.com/claddyy/payment-service","last_synced_at":"2025-03-25T03:32:07.901Z","repository":{"id":269473338,"uuid":"907516693","full_name":"claddyy/payment-service","owner":"claddyy","description":"simple RESTful payment service using Actix Web","archived":false,"fork":false,"pushed_at":"2025-01-30T02:29:20.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-30T03:23:01.096Z","etag":null,"topics":["actix-web","rust-lang","sea-orm"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/claddyy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-12-23T19:04:36.000Z","updated_at":"2025-01-30T03:16:21.000Z","dependencies_parsed_at":"2024-12-23T20:31:55.077Z","dependency_job_id":"5c4b5989-dc24-42a0-8507-56e378da96aa","html_url":"https://github.com/claddyy/payment-service","commit_stats":null,"previous_names":["claddyy/dodo-assignment","claddyy/payment-service"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claddyy%2Fpayment-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claddyy%2Fpayment-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claddyy%2Fpayment-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claddyy%2Fpayment-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/claddyy","download_url":"https://codeload.github.com/claddyy/payment-service/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245394752,"owners_count":20608122,"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":["actix-web","rust-lang","sea-orm"],"created_at":"2025-01-30T04:19:48.928Z","updated_at":"2025-03-25T03:32:07.877Z","avatar_url":"https://github.com/claddyy.png","language":"Rust","readme":"### Payment Service Backend \n\nA payment service implementation built with Rust, featuring user management, transaction processing, and account balance tracking. This service provides a RESTful API using the Actix web framework with PostgreSQL as the database backend.\n\n### Core Functionality\n- User Management\n  - Registration and authentication\n  - JWT-based authorization\n  - Secure password handling with bcrypt\n- Transaction Management\n  - Create and process transactions\n  - Transaction history tracking\n  - Per-user transaction listing\n- Account Management\n  - Multiple accounts per user\n  - Account creation and management\n\n### Technical Features\n- Built with `actix-web` for high performance\n- Asynchronous operations using Rust's async/await\n- Rate limiting with `actix-governor`\n- Request logging and tracing\n- CORS support\n- Structured API error responses\n\n### Project Structure\n\n```\nsrc/\n├── app_state.rs       # Application state management\n├── constants.rs       # Global constants\n├── features/\n│   ├── accounts/      # Account management\n│   ├── transactions/  # Transaction processing\n│   ├── user/          # User profile management\n│   └── healthcheck/   # Service health check\n├── middlewares/       # Middleware for JWT and CORS\n├── routes.rs          # API route configuration\n├── types.rs          # Common type definitions\n├── util.rs           # Utility functions and error handling\n└── main.rs           # Application entry point\n```\n\n### Prerequisites\n\n- Rust : Install using rustup and/or checkout [documentation](https://www.rust-lang.org/tools/install)\n- PostgreSQL : Download from [here](https://www.postgresql.org/download/)\n- Docker (optional) : Download from [here](https://www.docker.com/products/docker-desktop/)\n- sea-orm-cli : Install using `cargo install sea-orm-cli@1.1.0`\n\n### Getting Started\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/claddyy/dodo-assignment.git\n   cd dodo-assignment\n   ```\n\n2. Set up the database:\n   ```bash\n   # PostgreSQL connection details should be configured in your .env\n   # Set you database url in .env.example\n   mv .env.example .env\n   cd db/\n   sea-orm-cli migrate fresh #This migrates the database to schema.\n   \n   ```\n\u003e To install sea-orm-cli, simply run `cargo install sea-orm-cli@1.1.0`\n4. Run the server\n   ```bash\n   cd ..\n   cd http/\n   cargo run\n   ```\n\nThe service will start on `localhost:3000` by default.\n\n**Installation using Docker**\n\nThe setup handles everything automatically, including the database setup and migrations.\n\n```\ngit clone https://github.com/claddyy/dodo-assignment.git\ncd dodo-assignment/\ndocker-compose up --build\n```\n\n\n### API Documentation\n\nThe service exposes the following API endpoints:\n\n**User Management**\n- `POST /api/user/register` - Register a new user\n- `POST /api/user/login` - Authenticate a user\n\n**Account Management**\n- `POST /api/account/create` - Create a new account\n- `GET /api/account/{account_id}` - Get account details\n- `GET /api/account/list/acc` - List all user accounts\n- `GET /api/account/{account_id}/balance` - Get account balance\n\n**Transaction Management**\n- `POST /api/transaction/create` - Create a new transaction\n- `GET /api/transaction/{transaction_id}` - Get transaction details\n- `GET /api/transaction/usertx/tx` - List user transactions\n\n### Documentation\nThis repo support `rustdocs` and documentation can be generated with:\n```bash\ncargo doc\n```\n\n### Code Formatting\nFormat your code with:\n```bash\ncargo fmt\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcladdyy%2Fpayment-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcladdyy%2Fpayment-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcladdyy%2Fpayment-service/lists"}