{"id":49577094,"url":"https://github.com/panastasiadis/starwars-api","last_synced_at":"2026-05-03T17:36:33.203Z","repository":{"id":314944014,"uuid":"1055385463","full_name":"panastasiadis/starwars-api","owner":"panastasiadis","description":"A FastAPI-powered asynchronous REST API for exploring Star Wars data. It syncs from SWAPI, stores data in PostgreSQL with SQLModel, manages migrations via Alembic, and runs seamlessly in Docker. Features include typed Pydantic responses, pagination, and full test coverage with pytest.","archived":false,"fork":false,"pushed_at":"2025-09-15T18:43:42.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-15T20:30:30.204Z","etag":null,"topics":["alembic","api","asyncio","backend","docker","fastapi","postgresql","python","restapi","sqlmodel","starwars","swapi"],"latest_commit_sha":null,"homepage":"","language":"Python","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/panastasiadis.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,"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":"2025-09-12T07:33:10.000Z","updated_at":"2025-09-15T18:43:45.000Z","dependencies_parsed_at":"2025-09-16T22:31:09.093Z","dependency_job_id":null,"html_url":"https://github.com/panastasiadis/starwars-api","commit_stats":null,"previous_names":["panastasiadis/starwars-api"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/panastasiadis/starwars-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panastasiadis%2Fstarwars-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panastasiadis%2Fstarwars-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panastasiadis%2Fstarwars-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panastasiadis%2Fstarwars-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/panastasiadis","download_url":"https://codeload.github.com/panastasiadis/starwars-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panastasiadis%2Fstarwars-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32579078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"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":["alembic","api","asyncio","backend","docker","fastapi","postgresql","python","restapi","sqlmodel","starwars","swapi"],"created_at":"2026-05-03T17:36:32.293Z","updated_at":"2026-05-03T17:36:33.195Z","avatar_url":"https://github.com/panastasiadis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StarWars API\n\nA FastAPI-based asynchronous REST API for Star Wars data, featuring films, characters, and starships. Data is synchronized from the public API  **https://swapi.info** and stored in a PostgreSQL database. The project uses SQLModel ORM, Alembic for migrations, and is containerized with Docker.\n\n## Features\n\n- **Async FastAPI** backend\n- **PostgreSQL** database (via Docker)\n- **SQLModel** ORM\n- **Alembic** migrations\n- **SWAPI sync** endpoint\n- **Paginated endpoints** for films, characters, starships\n- **Typed responses** with Pydantic schemas\n- **Unit tests** with pytest and httpx\n\n## Setup\n\n### 1. Clone the repository\n\n```sh\ngit clone https://github.com/yourusername/starwars-api.git\ncd starwars-api\n```\n\n### 2. Configure environment variables\n\nCopy `.env.example` to `.env` and fill in your database credentials:\n\n```sh\ncp .env.example .env\n# Edit .env with your settings (see example below)\n```\n\nExample `.env`:\n\n```\nPOSTGRES_USER=postgres\nPOSTGRES_PASSWORD=postgres\nPOSTGRES_DB=starwars_db\n```\n\n### 3. Build and start with Docker Compose\n\n```sh\ndocker compose up --build\n```\n\nThis will start both the PostgreSQL database and the FastAPI app.\n\n### 4. Apply database migrations\n\nOpen a shell in the API container:\n\n```sh\ndocker compose exec srv-starwars-api bash\n```\n\nRun Alembic migrations:\n\n```sh\nuv run alembic upgrade head\n```\n\n### 5. Sync Star Wars data\n\nUse the `/api/sync` endpoint to fetch and store SWAPI data:\n\n```sh\ncurl -X POST http://localhost:8000/api/sync\n```\n\n## Usage\n\n- API docs: [http://localhost:8000/docs](http://localhost:8000/docs)\n- Example endpoints:\n  - `GET /api/films`\n  - `GET /api/characters`\n  - `GET /api/starships`\n  - `POST /api/sync`\n\n## Running Tests\n\nTests are located in `starwars-api-app/app/tests/`.\n\nTo run all tests:\n\n```sh\ndocker compose exec srv-starwars-api bash\nuv run pytest --cov=app\n```\n\n##  Test Coverage Report\n\n\u003cimg width=\"425\" height=\"524\" alt=\"image\" src=\"https://github.com/user-attachments/assets/69351917-f5d6-46ae-90a3-43d2dc901789\" /\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanastasiadis%2Fstarwars-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanastasiadis%2Fstarwars-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanastasiadis%2Fstarwars-api/lists"}