https://github.com/x0rd3v1l/payment-backend-service
Rust-based backend service for payment processing, featuring database migrations, Docker support, and API documentation.
https://github.com/x0rd3v1l/payment-backend-service
backend restful-api rocket rust
Last synced: 2 months ago
JSON representation
Rust-based backend service for payment processing, featuring database migrations, Docker support, and API documentation.
- Host: GitHub
- URL: https://github.com/x0rd3v1l/payment-backend-service
- Owner: X0rD3v1L
- Created: 2025-05-21T17:04:31.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-21T17:28:39.000Z (about 1 year ago)
- Last Synced: 2025-06-13T22:39:27.407Z (about 1 year ago)
- Topics: backend, restful-api, rocket, rust
- Language: Rust
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Payment Backend Service
**Payment Backend Service** contains RESTful API endpoints for User, Account and Transaction Management.
## ๐ ๏ธ Technologies Used
* **Programming Language**: Rust
* **Containerization**: Docker
* **Database**: PostgreSQL
* **ORM**: SeaORM
* **Web Framework**: Rocket
## ๐ Project Structure
```
โโโ api_docs..md
โโโ Cargo.lock
โโโ Cargo.toml
โโโ docker-compose.yml
โโโ README.md
โโโ src
โย ย โโโ auth
โย ย โย ย โโโ mod.rs
โย ย โโโ controllers
โย ย โย ย โโโ accounts.rs
โย ย โย ย โโโ auth.rs
โย ย โย ย โโโ mod.rs
โย ย โย ย โโโ profile.rs
โย ย โย ย โโโ transactions.rs
โย ย โโโ db
โย ย โย ย โโโ mod.rs
โย ย โโโ entities
โย ย โย ย โโโ account.rs
โย ย โย ย โโโ mod.rs
โย ย โย ย โโโ prelude.rs
โย ย โย ย โโโ transactions.rs
โย ย โย ย โโโ txns.rs
โย ย โย ย โโโ users.rs
โย ย โโโ fairings
โย ย โย ย โโโ cors.rs
โย ย โย ย โโโ mod.rs
โย ย โโโ kafka
โย ย โย ย โโโ consumer.rs
โย ย โย ย โโโ mod.rs
โย ย โย ย โโโ producer.rs
โย ย โโโ lib.rs
โย ย โโโ main.rs
โย ย โโโ migrator
โย ย โย ย โโโ m20250521_135328_create_users_table.rs
โย ย โย ย โโโ m20250521_135711_create_accounts_table.rs
โย ย โย ย โโโ m20250521_135737_store_transactions_table.rs
โย ย โย ย โโโ mod.rs
โย ย โโโ utils
โย ย โโโ mod.rs
โย ย โโโ random.rs
โย ย โโโ validations.rs
โโโ tests
โโโ endpoint_test.rs
11 directories, 33 files
```
## โ๏ธ Getting Started
### Prerequisites
* Rust (latest stable version)
* Docker & Docker Compose
* psql (PostgreSQL) 17.5 (Ubuntu 17.5-1.pgdg24.04+1)
### Installation
1. **Clone the repository**:
```bash
git clone https://github.com/X0rD3v1L/payment-backend-service.git
cd payment-backend-service
```
2. **Set up environment variables**:
Create a `.env` file in the root directory and configure the necessary environment variables.
```
PAYMENTS_JWT_SECRET="REDACTED"
```
To generate,
```openssl rand -base64 64```
3. **Build and run the application**:
Make sure a database named `payments` exists in your local psql.
```bash
cargo build
cargo run
```
In another terminal,
```bash
docker-compose up
```
The service should now be running and accessible at `http://127.0.0.1:8000`.
## ๐งช Running Tests
To execute the test suite:
```bash
cargo test
```
A sample test case was written to test the usage, comprenshive unit tests and integration tests need to be written.
## ๐ API Documentation
Detailed API documentation is available in the [`api_docs.md`](./api_docs.md) file. It provides comprehensive information on available endpoints, request/response structures, and usage examples.