{"id":20209817,"url":"https://github.com/rosineygp/clojure-dks","last_synced_at":"2026-04-13T09:32:05.860Z","repository":{"id":111820275,"uuid":"233836538","full_name":"rosineygp/clojure-dks","owner":"rosineygp","description":"Clojure CRUD (mongo, docker, REST, Swagger)","archived":false,"fork":false,"pushed_at":"2021-04-19T21:03:09.000Z","size":408,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-15T22:14:08.649Z","etag":null,"topics":["api","clojure","docker","docker-compose","monogodb","swagger"],"latest_commit_sha":null,"homepage":"","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/rosineygp.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,"zenodo":null}},"created_at":"2020-01-14T12:28:29.000Z","updated_at":"2022-11-05T17:38:44.000Z","dependencies_parsed_at":"2023-04-27T12:01:17.011Z","dependency_job_id":null,"html_url":"https://github.com/rosineygp/clojure-dks","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/rosineygp/clojure-dks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosineygp%2Fclojure-dks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosineygp%2Fclojure-dks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosineygp%2Fclojure-dks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosineygp%2Fclojure-dks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rosineygp","download_url":"https://codeload.github.com/rosineygp/clojure-dks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosineygp%2Fclojure-dks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31746294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"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":["api","clojure","docker","docker-compose","monogodb","swagger"],"created_at":"2024-11-14T05:42:48.481Z","updated_at":"2026-04-13T09:32:05.849Z","avatar_url":"https://github.com/rosineygp.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"Clojure DKS\n===========\n\nDocker Service\n\n# Architecture\n\n```mermaid\ngraph TB\nid((Start)) --\u003e API\nAPI --\u003e MONGO\nWORKER --\u003e MONGO\n```\n\nThe application has three components:\n\n## API \n- IN/OUT data over HTTP\n- Restiful architecture, all verbs (GET, POST, PUT, PATCH, DELETE)\n- Database load and restore\n- Validation of data traffic\n- Write on DB the scheduled jobs\n- Business rules (Create, Restore, Update and Delete Schedule)\n\n## Mongo DB\n- Keep stateful data (CRUD)\n- Glue between API and Worker\n\n## WORKER\n- Searching for jobs and run all then (Every 10 seconds)\n- Update output (stdout, stderr, exit_code) of the jobs to database\n\n# whys?\n\n- Language: Clojure\n    - Just need to learn a new language\n    - I never used this language before and I just accept the challenge\n    - I never used Functional Languages before\n- Worker and API:\n    - Separating it is possíble to scale better horizontally (I have to improve update before, but is easy)\n    - The load of both is very different\n    - The solution is based on docker, I can put one worker in N machines to do the \"jobs\" without API overhead (API after up consommes ~450M and the worker just ~70M)\n    - If the API is down for N reasons the jobs will run\n\n## The main components (Libs)\n\n- metosin/compojure-api\n- com.novemberain/monger\n- clj-time\n\n\u003e Special thanks for everyone\n\n# How to run\n\n[API DOC](api/README.md)\n\n[WORKER DOC](worker/README.md)\n\n- requirements\n    - docker \u003e= 17.05 [Multi Stage Build](https://docs.docker.com/develop/develop-images/multistage-build/)\n    - docker-compose\n    - it consumes ~1G RAM\n\n- build the project\n\n`docker-compose build`\n\n- run the project\n\n`docker-compose up -d`\n\n\u003e the runner mounts the /tmp/ajb and put temporally files there. Is not possible to run this project in docker dind\n\n## Run others items of project (local)\n\n```\n# root of project\n# api itens\n\ncd api\nlein test        # test only\nlein cloverage   # test and coverage\nlein eastwood    # linter a lot of bugs on compojure\nlein kibit       # sast\nlein codox       # generate static docs\n\ncd ../worker\n\ncd api\nlein test        # test only\nlein cloverage   # test and coverage\nlein eastwood    # linter a lot of bugs on compojure\nlein kibit       # sast\nlein codox       # generate static docs\n\n```\n\n\u003e for tests work, needs a mongo db listening and working\n\nCheck the api and worker docs\n\n# TODO\n\n1. I can't finished the validation of endpoints (exists, but is too simple) Schema.core is very different.\n2. I don't test it with N workers (possibles side effects, run the same jobs twice or N times).\n3. In schedule time I wanted to use linux cron schema (re-run jobs and others), but the item 1. responds it.\n4. The health check isn't a very checkable.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frosineygp%2Fclojure-dks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frosineygp%2Fclojure-dks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frosineygp%2Fclojure-dks/lists"}