{"id":20030097,"url":"https://github.com/just1not2/electorz-backend","last_synced_at":"2026-05-13T09:36:25.788Z","repository":{"id":216241101,"uuid":"499256932","full_name":"just1not2/electorz-backend","owner":"just1not2","description":"Backend of the ElectorZ political game, written in FastAPI","archived":false,"fork":false,"pushed_at":"2022-06-02T19:34:49.000Z","size":520,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T17:46:14.387Z","etag":null,"topics":["fastapi","game","politics"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/just1not2.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-06-02T19:02:50.000Z","updated_at":"2022-06-02T19:07:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"cb6b251f-13a6-4108-b81c-b30c776f134e","html_url":"https://github.com/just1not2/electorz-backend","commit_stats":null,"previous_names":["just1not2/electorz-backend"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just1not2%2Felectorz-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just1not2%2Felectorz-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just1not2%2Felectorz-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just1not2%2Felectorz-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/just1not2","download_url":"https://codeload.github.com/just1not2/electorz-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241460204,"owners_count":19966519,"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":["fastapi","game","politics"],"created_at":"2024-11-13T09:24:38.675Z","updated_at":"2026-05-13T09:36:25.761Z","avatar_url":"https://github.com/just1not2.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ElectorZ - Backend\n\nElectorZ is a political game based on geographical strategies.\n\nThis repository hosts the backend of the ElectorZ web application, written in [FastAPI](https://fastapi.tiangolo.com). The code of the frontend is available in the [Electorz Frontend repository](https://github.com/just1not2/electorz-frontend).\n\n## Configuration\n\nThe entire project configuration is defined in an environment file, of which [a template](./.env.template) is present in the repository. To bootstrap the configuration, launch the following command:\n\n```bash\nmake .env\n```\n\nYou may then modify the following environment variables to configure the ElectorZ backend:\n* `APP_HOST`: IP address on which the server listens\n* `APP_PORT`: port on which the server listens\n* `FRONTEND_URL`: URL of the frontend (to enable CORS)\n* `MONGO_HOST`: host of the MongoDB instance\n* `MONGO_PORT`: port on which the MongoDB instance listens\n* `MONGO_DB_NAME`: name of the MongoDB database\n* `MONGO_USERNAME`: name of the MongoDB user\n* `MONGO_PASSWORD`: password of the MongoDB user\n* `MONGO_TLS`: boolean that indicates if TLS must be enabled to connect to the MongoDB instance\n* `MONGO_MAX_CONNECTIONS`: maximum number of connections to the MongoDB instance\n* `MONGO_MIN_CONNECTIONS`: minimum number of connections to the MongoDB instance\n\n\n## Installation\n\nYou can install the `pip` requirements by launching the following command:\n\n```bash\nmake install\n```\n\n### MongoDB instance\n\nIf you do not have a MongoDB instance available for the ElectorZ application, you can launch a dockerized version of MongoDB by launching the following command:\n\n```bash\nmake stack\n```\n\nIt will automatically provision the database with the JSON files present in the [db-init directory](./db-init/).\n\nNote that a `mongo-express` image has been added to the [docker-compose file](./docker-compose.yml) to help you manage the database: it provides a web administration tool available at http://localhost:8081.\n\n\n## Launching the application\n\nOnce a MongoDB database is available with the configuration options provided in the environment file, the ElectorZ backend application may be launched with the following command:\n\n```bash\nmake start\n```\n\n\n## Documentation\n\nFastAPI provides automatic documentations thanks to the [Swagger \u0026 Redoc modules](https://fastapi.tiangolo.com/tutorial/metadata/): you can for instance visit http://localhost:8080/docs to get all information about the API and test the routes.\n\n\n## See Also\n\n* [FastAPI official documentation](https://fastapi.tiangolo.com)\n* [PyMongo documentation](https://pymongo.readthedocs.io/en/stable/)\n\n\n## Contributing to this application\n\nThis application started as personal project, but I welcome community contributions to it. If you find problems, please open an issue or create a PR against the [ElectorZ Backend repository](https://github.com/just1not2/electorz-backend).\n\nYou can also reach me by email at `me@just1not2.org`.\n\n\n## Licensing\n\nMozilla Public License Version 2.0.\n\nSee [LICENSE](./LICENSE) to see the full text.\n\n\n## Author Information\n\nThis application was created in 2022 by Justin Béra.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjust1not2%2Felectorz-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjust1not2%2Felectorz-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjust1not2%2Felectorz-backend/lists"}