{"id":17169636,"url":"https://github.com/jb3/swot-backend","last_synced_at":"2025-03-24T19:18:51.644Z","repository":{"id":53742680,"uuid":"222956185","full_name":"jb3/swot-backend","owner":"jb3","description":"Swot","archived":false,"fork":false,"pushed_at":"2023-03-29T15:41:17.000Z","size":1252,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-29T23:41:44.118Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://swot.seph.club/","language":"Python","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/jb3.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},"funding":{"github":"jb3"}},"created_at":"2019-11-20T14:29:24.000Z","updated_at":"2021-03-16T16:41:30.000Z","dependencies_parsed_at":"2024-12-02T09:34:28.639Z","dependency_job_id":"428200e1-336b-4770-995d-4a007a728454","html_url":"https://github.com/jb3/swot-backend","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jb3%2Fswot-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jb3%2Fswot-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jb3%2Fswot-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jb3%2Fswot-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jb3","download_url":"https://codeload.github.com/jb3/swot-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245334908,"owners_count":20598389,"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":[],"created_at":"2024-10-14T23:26:51.323Z","updated_at":"2025-03-24T19:18:51.626Z","avatar_url":"https://github.com/jb3.png","language":"Python","funding_links":["https://github.com/sponsors/jb3"],"categories":[],"sub_categories":[],"readme":"# swot-backend\nBackend API for Swot\n\n## Used technology\n\nAll Python dependencies can be found in requirements.txt.\n\nNotably:\n- Flask - the webserver handling routing\n- Gunicorn - the tool used to manage workers allowing the application to harness concurrent requests\n- SQLAlchemy - The tool used to manage database models and write programmatic queries to the database\n- Alembic - A tool which works in unison with SQLAlchemy to migrate the database to add new changes to models\n\nOn the backend:\n- SaltStack - Used to bootstrap the host and handle auto-deployment of the softare\n- Docker - used to containerise the application allowing for simple deployment\n- NGINX - A web server being used as a reverse proxy to forward requests to the Docker container running NGINX. (Note: NGINX is containerised, but port 80 is being exposed)\n\n## Installation\n\nSwot runs on Python 3.8, the latest version of Python, though in theory should run on earlier versions as well since no 3.8 specific features are used.\n\n### Environment setup\n\nMost dependency management must be done using the command line.\n\n#### Python\nConfirm a working Python installation by running the following in a command prompt windoww.\n\nWindows:\n```batch\npy -3 -V\n```\n\nMacOS/UNIX (varies depending on setup):\n```bash\npython3 -V\n```\n\n#### PIP\nConfirm a working pip installation by running the following.\n\nWindows:\n```batch\npy -3 -m pip -V\n```\n\nA breakdown of this command:\n- `py` call Python\n- `-3` select Python 3\n- `-m` call a Python module\n- `pip` run PIP\n- `-V` ask pip for the version\n\nMacOS/UNIX:\n```bash\npython3 -m pip -V\n```\n\nIf both of these commands return successfully then you can continue to the next stage.\n\nIf one of these commands fails to install then the installation is not ready.\n\nSee the following documents:\n- [Python](https://www.python.org/downloads/release/python-382/)\n- [PIP](https://packaging.python.org/tutorials/installing-packages/#ensure-you-can-run-pip-from-the-command-line)\n\n### Installing dependencies\n\nOpen a terminal and navigate to the code directory.\n\nNext run the following command:\n\nWindows:\n```batch\npy -3 -m pip install -r requirements.txt\n```\n\nMacOS/UNIX:\n```bash\npython3 -m pip install -r requirements.txt\n```\n\nA breakdown of this command:\n- `pip` run the package manager\n- `install` switch to installing packages\n- `-r requirements.txt` install packages listed in requirements.txt\n\nIf no errors are encountered then you should be good to progress to the next stage.\n\n### Configuration\n\nSwot backend is configured through the use of a YAML file.\n\nSwot attempts to look for a file named `config.yaml` so you must copy `config-default.yaml`, make any necessary modifications and save it as `config.yaml`.\n\n### Running Swot\n\nRunning swot is the easiest part of the process.\n\nWindows:\n```batch\npy -3 app.py\n```\n\nMacOS/UNIX:\n```bash\npython3 app.py\n```\n\nIf configured correctly you should see a message about Swot starting up as a webserver.\n\nIt should then be accessible using whatever configuration options you selected.\n\n## Configuration options\n\nA breakdown of all the available config options is as follows:\n\n- `host` - the block for configuration of the webserver\n    - `host` - what IP to listen on\n    - `port` - what port to listen on (note on UNIX ports \u003c 1024 require superuser permissions)\n    - `debug` - Whether to run the webserver in debug mode, recommended for local execution\n    - `migrate_on_startup` - Should database migration occur automatically on startup (recommended for users not planning to develop)\n- `recaptcha` - the block for configuration of Recaptcha anti-spam\n    - `key` - The private site key for recaptcha, set to a jargon string if you do not have one.\n- `flask` - configuration of flask\n    - `SECRET_KEY` - The random string used for signing session cookies in the app\n- `db` - configuration of the database\n    - `use_sqlite` - Ignore all other options and use a SQLite database, recommended for local setups.\n    - `host` - IP address of the database\n    - `port` - port the database is running on\n    - `username` - username for the database\n    - `password` - password for the database\n    - `database` - which postgresql database to use","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjb3%2Fswot-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjb3%2Fswot-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjb3%2Fswot-backend/lists"}