{"id":22034897,"url":"https://github.com/kumkee/jwtelm","last_synced_at":"2026-05-05T04:39:15.667Z","repository":{"id":185729000,"uuid":"603250335","full_name":"kumkee/jwtelm","owner":"kumkee","description":"Full-stack jwt user authorization with fastapi (backend) and elm (frontend)","archived":false,"fork":false,"pushed_at":"2023-03-08T00:19:02.000Z","size":229,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-17T14:53:44.897Z","etag":null,"topics":["authentication","deta","elm","fastapi","jwt"],"latest_commit_sha":null,"homepage":"https://kumkee.github.io/jwtelm/","language":"Elm","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/kumkee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-02-18T00:07:01.000Z","updated_at":"2023-03-07T07:31:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"0d55c3a6-1292-44ea-870e-6414d8085a4d","html_url":"https://github.com/kumkee/jwtelm","commit_stats":null,"previous_names":["kumkee/jwtelm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kumkee/jwtelm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kumkee%2Fjwtelm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kumkee%2Fjwtelm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kumkee%2Fjwtelm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kumkee%2Fjwtelm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kumkee","download_url":"https://codeload.github.com/kumkee/jwtelm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kumkee%2Fjwtelm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32636096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"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":["authentication","deta","elm","fastapi","jwt"],"created_at":"2024-11-30T10:14:27.340Z","updated_at":"2026-05-05T04:39:15.652Z","avatar_url":"https://github.com/kumkee.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jwtelm\n\n## TL;DR\n\nDemo live page: https://kumkee.github.io/jwtelm/\n\nPlease remember to modify `backend/secrect_strs.py` and `origins` in `backend/main.py` for your own project.\n\n## Overview\n\n`jwtelm` is an example code for user authentication and authorization using JWT (JSON Web Tokens). The backend is built with FastAPI, a modern web framework for building APIs with Python. The frontend is built with Elm, a functional programming language that compiles to JavaScript with no runtime errors.\n\n## Features\n\n- User login\n- [JWT](https://jwt.io/)-based authentication and authorization\n- Frontend built with [Elm](https://elm-lang.org/)\n- Backend built with [FastAPI](https://fastapi.tiangolo.com/) (backend code is based on [this tutorial](https://fastapi.tiangolo.com/tutorial/security/oauth2-jwt/))\n\n## Getting started\n\nTo experiment with `jwtelm`, clone this repository to your local machine:\n\n```git clone https://github.com/kumkee/jwtelm.git```\n\n\n### Backend\n\n1. Navigate to the `backend/` directory.\n2. Create a new virtual environment with Python 3.9 and activate it.\n3. Install the required packages with `pip install -r requirements.txt`.\n4. Add your frontend url(s) to the CORS [`origins` list](https://github.com/kumkee/jwtelm/blob/741ddf62b288c2510e30fecc3f4649a2084353be/backend/main.py#L39) in `backend/main.py`. \n5. Add a file named `secrect_strs.py` in the `backend` directory with your own secret keys. For example:\n\n```\n\"\"\"Secrets are kept here.\"\"\"\nJWT_KEY = 'my_secret_key'\n\nNONCE_PEPPER = 'my_nonce_pepper'\n```\n   - The content of `backen/secrect_strs.py` in the live demo is\n```\n\"\"\"Secrects are kept here.\"\"\"\nJWT_KEY = 'c1d1f32fbb59638db394c06566f84dd645fb4dd0fbe171bdcfa458651b0be47e'\n\nNONCE_PEPPER = 'qc4L1PeK2suXpHt9UyjfTJhOfFrjmvvjhdmAaFJ2cd6Vvnyw3iwOOkw='\n```\n\n\n  - Note that this need to be changed for your own project.\n\n6. Run the backend server with `uvicorn main:app --port 8001`.\n\n  - The backend server should now be running at `http://localhost:8001`.\n\n### Frontend\n\n1. Navigate to the `frontend/` directory.\n2. Change [`baseUrl`](https://github.com/kumkee/jwtelm/blob/main/frontend/src/Main.elm#L24) in `frontend/src/Main.elm` to your backend url.\n2. Build the Elm app for production by running `make`.\n3. Serve the compiled Elm app by running `python -m http.server 8000` or any other HTTP server in `frontend/build/.\n4. Alternatively, you can run `elm reactor` under `frontend/` to see the result of the code instantly.\n\n- Note that `make` is for production and `elm reactor` is for reviewing.\n\n- The frontend should now be accessible at `http://localhost:8000`.\n\n\n## Demo\n\nYou can try out a live demo of `jwtelm` at https://kumkee.github.io/jwtelm/. The backend of the live demo is hosted on [Deta Space](https://deta.space/). Login credentials for the demo are\n1. `johndoe` with password \"secret\" or\n2. `kumkee` with password \"0123456789\" \n\n## Contributing\n\nIf you want to contribute to `jwtelm`, you're welcome to submit a pull request. Please make sure to follow the [code of conduct](CODE_OF_CONDUCT.md) and the [contribution guidelines](CONTRIBUTING.md).\n\n## License\n\n`jwtelm` is licensed under the MIT license. See [LICENSE](LICENSE) for more information.\n\n\n---\n\nREADME generated with the assistance of [ChatGPT](https://github.com/Chandrahas-Tripathi/ChatGPT), a language model developed by OpenAI.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkumkee%2Fjwtelm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkumkee%2Fjwtelm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkumkee%2Fjwtelm/lists"}