{"id":50937782,"url":"https://github.com/bcorfman/highscore-micro-two","last_synced_at":"2026-06-17T11:02:38.471Z","repository":{"id":178412058,"uuid":"661828036","full_name":"bcorfman/highscore-micro-two","owner":"bcorfman","description":"A FastAPI containerized microservice to create/query a high score list using SQLModel. Connects to a separate PostgreSQL database deployed on the ElephantSQL cloud.","archived":false,"fork":false,"pushed_at":"2024-02-19T00:27:54.000Z","size":176,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-07-30T17:00:56.664Z","etag":null,"topics":["asgi","asyncio","back4app","docker","elephantsql","fastapi","microservice","postgresql","sqlalchemy","sqlmodel"],"latest_commit_sha":null,"homepage":"https://highscore1-1y492j9s.b4a.run/docs","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/bcorfman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-07-03T18:40:49.000Z","updated_at":"2024-07-06T00:54:26.000Z","dependencies_parsed_at":"2023-10-03T05:30:25.785Z","dependency_job_id":"e50598e3-9339-4d18-bc5b-f1a30a9fd305","html_url":"https://github.com/bcorfman/highscore-micro-two","commit_stats":null,"previous_names":["bcorfman/highscore-micro-two"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bcorfman/highscore-micro-two","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcorfman%2Fhighscore-micro-two","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcorfman%2Fhighscore-micro-two/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcorfman%2Fhighscore-micro-two/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcorfman%2Fhighscore-micro-two/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcorfman","download_url":"https://codeload.github.com/bcorfman/highscore-micro-two/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcorfman%2Fhighscore-micro-two/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34445186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"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":["asgi","asyncio","back4app","docker","elephantsql","fastapi","microservice","postgresql","sqlalchemy","sqlmodel"],"created_at":"2026-06-17T11:02:35.483Z","updated_at":"2026-06-17T11:02:38.459Z","avatar_url":"https://github.com/bcorfman.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# highscore-micro-two\n\n[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/bcorfman/highscore-micro-two)\n\nA FastAPI containerized microservice to create/query a high score list using SQLModel. Connects to a separate PostgreSQL database deployed on the ElephantSQL cloud, so I could try Python's asyncio functionality with latency.\n\nI'm using this project to practice simple microservice design with Python.\n\n## How to set up your own version of this project\n\n0. Fork this highscore-micro-two repo on your own GitHub account.\n    - In other words, at the top right of this page, click the Fork button!\n    - Check the box that says \"Copy the main branch only\" (my suggestion), leave the rest of the details the same, and click Create Fork.\n1. Create a PostgreSQL DB instance on the ElephantSQL cloud.\n    - Visit the [ElephantSQL website](https://www.elephantsql.com/plans.html) and choose the free Tiny Turtle plan.\n    - Sign up for your account.\n    - Select a name for your plan. (The name is not important, but I chose \"highscore\".)\n    - Pick a region and data center that's close(st) to you. This will help your cloud service performance.\n    - Review the final details, then click Create Instance.\n    - On the Instances page, click the name of your newly created Instance.\n    - On the resulting Details page, copy the connection URL to the clipboard.\n    - Finally, make sure your system tests work correctly! In your forked repo on GitHub: find and click your Settings tab, then, on the left sidebar, expand the Secrets and Variables menu, and click Actions. Click the \"New repository secret\" button, type in ELEPHANTSQL_URL as the name, paste your connection URL into the \"Secret\" text box, and change the first part of the connection URL to read postgresql+asyncpg:// instead of postgres://\n2. Create a Back4App account and use their \"Container as a Service\" feature to deploy a database API microservice.\n    - Visit the [Back4App website](https://www.back4app.com/) and sign up for a free account.\n    - At their opening menu, choose Back4App's \"Container as a Service\" feature.\n    - Point to your forked highscore-micro-two repo on GitHub via their \"Import GitHub repo\" button. NOTE: You will need to give permission to GitHub to install and use \"Back4App Containers\" during this process.\n    - Under the \"Configure your initial deployment\" settings, choose an App Name (I named mine \"highscore\") and, under the \"Build and Deploy\" menu, assign your Port as 443. NOTE: Back4App will automatically handle the configuration of certificates needed for Secure HTTP to work with your container.)\n    - Under the \"Environment Variables\" menu, define a variable with a name of ELEPHANTSQL_URL, paste your connection URL into the Value text box (same as in step 1 above), and change the first part of the connection URL to read postgresql+asyncpg:// instead of postgres:// before you push the Save Settings button.\n    - Check your email for a confirmation link to enable deployment.\n\n## Project startup\n\n- Clone the project to your system\n- At a command prompt in the project directory, type `make devinstall` to set up the project dependencies.\n\nAlso important:\n- To run Pytest locally, the FastAPI setup code in main.py looks for a .env file in your project directory. This file will need to contain a single line, which is the same ELEPHANTSQL_URL environment variable as defined in the final part of step 1 under \"How to set up your own version\" above, e.g.\n`ELEPHANTSQL_URL=postgresql+asyncpg://{username}:{password}@{your_prefix_here}.db.elephantsql.com/{username}`\n\n## Deployment\n\n- If you follow the *How to set up your own version* instructions above, Back4App will deploy your containerized microservice to its cloud each time you do a `git push` to your `main` branch.\n- Any app built using FastAPI also has a default /docs page that allows you to interact with your published web API. For example, my original HighScore microservice has its own docs page [here](https://highscore-ibq0itxr.b4a.run/docs). You will need to find the link to your own container on your Back4App dashboard; make sure you add the /docs suffix onto the end of your URL to bring up the page correctly.\n- If you set both environment variables correctly in the *How to set up your own version* instructions above, your microservice will connect to the ElephantSQL cloud and read/write from the PostgreSQL database there. If something goes wrong, make sure you've checked the connection URLs for correctness.  \n- Check out (or fork) my Anvil-based app for a web frontend that provides a better user experience for the database microservice.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcorfman%2Fhighscore-micro-two","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcorfman%2Fhighscore-micro-two","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcorfman%2Fhighscore-micro-two/lists"}