{"id":15392655,"url":"https://github.com/jackdbd/reitit-demo-api","last_synced_at":"2026-04-20T17:31:27.732Z","repository":{"id":82381096,"uuid":"561975045","full_name":"jackdbd/reitit-demo-api","owner":"jackdbd","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-04T23:51:57.000Z","size":511,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-11T06:49:20.270Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","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/jackdbd.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":"2022-11-04T23:51:38.000Z","updated_at":"2022-11-04T23:52:00.000Z","dependencies_parsed_at":"2023-03-02T08:16:01.061Z","dependency_job_id":null,"html_url":"https://github.com/jackdbd/reitit-demo-api","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"9b87f8d86a66dd7e27538f94cf2f205a61b22587"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jackdbd/reitit-demo-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Freitit-demo-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Freitit-demo-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Freitit-demo-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Freitit-demo-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackdbd","download_url":"https://codeload.github.com/jackdbd/reitit-demo-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Freitit-demo-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32057589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-10-01T15:15:35.812Z","updated_at":"2026-04-20T17:31:27.699Z","avatar_url":"https://github.com/jackdbd.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reitit demo API\n\nA simple API to learn [Reitit](https://github.com/metosin/reitit).\n\nApp deployed to Fly.io: https://delicate-flower-703.fly.dev\n\n## Installation\n\nThis project can be managed with the [Babashka Tasks Runner](https://book.babashka.org/#tasks). The tasks are defined in [this bb.edn file](./bb.edn). You can check the list of available tasks using this command:\n\n```sh\nbb tasks\n```\n\nInstall all npm packages and all jars:\n\n```sh\nbb install\n```\n\n## Development\n\nI use VS Code and [Calva](https://calva.io/) to write Clojure, and [neil](https://github.com/babashka/neil) to manage the `deps.edn` and `build.clj` files.\n\nTo start a project REPL and start developing, open VS Code and do the following:\n\n1. Type `ctrl+alt+c` `ctrl+alt+j`: start a project REPL and connect (aka [jack-in](https://calva.io/connect/)) with Calva.\n1. Select `deps.edn` as project type.\n1. Select `:dev` as the alias.\n\nThe instructions above execute the code found in the [user](./dev/user.clj) namespace.\n\nIn the `user.clj` file there are also several [rich comments](https://practical.li/clojure/clojure-cli/projects/rich-comments.html) to start/stop the stateful component of the app (managed by [integrant](https://github.com/weavejester/integrant)), and to launch [Portal](https://github.com/djblue/portal) and send [taps](https://clojuredocs.org/clojure.core/tap%3E) to it.\n\nYou can type `ctrl+alt+space space` to see the list of [custom REPL commands](https://calva.io/custom-commands/) you can run (TODO: ensure that the port used to communicate with Portal is correct). These commands and their shortcuts are defined in the `:customREPLCommandSnippets` key in [.calva/config.edn](.calva/config.edn). For example, `ctrl+alt+space p` launches [portal](https://github.com/djblue/portal).\n\n*Tip*: for a more complete setup for VS Code and Calva, see Sean Corfield's [vscode-calva-setup](https://github.com/seancorfield/vscode-calva-setup) repo.\n\nRun the app:\n\n```sh\nbb serve\n```\n\nMake some requests:\n\n```sh\ncurl -X GET \"http://localhost:$PORT/math/plus?x=2\u0026y=3\" -i\n```\n\n```sh\ncurl -X POST \"http://localhost:$PORT/math/plus\" \\\n  -H 'Content-Type: application/json' \\\n  -i \\\n  -d '{ \"x\": 2, \"y\": 3 }'\n```\n\nLaunch PostgreSQL using Docker Compose:\n\n```sh\nbb dc-up\n```\n\nWhen you are done, stop all containers using this command:\n\n```sh\nbb dc-down\n```\n\n## Database migrations\n\nI prefer writing migrations in SQL, and at the same time using the [Knex CLI](https://knexjs.org/guide/migrations.html) to manage the migration scripts.\n\nCreate a new migration script:\n\n```sh\nbb migrate:make my-new-migration\n```\n\nWrite the up/down migrations in SQL.\n\nThen, run all migrations:\n\n```sh\nbb migrate:latest\n```\n\nSeed the database tables with some records, using a SQL script:\n\n```sh\nbb seed\n```\n\nIn alternative, seed the database tables with some records, using the [snaplet](https://www.snaplet.dev/) CLI:\n\n```sh\nbb snaplet-seed\n```\n\nRollback the migration:\n\n```sh\nbb migrate:rollback\n```\n\n## Test\n\n```sh\nbb test\n```\n\n## Version management\n\nThis project uses neil to manage versioning.\n\nWith neil, the **first time** you want to set the version of a project, use `neil version set VERSION`. For example:\n\n```sh\nneil version set 0.0.1\n```\n\nneil adds the `:version` keyword to your `deps.edn` and creates a git tag for you.\n\nThen, you can use semantic versioning to assign versions. Important: type just `neil version`, not type `neil version set`.\n\n```sh\nneil version major\nneil version minor\nneil version patch\n```\n\nneil updates the `:version` keyword in your `deps.edn` and creates a git tag for you.\n\n:warning: TODO keep the version in `deps.edn` in sync with the one assigned by Fly.io.\n\n## Deploy\n\nDeploy to Fly.io:\n\n```sh\nbb deploy\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackdbd%2Freitit-demo-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackdbd%2Freitit-demo-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackdbd%2Freitit-demo-api/lists"}