{"id":28203107,"url":"https://github.com/mhmdd-farhan/trust-backend","last_synced_at":"2026-02-14T05:33:00.985Z","repository":{"id":257768148,"uuid":"858109324","full_name":"mhmdd-farhan/trust-backend","owner":"mhmdd-farhan","description":"Backend API for Trust","archived":false,"fork":false,"pushed_at":"2025-04-27T06:54:38.000Z","size":987,"stargazers_count":1,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T06:32:15.246Z","etag":null,"topics":["bun","docker","honojs","jwt","oslo","postgresql","prisma-orm","redis","typescript"],"latest_commit_sha":null,"homepage":"https://trust-api.muhammad-farhan.com","language":"TypeScript","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/mhmdd-farhan.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-16T10:23:39.000Z","updated_at":"2025-04-27T06:54:41.000Z","dependencies_parsed_at":"2024-11-24T11:20:27.970Z","dependency_job_id":"ca6780a5-c803-4f4f-9699-18520c716c66","html_url":"https://github.com/mhmdd-farhan/trust-backend","commit_stats":null,"previous_names":["aan-cloud/trust-backend","mhmdd-farhan/trust-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mhmdd-farhan/trust-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmdd-farhan%2Ftrust-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmdd-farhan%2Ftrust-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmdd-farhan%2Ftrust-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmdd-farhan%2Ftrust-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhmdd-farhan","download_url":"https://codeload.github.com/mhmdd-farhan/trust-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmdd-farhan%2Ftrust-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29438477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T05:24:35.651Z","status":"ssl_error","status_checked_at":"2026-02-14T05:24:34.830Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bun","docker","honojs","jwt","oslo","postgresql","prisma-orm","redis","typescript"],"created_at":"2025-05-17T01:13:17.654Z","updated_at":"2026-02-14T05:33:00.980Z","avatar_url":"https://github.com/mhmdd-farhan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trust API\n\nTrust API is part of the **Trust** software suite build base-on REST API. Trust API serves as the **main server**, built with high-performance technologies and leveraging built-in framework design patterns such as:\n\n-   Middleware Pattern\n-   Routing Pattern\n-   Dependency Injection (DI)\n-   Chain of Responsibility\n-   Modular Pattern\n-   Functional Programming Pattern\n\n---\n\n## Table of Contents\n\n-   [Entity Relationship Diagram/Database Design](#entity-relationship-diagramdatabase-design)\n-   [Software Architecture](#software-architecture)\n-   [Tech Stack](#tech-stack)\n-   [Setup Project](#setup-project)\n    -   [Install Dependencies](#install-dependencies)\n    -   [Setup `.env` File](#setup-env-file)\n    -   [Setup Docker Compose and Dockerfile](#setup-docker-compose-and-dockerfile)\n    -   [Run Docker](#run-docker)\n    -   [Generate and Migrate Prisma](#generate-and-migrate-prisma)\n-   [API Endpoints](#api-endpoints)\n-   [License](#license)\n\n---\n\n## Entity Relationship Diagram/Database Design\n\n![ERD](erd.svg)\n\n---\n\n## Software Architecture\n\nTrust using Monolithic Client-Server Architecture connected each other, see the visual diagram [Lucidcart](https://lucid.app/lucidchart/b3dfe397-2b57-4cfa-ad16-3245d673ebc9/edit?viewport_loc=-1028%2C-413%2C555%2C229%2C0_0\u0026invitationId=inv_04e3e4d3-32f0-4679-9229-493535695c3e)\n\n---\n\n## Tech Stack\n\n-   **Hono**: A lightweight, high-performance web framework ideal for creating fast APIs with built-in middleware and routing.\n-   **PostgreSQL**: A powerful, open-source relational database used for reliable and efficient data storage.\n-   **Prisma**: An ORM (Object-Relational Mapping) tool that simplifies database management and queries in a type-safe manner.\n-   **TypeScript**: A superset of JavaScript providing static typing and better tooling for large codebases.\n-   **ESLint**: A code linter that helps maintain code quality and consistency by detecting and fixing problematic patterns.\n-   **Prettier**: An opinionated code formatter to ensure consistent code style across the project.\n-   **OpenAPI Swagger**: A tool to design and document APIs, ensuring clear and structured API specifications.\n-   **Scalar**: A library for defining GraphQL scalar types, enabling custom data types for API development.\n\n---\n\n## Setup Project\n\n### Install Dependencies\n\nRun the following command to install the required dependencies:\n\n```bash\nbun install\n```\n\n### Setup .env file\n\nCreate a .env file in the root directory with the following values:\n\n```yaml\nTOKEN_SECRET=\n\nPOSTGRES_USER=\nPOSTGRES_PASSWORD=\nPOSTGRES_DB=\n\nDATABASE_URL=\n```\n\n### Setup Docker Compose and Dockerfile\n\nUse the configuration below for docker-compose.yml:\n\n```yaml\nservices:\n    backend:\n        build: .\n        ports:\n            - \"3000:3000\"\n        env_file:\n            - path: .env.render\n              required: true\n        depends_on:\n            - database\n    database:\n        image: postgres:alpine\n        ports:\n            - \"5432:5432\"\n        env_file:\n            - path: .env\n              required: true\n        command: [\"postgres\", \"-c\", \"log_statement=all\"]\n    redis:\n        image: redis\n        container_name: redis\n        restart: always\n        ports:\n            - \"6380:6379\"\n        command: [\"redis-server\", \"--requirepass\", \"my-top-secret\"]\n#     volumes:\n#       - postgres-data:/var/lib/postgresql/data\n\n# volumes:\n#   postgres-data:\n```\n\n.dockerfile:\n\n```yaml\n# Use Bun image from the Docker Hub\nFROM oven/bun:debian\n\n# Create and change to the app directory\nWORKDIR /usr/src/app\n\n# Copy app files\nCOPY . .\n\n# Install dependencies\nRUN bun install --frozen-lockfile\n\n# Generate Prisma\nRUN bun run generate\n\n# Run the application\nCMD [\"bun\", \"start\"]\n```\n\n### Run docker\n\nTo start the services, run the following command:\n\n```bash\ndocker-compose up -d\n```\n\n### Generate and Migrate Prisma\n\nRun the following commands to generate the Prisma client and apply database migrations:\n\n```bash\nbun run generate\nbun run db:migrate:dev\n```\n\n## API Endpoints\n\nThe following table lists the available authentication-related endpoints:\n\n| Method | Endpoint         | Description          |\n| ------ | ---------------- | -------------------- |\n| POST   | `/auth/register` | Register a new user  |\n| POST   | `/auth/login`    | Login to an account  |\n| GET    | `/auth/me`       | Get user information |\n\n---\n\n## License\n\nThis project is licensed under the MIT License. See the [License](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhmdd-farhan%2Ftrust-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhmdd-farhan%2Ftrust-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhmdd-farhan%2Ftrust-backend/lists"}