{"id":24302841,"url":"https://github.com/bryanfks-dev/courtly-service","last_synced_at":"2026-05-29T08:31:42.551Z","repository":{"id":271847636,"uuid":"875386311","full_name":"bryanfks-dev/Courtly-Service","owner":"bryanfks-dev","description":"Backend service of Courtly: Easily Order Court Application built with echo and GORM Golang framework ","archived":false,"fork":false,"pushed_at":"2025-01-11T03:07:40.000Z","size":322,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T14:31:25.713Z","etag":null,"topics":["echo-framework","golang","gorm-orm"],"latest_commit_sha":null,"homepage":"","language":"Go","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/bryanfks-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2024-10-19T20:45:33.000Z","updated_at":"2025-01-11T03:07:43.000Z","dependencies_parsed_at":"2025-01-10T09:43:37.859Z","dependency_job_id":"c1e74a77-3a8e-4dbb-ad8b-ddcb931f2084","html_url":"https://github.com/bryanfks-dev/Courtly-Service","commit_stats":null,"previous_names":["bryanfks-dev/courtly-service"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bryanfks-dev/Courtly-Service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanfks-dev%2FCourtly-Service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanfks-dev%2FCourtly-Service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanfks-dev%2FCourtly-Service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanfks-dev%2FCourtly-Service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bryanfks-dev","download_url":"https://codeload.github.com/bryanfks-dev/Courtly-Service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanfks-dev%2FCourtly-Service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33644203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["echo-framework","golang","gorm-orm"],"created_at":"2025-01-17T00:19:48.382Z","updated_at":"2026-05-29T08:31:42.532Z","avatar_url":"https://github.com/bryanfks-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Courtly Service\r\n\r\nCourtly Service is a backend service of Courtly: Easily Order Court Application. Courtly-Service is designed to facilitate seamless service management for sports court rentals. This server is built to manage user offerings, handle bookings, and connect efficiently.\r\n\r\n## Features\r\n\r\n- **API for Booking Management**: Manage bookings and availability for sports fields.\r\n- **Vendor Service Management**: APIs for vendors to add and manage their services.\r\n- **Authentication and Authorization**: Secure access with token-based authentication.\r\n- **Scalable Architecture**: Designed for high performance and scalability.\r\n\r\n## Technologies Used\r\n\r\n- **Programming Language**: Go (Golang)\r\n- **Framework**: Echo and GORM\r\n- **Database**: MySQL\r\n- **Authentication**: JWT (JSON Web Tokens)\r\n\r\n## Getting Started\r\n\r\n### Requirement(s):\r\n\r\n- **Go**: [Install Go](https://go.dev/doc/install).\r\n- **MySQL**: Ensure MySQL is installed and running.\r\n- **ngrok**: Temporary deploy the service server for midtrans payment callback, [Install ngrok](https://download.ngrok.com).\r\n\r\n## Endpoint List\r\n\r\nThere are several available endpoints, such as:\r\n\r\n##### Auth endpoints\r\n\r\n- **POST** `/api/v1/auth/user/login` - Sign user with an existing account\r\n- **POST** `/api/v1/auth/user/register` - Register a new user account\r\n- **POST** `/api/v1/auth/user/logout` - Remove user from authenticated status\r\n- **POST** `/api/v1/auth/user/verify-password` - Verify current user password\r\n- **POST** `/api/v1/auth/vendor/verify-password` - Verify current vendor password\r\n- **POST** `/api/v1/auth/vendor/login` - Sign vendor with an existing account\r\n- **POST** `/api/v1/auth/vendor/logout` - Remove vendor from authenticated status\r\n\r\n##### Users endpoints\r\n\r\n- **GET** `/api/v1/users/me` - Get current user information from the database\r\n- **PATCH** `/api/v1/users/me/password` - Update user password with a new password\r\n- **PATCH** `/api/v1/users/me/username` - Update user username with a new available username\r\n- **PATCH** `/api/v1/users/me/profile-picture` - Update user profile picture with a new profile image\r\n\r\n##### Vendors endpoints\r\n\r\n- **GET** `/api/v1/vendors/me` - Get current vendor information from database\r\n- **PATCH** `/api/v1/vendors/me/password` - Update vendor password with a new password\r\n\r\n##### Orders endpoints\r\n\r\n- **GET** `/api/v1/users/me/orders` - Get current user orders overview from database\r\n- **GET** `/api/v1/users/me/orders/reorder` - Create a new order from existing order from database\r\n- **POST** `/api/v1/users/me/orders` - Create a new current user order and payment\r\n- **GET** `/api/v1/users/me/orders/:id` - Get current user order details from database\r\n- **GET** `/api/v1/vendors/me/orders` - Get current vendor orders overview from database\r\n- **GET** `/api/v1/vendors/me/orders/stats` - Get current vendor orders stats from database\r\n- **GET** `/api/v1/vendors/me/orders/:id` - Get current vendor order details from database\r\n\r\n##### Courts endpoints\r\n\r\n- **GET** `/api/v1/courts` - Get all available courts from database\r\n- **GET** `/api/v1/vendors/:id/courts/:type` - Get vendor courts using vendor id and court type from database\r\n- **GET** `/api/v1/vendors/:id/courts/:type/bookings` - Get vendor court booking datas using vendor id and court type from database\r\n- **GET** `/api/v1/vendors/me/courts/:type` - Get current vendor courts using court type from database\r\n- **PUT** `/api/v1/vendors/me/courts/:type` - Update current vendor courts using court type from database\r\n- **GET** `/api/v1/vendors/courts/:type/bookings` - Get current vendor court type based on court type from database\r\n- **POST** `/api/v1/vendors/me/courts/:type/new` - Create a new court for a court type\r\n- **POST** `/api/v1/vendors/me/courts/:type` - Create a new court for a court type from the existing court\r\n- **GET** `/api/v1/vendors/me/courts/stats` - Get current vendor courts stats from database\r\n\r\n##### Reviews endpoints\r\n\r\n- **GET** `/api/v1/vendors/:id/courts/:type/reviews` - Get vendor courts type reviews from database\r\n- **GET** `/api/v1/vendors/me/reviews` - Get court reviews related to the vendor from database\r\n- **POST** `/api/v1/vendors/:id/courts/:type/reviews` - Create a new review for current vendor and court type\r\n\r\n##### Fees endpoint\r\n\r\n- **GET** `/api/v1/fees` - Get all service fees related to bussiness transactions\r\n\r\n##### Advertisements endpoint\r\n\r\n- **GET** `/api/v1/advertisements` - Get all available advertisements related to the vendor and vendor's court\r\n\r\n##### Payment gateway endpoints\r\n\r\n- **GET** `/midtrans/payment-callback` - A payment callback endpoint to mark an order status as success\r\n\r\n## Response\r\n\r\nSince this service relies on REST API, so json is pretty much needed here. All endpoints have the same json response structure **(in general)**, which shown as an example below.\r\n\r\n```json\r\n{\r\n  \"success\": true,\r\n  \"message\": \"...\",\r\n  \"data\": {\r\n    \"...\"\r\n  }\r\n}\r\n```\r\n\r\nFrom the example, we can see there are 3 properties in the response body, which will be explained below.\r\n\r\n- `\"success\"` - The success status of the response, this could be either true or false.\r\n- `\"message\"` - The message of the response, this could be either a success message, failed message, or error messages for inputs\r\n- `\"data\"` - The passed data to the frontend server. The data structure could be different for each endpoint response, so make sure to read the response carefully\r\n\r\nTo see responses structure in details, please read this doc.\r\n\r\n---\r\n\r\n[![visit-docs](https://img.shields.io/badge/visit-response--docs-blue)](https://github.com/bryanfks-dev/Courtly-Service/blob/main/docs/RESPONSES.md)\r\n\r\n## Installation\r\n\r\nTo start the service, make sure to follow the steps below.\r\n\r\n1. Clone the repository:\r\n\r\n```bash\r\ngit clone https://github.com/bryanfks-dev/Courtly-Service.git\r\ncd Courtly-Service\r\n```\r\n\r\n2. Install depedencies:\r\n\r\n```bash\r\ngo mod tidy\r\n```\r\n\r\n2. Clone the environment file\r\n\r\n```bash\r\ncp .env.example .env\r\n```\r\n\r\n3. Go to [midtrans website](https://dashboard.sandbox.midtrans.com/integrations/configurations), find your midtrans server key, and copy it to clipboard.\r\n\r\n4. Set up the environment variables:\r\n\r\n```env\r\n# Database Configuration\r\nDB_HOST=\u003cyour-db-host\u003e\r\nDB_PORT=\u003cyour-db-port\u003e\r\nDB_USERNAME=\u003cyour-dh-username\u003e\r\nDB_PASSWORD=\u003cyour-dh-password\u003e\r\nDB_DATABASE=courtly_db\r\n\r\n# Server Configuration\r\nSERVER_HOST=localhost\r\nSERVER_PORT=3000\r\n\r\n# JWT Configuration\r\nJWT_SECRET=\u003cyour-jwt-secret\u003e\r\n\r\n# Payment Gateway Configuration\r\nMIDTRANS_API_KEY=\u003cyour-midtrans-server-key\u003e\r\n```\r\n\r\n4. Run the server:\r\n\r\n```bash\r\ngo run main.go\r\n```\r\n\r\nThe server will start on port that you've set based on the environtment variable (e.g. :3000).\r\n\r\n5. Start ngrok:\r\n\r\n```bash\r\nngrok http \u003cport-to-listen\u003e\r\n```\r\n\r\n6. Copy the generated ngrok link, then paste the link into the **Payment Notification URL** in the [midtrans website](https://dashboard.sandbox.midtrans.com/integrations/configurations) with the given format:\r\n\r\n```txt\r\n\u003cngrok-url\u003e/midtrans/payment-callback\r\n```\r\n\r\n### License\r\n\r\nThis project is open-source and available under the [MIT License](https://github.com/bryanfks-dev/Courtly-Service/blob/main/LICENSE).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryanfks-dev%2Fcourtly-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbryanfks-dev%2Fcourtly-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryanfks-dev%2Fcourtly-service/lists"}