{"id":19263929,"url":"https://github.com/benjaminlukeclark/monsternames-api","last_synced_at":"2025-04-21T18:31:52.044Z","repository":{"id":53645573,"uuid":"238089282","full_name":"benjaminlukeclark/monsternames-api","owner":"benjaminlukeclark","description":"API hosted at https://monsternames-api.com/","archived":true,"fork":false,"pushed_at":"2024-12-03T19:29:34.000Z","size":371,"stargazers_count":1,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-23T19:14:22.612Z","etag":null,"topics":["css","flask","flask-api","flask-application","flask-backend","flask-restful","flask-web","html","js","json","json-api","peewee","peewee-orm","python","rest-api"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/benjaminlukeclark.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}},"created_at":"2020-02-04T00:16:39.000Z","updated_at":"2024-12-03T19:29:51.000Z","dependencies_parsed_at":"2024-11-09T19:55:33.189Z","dependency_job_id":null,"html_url":"https://github.com/benjaminlukeclark/monsternames-api","commit_stats":null,"previous_names":["benjaminlukeclark/monsternames-api"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminlukeclark%2Fmonsternames-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminlukeclark%2Fmonsternames-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminlukeclark%2Fmonsternames-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminlukeclark%2Fmonsternames-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benjaminlukeclark","download_url":"https://codeload.github.com/benjaminlukeclark/monsternames-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250111048,"owners_count":21376578,"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":["css","flask","flask-api","flask-application","flask-backend","flask-restful","flask-web","html","js","json","json-api","peewee","peewee-orm","python","rest-api"],"created_at":"2024-11-09T19:37:37.300Z","updated_at":"2025-04-21T18:31:52.036Z","avatar_url":"https://github.com/benjaminlukeclark.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e :warning: **ARCHIVED**: This has been migrated to [sudoblark.monsternames.api](https://github.com/sudoblark/sudoblark.monsternames.api)\n\n\u003cdiv id=\"top\"\u003e\u003c/div\u003e\n\n\n\n\u003c!-- PROJECT SHIELDS --\u003e\n[![Sudoblark](https://circleci.com/gh/Sudoblark/monsternames-api.svg?style=shield)](https://app.circleci.com/pipelines/github/Sudoblark/monsternames-api)\n[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)\n[![GitHub license](https://img.shields.io/github/license/Naereen/StrapDown.js.svg)](https://github.com/Naereen/StrapDown.js/blob/master/LICENSE)\n[![Open Source? Yes!](https://badgen.net/badge/Open%20Source%20%3F/Yes%21/blue?icon=github)](https://github.com/Naereen/badges/)\n\n\n\n\n\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Sudoblark/monsternames-api\"\u003e\n    \u003cimg src=\"images/logo.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e\n  \u003c/a\u003e\n\n  \u003ch3 align=\"center\"\u003emonsternames-api\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    Pseudo-random monster name generate\n    \u003cbr /\u003e\n    \u003ca href=\"https://monsternames-api.com/\"\u003e\u003cstrong\u003eSee the site»\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://monsternames-api.com/endpoints\"\u003eConsume the API\u003c/a\u003e\n    ·\n    \u003ca href=\"https://monsternames-api.com/contributionGuide\"\u003eContribute names programmatically\u003c/a\u003e\n    ·\n    \u003ca href=\"https://monsternames-api.com/addNames\"\u003eContribute names in GUI\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\n\n\u003c!-- TABLE OF CONTENTS --\u003e\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      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\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=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#behave-tests\"\u003eBehave tests\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \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=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#acknowledgments\"\u003eAcknowledgments\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## About The Project\n\nThis API was originally a standalone name generation program in a text-based adventure I was making.\n\nThat adventure never got off the ground, but the name generation did. So I decided to make name generation its own thing and host it in an API.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n### Built With\n\n* [Flask](https://flask.palletsprojects.com/en/2.0.x/)\n* [peewee](http://docs.peewee-orm.com/en/latest/)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\nTo get a local dev copy up and running follow these example steps.\n\nNote that all instructions are for development on MacOS.\n\nIf you're using other platforms same concepts apply just will need to localise to your OS.\n\nThese are just development instructions, for prod run with a container orchestrator that has SSL in front via load balancer etc.\n\n### Prerequisites\n\n* Docker\n* A MySQL 5.7.22 instance with a:\n    * dedicated database for the API\n    * user with full access to dedicated database\n    * user using mysql_native_password authentication\n\n_This can be spun up relatively easily with docker locally_\n    \n```sh\n# Create custom network so we can communicate with DB later\ndocker network create monsternames\n# Pull MySQL 5.7.22 server image from dockerhub\ndocker pull mysql:5.7.22\n# Setup MySQL server using image\ndocker run -p 3306:3306 --network monsternames --name monsternames_db_container -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=development -d mysql:5.7.22 mysqld\n```\n* Python 3.8.x\n\n### Installation\n\n1. Clone the repo\n    ```sh\n   git clone https://github.com/Sudoblark/monsternames-api\n    ```\n\n2. Run docker build with appropriate tagging and passthru of DB connection details for docker sql container:\n   1. _example below uses settings appropriately for docker database created in pre-requirement examples_\n   ```sh\n    docker build -t monsternames:v0.1 . --build-arg db_host='host.docker.internal' --build-arg db_name='development' --build-arg db_user='root' --build-arg db_pwd='password' --build-arg web_host='localhost:5000'\n    ```\n3. Spin up the docker container, mapping container 5000 to host 5000, in detached mode:\n\n   ```sh\n   docker run -d -p 5000:5000 monsternames:v0.1\n   ```\n   \n4. Connect to DB and create a new API key for POST requests\n\n    ```sh\n    docker run -it --network monsternames --rm mysql:5.7.22 mysql -hmonsternames_db_container -uroot -ppassword\n    ...\n    INSERT INTO development.apikeys (apiKey, `user`)\n    VALUES ('helloworld', 'testUser');\n    ```\n\n5. Run behaviour tests to confirm functionality:\n\n    ```sh\n   python3 -m venv venv\n   source venv/bin/activate\n   pip3 install -r requirements.txt\n   python -m behave\n   ...\n   1 feature passed, 0 failed, 0 skipped\n   50 scenarios passed, 0 failed, 0 skipped\n   150 steps passed, 0 failed, 0 skipped, 0 undefined\n   Took 0m4.310s\n\n   ```\n\n6. You're good to go for development with:\n\n- Locker docker instance running monsternames api\n- Local docker instance running MySQL backend\n- API key setup in DB for POST functionality\n- Functionality confirmed with Behave! behaviour testing\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n### Behave tests\nThere are behave feature tests setup to run behaviour tests, which tests:\n* POST to every api endpoint with 5 unique values\n  * This in turn tests that API authentication works via the `x-api-key` header\n* GET to every api endpoint between 5-10 times depending on underlying monster schema\n\n\nTried to get working on circleCI, but the separation of docker environments there makes it a bit of a mess so for now just pushes to ECR. But behaviour tests can run run locally steps outlined in local setup instructions.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- USAGE EXAMPLES --\u003e\n## Usage\n\n* [monsternames-api](https://monsternames-api.com/) is where I've got my flavour of the API sitting\n* [monster by mnuh](https://monster.mnuh.org/) is a cool monster card generator combining my API with others to make cards\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\u003c!-- ROADMAP --\u003e\n## Roadmap\n\n- [ ] Update frontend with [WAI](https://www.w3.org/WAI/) and [WCAG2.1](https://www.w3.org/TR/WCAG21/) guidelines\n- [ ] Decouple frontend (website) and backend (API)\n- [ ] Add [seleneium](https://www.selenium.dev/) testing\n- [ ] At some point, once it's covered in my uni studies, add an ML model that uses existing database to generate new names\n- [ ] Maybe some plotly graphs to show usage, but given how this is probably not used that much the data might not be much to show\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- CONTRIBUTING --\u003e\n## Contributing\n\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag \"enhancement\".\nDon't forget to give the project a star! Thanks again!\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- LICENSE --\u003e\n## License\n\nDistributed under the MIT License. See `LICENSE.txt` for more information.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- CONTACT --\u003e\n## Contact\n\nBenjamin Clark - [LinkedIn](https://www.linkedin.com/in/benni/) - bclark@sudoblark.com\n\nProject Link: [monsternames api](https://github.com/Sudoblark/monsternames-api)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- ACKNOWLEDGMENTS --\u003e\n## Acknowledgments\n\n* [Monster Creatures Fantasty](https://luizmelo.itch.io/monsters-creatures-fantasy) by luizmelo contains project logo\n* [othneildrew/Best-README-Template](https://github.com/othneildrew/Best-README-Template) for providing readme template\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjaminlukeclark%2Fmonsternames-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenjaminlukeclark%2Fmonsternames-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjaminlukeclark%2Fmonsternames-api/lists"}