{"id":19151204,"url":"https://github.com/hendrapaiton/mandalika","last_synced_at":"2026-01-04T08:43:57.075Z","repository":{"id":39827843,"uuid":"241153054","full_name":"hendrapaiton/mandalika","owner":"hendrapaiton","description":"Python Flask Restful JWT Authentication with MongoDB","archived":false,"fork":false,"pushed_at":"2022-05-25T05:12:10.000Z","size":26,"stargazers_count":2,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T14:22:20.411Z","etag":null,"topics":["flask","flask-jwt-extended","flask-restful","jwt","mongodb","python","unittest"],"latest_commit_sha":null,"homepage":null,"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/hendrapaiton.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}},"created_at":"2020-02-17T16:20:54.000Z","updated_at":"2023-05-25T09:29:20.000Z","dependencies_parsed_at":"2022-08-27T19:22:21.116Z","dependency_job_id":null,"html_url":"https://github.com/hendrapaiton/mandalika","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hendrapaiton/mandalika","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hendrapaiton%2Fmandalika","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hendrapaiton%2Fmandalika/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hendrapaiton%2Fmandalika/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hendrapaiton%2Fmandalika/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hendrapaiton","download_url":"https://codeload.github.com/hendrapaiton/mandalika/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hendrapaiton%2Fmandalika/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274232032,"owners_count":25245855,"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-09-08T02:00:09.813Z","response_time":121,"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","flask-jwt-extended","flask-restful","jwt","mongodb","python","unittest"],"created_at":"2024-11-09T08:14:06.868Z","updated_at":"2026-01-04T08:43:57.031Z","avatar_url":"https://github.com/hendrapaiton.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MANDALIKA\n\nPython Flask Restful JWT Authentication with MongoDB\n\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your local machine for development \nand testing purposes.\n\n### Prerequisites\nBefore you can run this project you need a install python first on your operating system.\nYou can download python [here](https://www.python.org/downloads/) and choose according to your operating system.\nn addition you also need a MongoDB NoSQL database and you can download \n[here](https://www.mongodb.com/download-center/community).\n\n### Installing\n\nFirst, clone this project from github using git command or git gui application like [fork](https://git-fork.com/).\n```\n$ git clone https://github.com/hendrapaiton/mandalika.git\n```\n\nMaking environment for project to isolation python installing libraries for this project only.\n```\n$ pip install virtualenv\n$ virtualenv venv\n$ source venv/bin/activate\n```\n\nInstalling all libraries needed by this project using [pip](https://pypi.org/project/pip/).\n```\n$ pip install -r requirements.txt\n```\n\nMake a configuration file with name *.env* with this configuration (_change as desired_).\n```\nMONGODB_SETTINGS = { 'host': 'mongodb://localhost/mandalika' }\nJWT_SECRET_KEY = 'senggigibeach'\n```\n\nSetting the environment for this project.\n```\n$ export FLASK_APP=app.py\n$ export ENV_FILE_LOCATION=./.env\n``` \n\nRunning the project.\n```\nflask run\n```\n\n### Testing\n\nTo test crud api endpoint that has been created you can use **curl** utility. Before test, you must login\nfirst to get jwt token and using it in every request header you sent.\n```\n$ curl -X POST localhost:5000/api/v1/login -d '{\"username\":\"admin@nj.net\", \"password\":\"enje123\"}' -H \"Content-Type: application/json\"\n``` \n\nCREATE API ENDPOINT\n```\n$ curl -X POST localhost:5000/api/v1/user -d '{\"username\":\"user1@nj.net\", \"password\":\"user1\"}' -H \"Content-Type: application/json\" -H \"Authorization: Bearer ${TOKEN}\"\n```\n\nREAD API ENDPOINT\n```\n$ curl localhost:5000/api/v1/ -H \"Content-Type: application/json\" -H \"Authorization: Bearer ${TOKEN}\"\n```\n\nUPDATE API ENDPOINT\n```\n$ curl -X PUT localhost:5000/api/v1/user/\u003cid\u003e -d '{\"username\":\"user01@nj.net\", \"password\":\"user01\"}' -H \"Content-Type: application/json\" -H \"Authorization: Bearer ${TOKEN}\"\n```\n\nDELETE API ENDPOINT\n```\n$ curl -X DELETE localhost:5000/api/v1/user/\u003cid\u003e -H \"Content-Type: application/json\" -H \"Authorization: Bearer ${TOKEN}\"\n```\n\n1. Change *${TOKEN}* with token generated by jwt when we login\n2. Change *\u003cid\u003e* with User ID you want to update/delete (you can get id from READ API ENDPOINT)\n\n\n## Authors\n\n**Hendra Dwi Saputra** - *Initial work* - [hendrapaiton](https://github.com/hendrapaiton)\n\nSee also the list of [contributors](https://github.com/your/project/contributors) who participated in this project.\n\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n\n## Acknowledgments\n\n1. My inspiration and More Tutorials [here](https://dev.to/paurakhsharma/flask-rest-api-part-0-setup-basic-crud-api-4650).\nThanks to [Paurakh Sharma Humagain](https://dev.to/paurakhsharma) for great explanations.\n2. Flask JWT Extended [Documentation](https://flask-jwt-extended.readthedocs.io/en/stable/tokens_from_complex_object/)\nfor _Role-Based Access Control_ (RBAC)\n3. Flask Mongo Engine [Documentation](http://docs.mongoengine.org/projects/flask-mongoengine/en/latest/),\nspecially for _supported fields_.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhendrapaiton%2Fmandalika","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhendrapaiton%2Fmandalika","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhendrapaiton%2Fmandalika/lists"}