{"id":21140352,"url":"https://github.com/splorg/hagakure-api","last_synced_at":"2025-08-01T13:34:02.605Z","repository":{"id":225445023,"uuid":"763824344","full_name":"splorg/hagakure-api","owner":"splorg","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-13T03:04:31.000Z","size":164,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T06:45:16.444Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/splorg.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}},"created_at":"2024-02-27T01:27:24.000Z","updated_at":"2024-03-02T04:41:35.000Z","dependencies_parsed_at":"2024-03-13T04:25:01.132Z","dependency_job_id":"4dc85fe0-4b7d-4a9e-92d3-2c564aed1e87","html_url":"https://github.com/splorg/hagakure-api","commit_stats":null,"previous_names":["splorg/hagakure-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splorg%2Fhagakure-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splorg%2Fhagakure-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splorg%2Fhagakure-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splorg%2Fhagakure-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/splorg","download_url":"https://codeload.github.com/splorg/hagakure-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243581092,"owners_count":20314167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-20T07:14:46.582Z","updated_at":"2025-03-14T13:12:38.293Z","avatar_url":"https://github.com/splorg.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# REST API for Hagakure\n\nThis is the backend for Hagakure, a project in development.\n\n## Installation\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003eClick to expand\u003c/b\u003e\u003c/summary\u003e\n\n  \u003cbr\u003e\n\n  **Runtime and dependencies**\n\n  This project currently runs on the Bun 1.0.29 runtime. If you don't have it installed, I advise you just [install the latest version](https://bun.sh/) and it should work.\n\n  With Bun installed, run the following command to install the project's dependencies:\n  ```bash\n  bun install\n  ```\n  **Database**\n\n  This project requires a Postgres database.  If you have [Docker](https://www.docker.com/) installed, you can use the provided `docker-compose.yml` file to start and stop a DB container by running these commands:\n  ```bash\n  bun run db:up\n\n  bun run db:stop\n  ```\n  To completely remove the container, you can run the following command:\n\n  ```bash\n  bun run db:down\n  ```\n\n  **Environment variables**\n\n  With a Postgres database running, copy the contents of `.env.template` to a new file called `.env` and fill in the environment variables with your database connection string and the desired port you want to run the application on.\n\n  Then run the Drizzle commands to initialize the database schema.\n\n  ```bash\n  bun run db:generate\n\n  bun run db:migrate\n  ```\n\n  Remember to run migrations after making changes to the database schema:\n\n  ```bash\n  bun run db:migrate\n  ```\n\n  Always commit the new migration files generated in `./drizzle`!\n\n  **Setup complete and additional scripts**\n\n  With these steps done, you're ready to start the development server:\n  ```bash\n  bun run dev\n  ```\n  Happy coding!\n\n  **Additional scripts you should be aware of (WIP):**\n\n  ```bash\n  # lint and format the project with Biome\n  bun run lint:fix\n\n  ...\n  ```\n\u003c/details\u003e\n\n## Architecture\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003eClick to expand\u003c/b\u003e\u003c/summary\u003e\n\n  \u003cbr\u003e\n\n  This project implements a few concepts from Clean Architecture (or at least attempts to), represented through this image:\n\n  \u003cp align=\"center\"\u003e\n    \u003cimg src=\"./docs/ca-diagram.png\" width=\"400\"\u003e\n  \u003c/p\u003e\n\n  \u003cbr\u003e\n\n  The core of the application are it's domain entities, use cases and business logic. They must not have have any external dependencies. The Domain layer is where application entities and data structures are contained and can be found at `src/core/domain`. The Application layer has business logic that implements the use cases of the system - located in `src/core/application`.\n\n  Outside of this core, the application has an Infrastructure layer, where external dependencies like databases and HTTP servers can be interacted with, and a Presentation layer, where the application can be interacted with - in this case, defining controller classes that handle HTTP requests and responses and invoke the correct use cases.\n\n  As a rule, each layer cannot have dependencies from an outermost layer - instead relying on interfaces and the Dependency Inversion principle.\n\n\u003c/details\u003e\n\n## Tech stack\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003eClick to expand\u003c/b\u003e\u003c/summary\u003e\n\n  \u003cbr\u003e\n\n  This application is built using:\n  - [Bun](https://bun.sh/) (runtime)\n  - [ElysiaJS](https://elysiajs.com/) (API framework)\n  - [Drizzle](https://orm.drizzle.team/) (ORM)\n  - [TypeScript](https://www.typescriptlang.org/) (type-checking)\n  - [Docker](https://www.docker.com/) (database containers in development environment)\n\u003c/details\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsplorg%2Fhagakure-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsplorg%2Fhagakure-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsplorg%2Fhagakure-api/lists"}