{"id":16108106,"url":"https://github.com/kabanosk/hackathon-starter","last_synced_at":"2025-07-14T19:42:05.836Z","repository":{"id":238834114,"uuid":"797375194","full_name":"Kabanosk/hackathon-starter","owner":"Kabanosk","description":"Starter for hackathons containing a Dockerized FastAPI backend using docker-compose and integrated tests in GitHub Workflows","archived":false,"fork":false,"pushed_at":"2025-06-09T14:51:24.000Z","size":146,"stargazers_count":5,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-23T05:11:29.573Z","etag":null,"topics":["actions","docker-compose","fastapi","hackathon","hackathon-starter"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Kabanosk.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}},"created_at":"2024-05-07T17:52:19.000Z","updated_at":"2025-06-10T19:46:11.000Z","dependencies_parsed_at":"2024-05-08T12:28:09.056Z","dependency_job_id":"f7eed9ca-de94-4259-a8aa-cdfba47e8e06","html_url":"https://github.com/Kabanosk/hackathon-starter","commit_stats":null,"previous_names":["kabanosk/hackathon-starter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Kabanosk/hackathon-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kabanosk%2Fhackathon-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kabanosk%2Fhackathon-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kabanosk%2Fhackathon-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kabanosk%2Fhackathon-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kabanosk","download_url":"https://codeload.github.com/Kabanosk/hackathon-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kabanosk%2Fhackathon-starter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265336610,"owners_count":23749193,"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":["actions","docker-compose","fastapi","hackathon","hackathon-starter"],"created_at":"2024-10-09T19:25:24.153Z","updated_at":"2025-07-14T19:42:05.825Z","avatar_url":"https://github.com/Kabanosk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hackathon Starter\n\nA simple Python project to get you started with web development and testing using Docker and GitHub Actions.\n\n## Prerequisites\n\n- Python 3.9\n- Docker\n- Docker Compose\n- Poetry\n\n## Overview\n- [Getting started](#getting-started)\n    - [Clone the repository](#clone-the-repository)\n    - [Basic env](#ask-for-the-env-file-to-the-project-owner-or-use-postgres-default-values-in-the-env-file)\n- [Setup](#setup)\n    - [Virtual environment](#create-a-virtual-environment-and-install-the-dependencies)\n    - [Docker setup](#build-the-docker-image-and-run-the-containers)\n    - [Testing](#testing)\n    - [Stopping containers](#stop-the-containers)\n- [Database](#database)\n    - [Database changes](#creating-or-updating-tables-in-database)\n    - [Migrations](#creating-migrations)\n- [Linting](#linting)\n- [Github actions](#github-actions)\n- [License](#license)\n\n## Getting Started\n#### Clone the repository\n\n```bash\ngit clone https://github.com/yourusername/hackathon-starter.git\ncd hackathon-starter\n```\n\n#### Ask for the `.env` file to the project owner, or use postgres default values in the `.env` file:\n\n```bash\nDB_USER=postgres\nDB_PASS=postgres\nDB_HOST=db\nDB_NAME=postgres\nDB_PORT=5432\nPOSTGRES_PASSWORD=postgres\n```\n### Setup\n#### Create a virtual environment and install the dependencies\n\n```bash\npoetry shell\n```\n\n#### Build the Docker image and run the containers\n\n```bash\ndocker compose --env-file .env up --build\n```\n\n#### Testing\n```bash\npytest test/test_api.py  # to test the API\ndocker exec hackathon-starter-web-1 poetry run pytest tests/test_database.py  # to test the database inside the container\n```\n\nOr run all tests with `docker exec -it hackathon-starter-web-1 pytest\n`\n\n#### Stop the containers\n\n```bash\ndocker compose down\n```\n### Database\n#### Creating or updating tables in database\nTo create new table in database just create needed class in `src/model/tables.py` similar to `Example` class. \\\nIf you want to change table, just look for your table in `src/model/tables.py` and do needed changes. \\\nAfter creating or updating tables create new migration.\n\n#### Creating migrations\nTo create new migration simply run\n```\nalembic revision --autogenerate -m \"example comment\"\nalembic upgrade head\n```\n\n#### Linting\nWe are using following tools:\n* black - to run use `make black`\n* isort - to run use `make isort`\n* pylint - to run use `make pylint`\n\nIf you want to lint every file using all at once you can also run `make lint`\n\nBeside that you can also use pre-commit.\n```\npre-commit install\npre-commit run --all-files\n```\n\n#### GitHub Actions\nThis project uses GitHub Actions for CI.\nThe workflow is defined in `.github/workflows/main.yml`.\nIt sets up a Python environment, installs the dependencies, runs Docker Compose, and runs the tests.\nThe workflow is triggered on every push to the `main` branch.\n\nTo use GitHub Actions in your repository, you need to add secrets to your repository settings:\n- `DB_HOST`\n- `DB_USER`\n- `DB_PASS`\n- `DB_NAME`\n\n## License\nThis project is licensed under the terms of the MIT license. See the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkabanosk%2Fhackathon-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkabanosk%2Fhackathon-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkabanosk%2Fhackathon-starter/lists"}