-
Ensure Docker and Docker Compose are installed on your system.
-
Clone this repository:
git clone [email protected]:pramudya3/backend.git && cd backend
This command clones the repository from the specified GitHub URL and then navigates into the cloned repository directory.
-
Build and start the containers using Docker Compose:
docker-compose up --build
-
Access the services through the defined endpoints.
-
Account Service
-
Running at:
http://localhost:2000
-
Users API endpoints:
-
POST /signup
: Create a new user account.- JSON payload:
{ "name": "name", "username": "username", "email": "[email protected]", "password": "pass123" }
- JSON payload:
-
POST /login
: Log in to an existing user account.- JSON payload:
{ "id": 1, "password": "pass123" }
Response payload:
{ "data": "access-token" }
-
GET user/logout
: Log out from the current user session, protected by JWT Token- Bearer token:
access-token
- Bearer token:
-
GET /user/my-profile
: Get user information user, protected by JWT Token- Bearer token:
access-token
- Bearer token:
-
-
Payment Account Endpoints:
POST /payment-account
: Create a payment account associated with a user.- Bearer token:
access-token
- JSON payload:
{ "type":"Debit", // {Debit, Credit} "balance":50000 // }
- Bearer token:
-
Payment History Endpoints:
GET /payment-history
: Retrieve payment history for a user, protected by JWT token- Bearer token:
access-token
- Bearer token:
-
-
Payment Service
-
Running at:
http://localhost:3000
-
APIs Endpoints:
POST /send
: Send money to another user.-
Bearer token:
access-token
-
JSON payload:
{ "to_user_id": 2, "amount": 50000, "payment_method":"Debit" }
-
POST /withdraw
: Withdraw money from the user's account, protected by JWT token- Bearer token:
access-token
- JSON payload:
{ "amount":5000, "payment_method":"Debit" }
- Bearer token:
-
- Golang
- Supertokens
- GORM
- PostgreSQL
- Gin Gonic