{"id":32588086,"url":"https://github.com/brian-kariu/guard_tower","last_synced_at":"2026-05-07T03:31:21.412Z","repository":{"id":216027381,"uuid":"740279288","full_name":"Brian-Kariu/guard_tower","owner":"Brian-Kariu","description":"A single service to handle all your authentication for your projects","archived":false,"fork":false,"pushed_at":"2024-01-22T19:06:02.000Z","size":4874,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-01-22T23:00:26.812Z","etag":null,"topics":["flask","htmx","python","sqlalchemy","tailwindcss"],"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/Brian-Kariu.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}},"created_at":"2024-01-08T02:29:51.000Z","updated_at":"2024-01-12T05:34:59.000Z","dependencies_parsed_at":"2024-01-22T20:20:18.038Z","dependency_job_id":null,"html_url":"https://github.com/Brian-Kariu/guard_tower","commit_stats":null,"previous_names":["brian-kariu/guard_tower"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Brian-Kariu/guard_tower","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brian-Kariu%2Fguard_tower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brian-Kariu%2Fguard_tower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brian-Kariu%2Fguard_tower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brian-Kariu%2Fguard_tower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Brian-Kariu","download_url":"https://codeload.github.com/Brian-Kariu/guard_tower/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brian-Kariu%2Fguard_tower/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281719940,"owners_count":26549881,"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","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"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":["flask","htmx","python","sqlalchemy","tailwindcss"],"created_at":"2025-10-29T23:54:27.658Z","updated_at":"2025-10-29T23:54:33.893Z","avatar_url":"https://github.com/Brian-Kariu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca\"\u003e\n    \u003cimg src=\"assets/img/padlock.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e\n  \u003c/a\u003e\n\n  \u003ch3 align=\"center\"\u003eAuthserver\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    Never write authentication for your projects again!\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#docker-install\"\u003eDocker Install\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#running-locally\"\u003eRunning Locally\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#dev-containers\"\u003eDev Containers\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#deployment\"\u003eDeployment\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#shell\"\u003eShell\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#running-tests/linter\"\u003eRunning Tests/linter\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#migrations\"\u003eMigrations\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#asset-management\"\u003eAsset Management\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#roadmap\"\u003eRoadmap\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n## About The Project\n\nI got tired writing authentication workflows for my apps and third party solutions didn't work out for me. So i made an authserver for all my apps. Super safe😅.\n\n## Getting started\n\n### Docker Install\n\nThis app can be run completely using `Docker` and `docker-compose`. **Using Docker is recommended, as it guarantees the application is run using compatible versions of Python and Node**.\n\nThere are three main services:\n\nTo run the development version of the app\n\n```bash\ndocker-compose up flask-dev\n```\n\nTo run the production version of the app\n\n```bash\ndocker-compose up flask-prod\n```\n\nThe list of `environment:` variables in the `docker-compose.yml` file takes precedence over any variables specified in `.env`.\n\nTo run any commands using the `Flask CLI`\n\n```bash\ndocker-compose run --rm manage \u003c\u003cCOMMAND\u003e\u003e\n```\n\nTherefore, to initialize a database you would run\n\n```bash\ndocker-compose run --rm manage db init\ndocker-compose run --rm manage db migrate\ndocker-compose run --rm manage db upgrade\n```\n\nA docker volume `node-modules` is created to store NPM packages and is reused across the dev and prod versions of the application. For the purposes of DB testing with `sqlite`, the file `dev.db` is mounted to all containers. This volume mount should be removed from `docker-compose.yml` if a production DB server is used.\n\nGo to `http://localhost:8080`. You will see a pretty welcome screen.\n\n### Running locally\n\nRun the following commands to bootstrap your environment if you are unable to run the application using Docker\n\n```bash\ncd shell_scripts\n./manual_deploy.sh\n```\n\n### Dev Containers\n\nThe best option to get started if you are using vscode however is to use dev containers. Simple open the command pallete and search for `Dev Containers: Open Folder in containers...`. It will start the dev environment with everything set up.\n\nGo to `http://localhost:5000`. You will see a pretty welcome screen.\n\n#### Database Initialization (locally)\n\nOnce you have installed your DBMS, run the following to create your app's\ndatabase tables and perform the initial migration\n\n```bash\nflask db init\nflask db migrate\nflask db upgrade\n```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Deployment\n\nWhen using Docker, reasonable production defaults are set in `docker-compose.yml`\n\n```text\nFLASK_ENV=production\nFLASK_DEBUG=0\n```\n\nTherefore, starting the app in \"production\" mode is as simple as\n\n```bash\ndocker-compose up flask-prod\n```\n\nIf running without Docker\n\n```bash\nexport FLASK_ENV=production\nexport FLASK_DEBUG=0\nexport DATABASE_URL=\"\u003cYOUR DATABASE URL\u003e\"\nnpm run build   # build assets with webpack\nflask run       # start the flask server\n```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Shell\n\nTo open the interactive shell, run\n\n```bash\ndocker-compose run --rm manage shell\nflask shell # If running locally without Docker\n```\n\nBy default, you will have access to the flask `app`.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Running Tests/Linter\n\nTo run all tests, run\n\n```bash\ndocker-compose run --rm manage test\nflask test # If running locally without Docker\n```\n\nTo run the linter, run\n\n```bash\ndocker-compose run --rm manage lint\nflask lint # If running locally without Docker\n```\n\nThe `lint` command will attempt to fix any linting/style errors in the code. If you only want to know if the code will pass CI and do not wish for the linter to make changes, add the `--check` argument.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Migrations\n\nWhenever a database migration needs to be made. Run the following commands\n\n```bash\ndocker-compose run --rm manage db migrate\nflask db migrate # If running locally without Docker\n```\n\nThis will generate a new migration script. Then run\n\n```bash\ndocker-compose run --rm manage db upgrade\nflask db upgrade # If running locally without Docker\n```\n\nTo apply the migration.\n\nFor a full migration command reference, run `docker-compose run --rm manage db --help`.\n\nIf you will deploy your application remotely (e.g on Heroku) you should add the `migrations` folder to version control.\nYou can do this after `flask db migrate` by running the following commands\n\n```bash\ngit add migrations/*\ngit commit -m \"Add migrations\"\n```\n\nMake sure folder `migrations/versions` is not empty.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Asset Management\n\nFiles placed inside the `assets` directory and its subdirectories\n(excluding `js` and `css`) will be copied by webpack's\n`file-loader` into the `static/build` directory. In production, the plugin\n`Flask-Static-Digest` zips the webpack content and tags them with a MD5 hash.\nAs a result, you must use the `static_url_for` function when including static content,\nas it resolves the correct file name, including the MD5 hash.\nFor example\n\n```html\n\u003clink rel=\"shortcut icon\" href=\"{{static_url_for('static', filename='build/favicon.ico') }}\" /\u003e\n```\n\nIf all of your static files are managed this way, then their filenames will change whenever their\ncontents do, and you can ask Flask to tell web browsers that they\nshould cache all your assets forever by including the following line\nin `.env`:\n\n```text\nSEND_FILE_MAX_AGE_DEFAULT=31556926  # one year\n```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Usage\n\nIdeally you should be able to create a super user account, login then start creating user groups for your app. Other\nfeatures would be create,edit and delete permissions for user, social authentication and even admin dashboards.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Roadmap\n\n- [x] Create a working jwt auth flow\n- [ ] Detailed user profile\n- [ ] Create user groups models for the different apps\n- [ ] Create permissions for each of the groups\n- [ ] Admin dashboards\n- [ ] Social Authentication\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## License\n\nDistributed under the MIT License. See `LICENSE.txt` for more information.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrian-kariu%2Fguard_tower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrian-kariu%2Fguard_tower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrian-kariu%2Fguard_tower/lists"}