{"id":17967271,"url":"https://github.com/supotsu-no-ochaya/backend","last_synced_at":"2026-02-09T06:34:52.232Z","repository":{"id":260062471,"uuid":"879954457","full_name":"supotsu-no-ochaya/backend","owner":"supotsu-no-ochaya","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-29T15:01:39.000Z","size":3137,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T13:52:45.548Z","etag":null,"topics":["backend","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","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/supotsu-no-ochaya.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-28T21:07:51.000Z","updated_at":"2025-01-29T15:01:43.000Z","dependencies_parsed_at":"2024-11-22T17:18:17.147Z","dependency_job_id":"53653abf-1e71-4e2b-a10b-caed855d2a0a","html_url":"https://github.com/supotsu-no-ochaya/backend","commit_stats":{"total_commits":5,"total_committers":3,"mean_commits":"1.6666666666666667","dds":0.4,"last_synced_commit":"7281454e1b57b87856fc778a62fe608a8242f846"},"previous_names":["supotsu-no-ochaya/backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/supotsu-no-ochaya/backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supotsu-no-ochaya%2Fbackend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supotsu-no-ochaya%2Fbackend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supotsu-no-ochaya%2Fbackend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supotsu-no-ochaya%2Fbackend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/supotsu-no-ochaya","download_url":"https://codeload.github.com/supotsu-no-ochaya/backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supotsu-no-ochaya%2Fbackend/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267213498,"owners_count":24053912,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"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":["backend","golang"],"created_at":"2024-10-29T14:05:02.429Z","updated_at":"2026-02-09T06:34:49.474Z","avatar_url":"https://github.com/supotsu-no-ochaya.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backend\n\nThis is a backend service built using PocketBase and Echo.\n\n---\n\n## Run the backend\nRequirements: \n* Docker\n\n### Run with testdata\nTo run the docker container with testdata you need to run the ```docker-compose.yml``` \nand need to have the ```pb_data``` testdata folder. This folder will be mounted into the container to supply it with the testdata.\nTo download the testdata run the ```download-testdata.sh``` script by supplying the latest testdatat version e.g.: \n```shell\n./download-testdata.sh v2\n```\nYou can now run the docker container. \n```shell\ndocker compose up -d\n```\n\n### Run without testdata\nTo run the docker container without testdata simply run the ```docker-compose.prod.yml```.\nThe ```docker-compose.prod.yml``` serves as an example configuration.\nFor security you should provide your own credentials as environment variables e.g. via an env file.\n\n```shell\ndocker compose -f docker-compose.prod.yml up -d\n```\n---\nThe server will be running and accessible at [http://localhost:8090](http://localhost:8090).\n- REST API: [http://127.0.0.1:8090/api/](http://127.0.0.1:8090/api/)\n- Admin UI: [http://127.0.0.1:8090/_/](http://127.0.0.1:8090/_/)\n\n---\n\n## Contribute\n1. Clone the repository.\n2. Make sure Go is installed on your machine.\n3. Use the following commands to start the backend:\n\n   - **For Development (run from source code)**:\n     - Ensure the **`download-testdata.sh`** script has been executed if there is no test data yet. This script writes the test data into the current working directory in a folder named `pb_data`, which both the binary and Docker Compose setup expect to be present.\n       ```sh\n       ./download-testdata.sh v1  \n       ```\n       ```sh\n       go run cmd/app/main.go --dev serve\n       ```\n\n   - **For Development (run via docker compose)**:\n     - Ensure the **`download-testdata.sh`** script has been executed if there is no test data yet. This script writes the test data into the current working directory in a folder named `pb_data`, which both the binary and Docker Compose setup expect to be present.\n       ```sh\n       ./download-testdata.sh v1  \n       ```\n       ```sh\n       docker compose up -d\n       ```\n4. In case you need to build the docker image localy run:\n      ```sh\n   make docker-local\n      ```\n   The docker image will be named ```supotsu-backend:local```\n---\n## Release\n\nReleases of the docker image happens automatically via the ```container-release``` workflow in github actions. The pipeline runs automatically on every new commit on main. So on every direct push, merge or rebase etc..\n\n---\n\n## API Endpoint\n\n### `/api/test`\nFetches all user records from the database.\n- **Method**: `GET`\n- **Response**:\n    - `200 OK` with a JSON array of user records.\n    - `500 Internal Server Error` if unable to fetch users.\n- **Example**:\n    ```sh\n    curl -X GET http://localhost:8090/api/test\n    ```\n\n### `/api/export-json`\nExports product and event data within a specified datetime range as a JSON file.\n- **Method**: `GET`\n- **Query Parameters**:\n    - `start`: (required): Start datetime in RFC3339 format.\n    - `end`: (required): End datetime in RFC3339 format.\n- **Response**:\n    - `200 OK` with a downloadable JSON file containing the export data.\n    - `400 Bad Request` if query parameters are missing or invalid.\n    - `500 Internal Server Error` if an error occurs during data fetching or processing.\n- **Example**:\n    ```sh\n    curl -o export.json \"http://localhost:8090/api/export-json?start=2023-01-01T00:00:00Z\u0026end=2023-12-31T23:59:59Z\"\n    ```\n- **Note**:\n    - The exported JSON includes products enriched with attributes, categories, and station details.\n    - Events are filtered based on the `created` timestamp within the provided datetime range.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupotsu-no-ochaya%2Fbackend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsupotsu-no-ochaya%2Fbackend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupotsu-no-ochaya%2Fbackend/lists"}