PasargameX is a secure marketplace platform for game-related transactions, built with Go using clean architecture principles. It enables users to buy, sell, and trade game accounts, in-game items, and boosting services with secure middleware options.
- Authentication System: Secure user registration, login, token refresh and password management
- Game Title Management: Create and manage game categories with custom attributes
- Product Management: List, search, and manage gaming products with detailed attributes
- Transaction Processing: Multiple delivery methods including instant and middleman options
- Review System: Rate and review transactions with reporting functionality
- File Management: Upload, store, and manage images for products and verification
- Wallet & Payments: Digital wallet system with top-up, withdraw, and payment methods
- Real-time Chat: WebSocket-based messaging system with online status and typing indicators
- Admin Dashboard: Verify users, manage disputes, handle middleman transactions, wallet management
- User Verification: Identity verification process for sellers
- Backend: Go 1.22.4 with Echo framework
- Authentication: Firebase Auth
- Database: Firestore
- Storage: Google Cloud Storage
- Containerization: Docker and Docker Compose
- Deployment: Google Cloud Platform (Cloud Run)
- CI/CD: Google Cloud Build
- Go 1.22.4 or higher
- Docker and Docker Compose (for containerized setup)
- Firebase project with Firestore and Storage enabled
- Google Cloud Platform account (for deployment)
-
Clone the repository:
git clone https://github.com/username/pasargamex.git cd pasargamex -
Install dependencies:
go mod download -
Set up environment variables (create a
.envfile):SERVER_PORT=8080 FIREBASE_PROJECT_ID=your-firebase-project-id FIREBASE_API_KEY=your-firebase-api-key ENVIRONMENT=development JWT_SECRET=your-jwt-secret STORAGE_BUCKET=your-gcs-bucket-name FIREBASE_SERVICE_ACCOUNT_PATH=./path-to-firebase-service-account.json -
Run the application:
go run cmd/api/main.go
- Build and run with Docker Compose:
docker-compose up --build
pasargamex/
├── cmd/
│ └── api/ # Application entry point
├── internal/
│ ├── adapter/ # External adapters (API, repositories)
│ │ ├── api/ # HTTP handlers and middleware
│ │ └── repository/# Database repositories
│ ├── domain/ # Business domain (entities, repositories interfaces)
│ ├── infrastructure/# Technical implementations (Firebase, Storage)
│ └── usecase/ # Business logic
├── pkg/ # Shared packages
├── tests/ # Test files
└── docker-compose.yml # Docker configuration
The API follows RESTful principles with these main endpoints:
-
Authentication
POST /v1/auth/register- Register a new userPOST /v1/auth/login- Login userPOST /v1/auth/refresh- Refresh token
-
Users
GET /v1/users/me- Get user profilePATCH /v1/users/me- Update profilePOST /v1/users/me/verification- Submit verification
-
Game Titles
GET /v1/game-titles- List all game titlesGET /v1/game-titles/:id- Get game title detailsGET /v1/games/:slug- Get game by slug
-
Products
GET /v1/products- List all productsGET /v1/products/search- Search productsGET /v1/products/:id- Get product detailsGET /v1/my-products- List user's productsPOST /v1/my-products- Create a productPUT /v1/my-products/:id- Update a product
-
Transactions
POST /v1/transactions- Create a transactionGET /v1/transactions- List transactionsGET /v1/transactions/:id- Get transaction detailsPOST /v1/transactions/:id/payment- Process paymentPOST /v1/transactions/:id/confirm- Confirm delivery
-
Files
POST /v1/files/upload- Upload fileGET /v1/files/view/:id- View filePOST /v1/files/delete- Delete file
-
Wallet & Payments
GET /v1/wallet- Get wallet balancePOST /v1/wallet/topup- Create top-up requestPOST /v1/wallet/withdraw- Create withdraw requestGET /v1/wallet/transactions- Get wallet transaction historyGET /v1/wallet/payment-methods- List payment methodsPOST /v1/wallet/payment-methods- Add payment method
-
Chat & Messaging
GET /v1/chats- List user chatsGET /v1/chats/:id- Get chat detailsPOST /v1/chats/:id/messages- Send messageWS /v1/ws- WebSocket connection for real-time messaging
The application is designed to be deployed on Google Cloud Platform using Cloud Run. The repository includes a Dockerfile and configuration for GCP deployment.
-
Build the Docker image:
docker build -t gcr.io/your-project-id/pasargamex . -
Push to Google Container Registry:
docker push gcr.io/your-project-id/pasargamex -
Deploy to Cloud Run:
gcloud run deploy pasargamex \ --image gcr.io/your-project-id/pasargamex \ --platform managed \ --region asia-southeast1 \ --allow-unauthenticated
This project is licensed under the MIT License - see the LICENSE file for details.