{"id":26696731,"url":"https://github.com/cleanlab/bedrock","last_synced_at":"2025-08-26T00:20:22.678Z","repository":{"id":240766161,"uuid":"614515213","full_name":"cleanlab/bedrock","owner":"cleanlab","description":"A foundation for great things","archived":false,"fork":false,"pushed_at":"2024-05-20T16:57:28.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-20T20:21:05.311Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cleanlab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-03-15T18:37:02.000Z","updated_at":"2024-05-20T20:21:13.382Z","dependencies_parsed_at":"2024-05-20T20:21:10.920Z","dependency_job_id":"7219d9c8-7b39-4f03-b97c-943e9e6c824d","html_url":"https://github.com/cleanlab/bedrock","commit_stats":null,"previous_names":["cleanlab/bedrock"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleanlab%2Fbedrock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleanlab%2Fbedrock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleanlab%2Fbedrock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleanlab%2Fbedrock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cleanlab","download_url":"https://codeload.github.com/cleanlab/bedrock/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245730138,"owners_count":20662957,"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":[],"created_at":"2025-03-26T20:27:36.064Z","updated_at":"2025-08-26T00:20:22.646Z","avatar_url":"https://github.com/cleanlab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bedrock\n\nScaffolding and example code for a simple app (API only, no UI). Includes:\n\n- A Flask app with user accounts (register/login/check auth)\n    - Uses a Postgres database\n- A Celery worker for async tasks\n    - Uses Redis as a broker\n    - Shares code with the Flask app, so it can access DB models etc.\n- Celery beat for scheduled tasks\n\nDemo code exercises all of this functionality. The codebase is small enough\nthat you should be able to read through all of it in about 15 minutes.\n\n## Development tips\n\n- This repo uses [Docker Compose](https://docs.docker.com/compose/). Get the\n  site running locally with `docker compose up --build`. Test that it's working\n  by navigating to \u003chttp://localhost:8080/ping\u003e.\n- If you change database models, you probably want to discard all persistent\n  state in the database (rather than bother with a database migration). You can\n  do this with `docker compose down -v`.\n- The Flask web server is set up to auto-reload on changes. Celery/Beat do not:\n  if you change jobs/schedules, you should restart the corresponding services.\n  You can do this like `docker compose restart worker` (or `beat`).\n- To interact with the service, use a REST client like\n  [Postman](https://www.postman.com/product/rest-client/), or use cURL on your\n  command line.\n\n## Example interaction\n\n```console\n$ curl -H 'Content-Type: application/json' \\\n\t-XPOST localhost:8080/register \\\n\t--data '{\"username\": \"alice\", \"password\": \"supersecret\"}'\n\n$ curl localhost:8080/status/alice\n{\n  \"status\": null\n}\n\n$ curl -H 'Content-Type: application/json' \\\n\t-XPOST localhost:8080/login \\\n\t--data '{\"username\": \"alice\", \"password\": \"supersecret\"}'\n{\n  \"token\": \"60164b1b85f70c820a0f048f6aadf71a4b7324fc0672f81099dad3eb53ff5c84\"\n}\n\n$ curl -H 'Content-Type: application/json' \\\n    -H 'Authorization: Bearer 60164b1b85f70c820a0f048f6aadf71a4b7324fc0672f81099dad3eb53ff5c84' \\\n\t-XPOST localhost:8080/status \\\n\t--data '{\"status\": \"On vacation in Tahiti.\"}'\n\n$ curl localhost:8080/status/alice\n{\n  \"status\": \"On vacation in Tahiti.\"\n}\n\n$ # wait for a day...\n$ curl localhost:8080/status/alice\n{\n  \"status\": null\n}\n```\n\n## Warm-up exercise\n\nIf you want an idea for a warm-up exercise to get familiar with modifying the\ncode (DB models, routes, Celery tasks, ...), here are some ideas:\n\n- Add a `/users` route that lists all users.\n- Get a user's email via their GitHub profile.\n    - Add a `/email/\u003cusername\u003e` endpoint that returns a user's email address by\n      looking it up in their GitHub profile.\n    - Use the GitHub REST API, or the\n      [PyGithub](https://github.com/PyGithub/PyGithub) library (recommended).\n    - You might need to get a GitHub personal access token (and create the\n      client with `github = Github(\"\u003cYOUR TOKEN HERE\u003e\")`. You can create a\n      token [here](https://github.com/settings/tokens). You can create a\n      \"Personal access token (classic)\" and leave all the checkboxes empty: you\n      only need read-only access to public information, which needs access to\n      none of the specialized scopes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleanlab%2Fbedrock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcleanlab%2Fbedrock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleanlab%2Fbedrock/lists"}