{"id":32557864,"url":"https://github.com/23prime/23prime-api","last_synced_at":"2026-05-17T02:04:31.144Z","repository":{"id":40322696,"uuid":"412985710","full_name":"23prime/23prime-api","owner":"23prime","description":"Backend Web API for 23prime-page","archived":true,"fork":false,"pushed_at":"2023-03-06T11:35:19.000Z","size":237,"stargazers_count":3,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T23:52:03.912Z","etag":null,"topics":["actix","actix-web","docker","rust","seaorm"],"latest_commit_sha":null,"homepage":"https://github.com/23prime/23prime-page","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/23prime.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-03T05:32:51.000Z","updated_at":"2025-09-19T12:11:34.000Z","dependencies_parsed_at":"2023-02-15T21:15:46.641Z","dependency_job_id":null,"html_url":"https://github.com/23prime/23prime-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/23prime/23prime-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/23prime%2F23prime-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/23prime%2F23prime-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/23prime%2F23prime-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/23prime%2F23prime-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/23prime","download_url":"https://codeload.github.com/23prime/23prime-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/23prime%2F23prime-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33125184,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T18:38:32.183Z","status":"online","status_checked_at":"2026-05-17T02:00:05.366Z","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":["actix","actix-web","docker","rust","seaorm"],"created_at":"2025-10-28T23:51:39.690Z","updated_at":"2026-05-17T02:04:31.104Z","avatar_url":"https://github.com/23prime.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 23prime-api #\n\n[![Rust CI](https://github.com/23prime/23prime-api/actions/workflows/rust-ci.yml/badge.svg)](https://github.com/23prime/23prime-api/actions/workflows/rust-ci.yml)\n\nBackend Web API for [23prime-page](https://github.com/23prime/23prime-page).\n\n## Run ##\n\n### With Docker ###\n\n```console\n$ docker-compose -f docker-compose.local.yml up\n```\n\n### Only DB ###\n\n```console\n$ docker-compose -f docker-compose.local.yml up postgres\n```\n\n### Without Docker ###\n\n```bsh\n$ cargo run\n```\n\n(Recommend) If using [cargo-watch](https://docs.rs/crate/cargo-watch/):\n\n```console\n$ cargo watch -x run\n```\n\n## Test, Lint and Format ##\n\n### Up DB ###\n\nSome tests require DB connection, so you need up and migrate before testing.\n\n```console\n$ docker-compose -f docker-compose.test.yml up -d --wait\n```\n\n### Test ###\n\n```console\n$ export DATABASE_URL=postgres://admin:password@localhost:5442/GKBDB\n$ cargo run --manifest-path ./migration/Cargo.toml up\n$ cargo test --all -- --nocapture --test-threads=1\n```\n\n### Lint ###\n\n```console\n$ cargo fmt --all -- --check\n```\n\n### Format ###\n\n```console\n$ cargo clippy --all-targets --all-features -- -D warnings -A clippy::needless_return\n```\n\n### Check all ###\n\n```console\n$ chmod +x check.sh\n$ ./check.sh\n```\n\n## Build and Deploy ##\n\n```console\n$ aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/m0z8x5y6\n$ docker-compose build\n$ docker push public.ecr.aws/m0z8x5y6/okkey-api:latest\n```\n\n## Environment variables ##\n\nMake `.env` and add some variables. See `.env.template`.\n\n## Migrate by SeaORM ##\n\nSee:\n\n- [Setting Up Migration | SeaORM 🐚 An async \u0026 dynamic ORM for Rust](https://www.sea-ql.org/SeaORM/docs/next/migration/setting-up-migration/)\n- [Writing Migration | SeaORM 🐚 An async \u0026 dynamic ORM for Rust](https://www.sea-ql.org/SeaORM/docs/next/migration/writing-migration/)\n- [Running Migration | SeaORM 🐚 An async \u0026 dynamic ORM for Rust](https://www.sea-ql.org/SeaORM/docs/next/migration/running-migration/)\n- [Seeding Data | SeaORM 🐚 An async \u0026 dynamic ORM for Rust](https://www.sea-ql.org/SeaORM/docs/next/migration/seeding-data/)\n\n### Create ###\n\n```console\n$ cd migration/\n$ target/debug/migration generate \u003cmigration name\u003e\n```\n\n### Run ###\n\nCheck status:\n\n```console\n$ migration/target/debug/migration status\n```\n\nAnd run:\n\n```console\n$ migration/target/debug/migration up\n```\n\n## Development ##\n\n### Install tools ###\n\nIf use only Docker, you need not to install these tools, because there are already installed in `Dockerfile-local`.\n\n```console\n$ rustup component add rustfmt\n$ rustup component add clippy\n$ cargo install cargo-watch cargo-edit\n```\n\n## Authorization ##\n\nAuthorized with [Authorization Code Flow by Auth0](https://auth0.com/docs/login/authentication/add-login-auth-code-flow).\n\nAccess to My URL: \u003chttps://23prime.xyz\u003e\n\nThen, redirect to `/auth/callback` and get access token:\n\n```json\n{\n    id: \"{your id}\",\n    token: \"{access token}\"\n}\n```\n\nYou can send API request with the header `Authorization: Bearer {access_token}`.\n\n## APIs ##\n\n### `/api/index` ###\n\n| Method | Require Auth |\n| :----: | :----------: |\n|   GET  |       o      |\n\n#### `GET` ####\n\n- Response Body\n\n```txt\nHello, Anime API!!\n```\n\n### `/api/echo` ###\n\n| Method | Require Auth |\n| :----: | :----------: |\n|   GET  |       o      |\n|  POST  |       o      |\n\n#### `GET` ####\n\n- Response Body\n\n```txt\n{your request body}\n```\n\n#### `POST` ####\n\n- Response Body\n\n```txt\n{your request body}\n```\n\n### `/api/animes/:year/:season` ###\n\n| Method | Require Auth |\n| :----: | :----------: |\n|   GET  |       o      |\n\n#### `GET` ####\n\n- Params\n\n|   Param  | Kind |   Type  | Required | remarks                        |\n| :------: | :--: | :-----: | :------: | :----------------------------- |\n|  `year`  | path | integer |   false  |                                |\n| `season` | path |  string |   false  | `spring\\|summer\\|fall\\|winter` |\n\n- Response Body\n\n```json\n{\n    \"animes\": [\n        {\n            \"id\": {id},\n            \"year\": {YYYY},\n            \"season\": \"{spring|summer|fall|winter}\",\n            \"day\": \"{Sun|Mon|Tue|Wed|Thu|Fri|Sat}\",\n            \"time\": \"hh:mm\",\n            \"station\": \"{station}\",\n            \"title\": \"{title}\",\n            \"recommend\": {true|false}\n        },\n        // and more...\n    ]\n}\n```\n\n#### `POST` ####\n\n- Params\n\n|    Param    | Kind |   Type  | Required | remarks |\n| :---------: | :--: | :-----: | :------: | :------ |\n|     `id`    | body | integer |   true   |         |\n|    `year`   | body | integer |   true   |         |\n|   `season`  | body |  string |   true   |         |\n|    `day`    | body |  string |   true   |         |\n|    `time`   | body |  string |   true   |         |\n|  `station`  | body |  string |   true   |         |\n|   `title`   | body |  string |   true   |         |\n| `recommend` | body |   bool  |   true   |         |\n\n- Response Body\n\n```json\n{\n    \"animes\": [\n        {\n            \"id\": {id},\n            \"year\": {YYYY},\n            \"season\": \"{spring|summer|fall|winter}\",\n            \"day\": \"{Sun|Mon|Tue|Wed|Thu|Fri|Sat}\",\n            \"time\": \"hh:mm\",\n            \"station\": \"{station}\",\n            \"title\": \"{title}\",\n            \"recommend\": {true|false}\n        },\n        // and more...\n    ]\n}\n```\n\n#### `PUT` ####\n\n- Params\n\n|    Param    | Kind |   Type  | Required | remarks |\n| :---------: | :--: | :-----: | :------: | :------ |\n|     `id`    | body | integer |   true   |         |\n|    `year`   | body | integer |   true   |         |\n|   `season`  | body |  string |   true   |         |\n|    `day`    | body |  string |   true   |         |\n|    `time`   | body |  string |   true   |         |\n|  `station`  | body |  string |   true   |         |\n|   `title`   | body |  string |   true   |         |\n| `recommend` | body |   bool  |   true   |         |\n\n- Response Body\n\n```json\n{\n    \"animes\": [\n        {\n            \"id\": {id},\n            \"year\": {YYYY},\n            \"season\": \"{spring|summer|fall|winter}\",\n            \"day\": \"{Sun|Mon|Tue|Wed|Thu|Fri|Sat}\",\n            \"time\": \"hh:mm\",\n            \"station\": \"{station}\",\n            \"title\": \"{title}\",\n            \"recommend\": {true|false}\n        },\n        // and more...\n    ]\n}\n```\n\n#### `DELETE` ####\n\n- Params\n\n|    Param    | Kind |   Type  | Required | remarks |\n| :---------: | :--: | :-----: | :------: | :------ |\n|     `id`    | body | integer |   true   |         |\n|    `year`   | body | integer |   true   |         |\n|   `season`  | body |  string |   true   |         |\n|    `day`    | body |  string |   true   |         |\n|    `time`   | body |  string |   true   |         |\n|  `station`  | body |  string |   true   |         |\n|   `title`   | body |  string |   true   |         |\n| `recommend` | body |   bool  |   true   |         |\n\n- Response Body\n\n```json\n{\n    \"animes\": [\n        {\n            \"id\": {id},\n            \"year\": {YYYY},\n            \"season\": \"{spring|summer|fall|winter}\",\n            \"day\": \"{Sun|Mon|Tue|Wed|Thu|Fri|Sat}\",\n            \"time\": \"hh:mm\",\n            \"station\": \"{station}\",\n            \"title\": \"{title}\",\n            \"recommend\": {true|false}\n        },\n        // and more...\n    ]\n}\n```\n\n### `/scrape/:season` ###\n\n| Method | Require Auth |\n| :----: | :----------: |\n|   GET  |       o      |\n\n#### `GET` ####\n\n- Params\n\n|   Param  | Kind |  Type  | Required | remarks                        |\n| :------: | :--: | :----: | :------: | :----------------------------- |\n| `season` | path | string |   true   | `spring\\|summer\\|fall\\|winter` |\n\n- Response Body\n\n```json\n{\n    \"animes\": [\n       {\n            \"title\": \"{title}\",\n            \"year\": {current year (YYYY)},\n            \"season\": \"{spring|summer|fall|winter}\",\n            \"wday\": \"{Sun|Mon|Tue|Wed|Thu|Fri|Sat}\",\n            \"time\": \"hh:mm\",\n            \"station\": \"{station}\"\n        },\n        // and more...\n    ]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F23prime%2F23prime-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F23prime%2F23prime-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F23prime%2F23prime-api/lists"}