{"id":20864302,"url":"https://github.com/kodius/rails-api-rest","last_synced_at":"2025-04-10T22:54:01.474Z","repository":{"id":173474977,"uuid":"552751560","full_name":"kodius/rails-api-rest","owner":"kodius","description":"Rails 7 REST (openapi) template repo with Dockerfile, docker-compose and docker-swarm stack","archived":false,"fork":false,"pushed_at":"2024-03-01T09:15:14.000Z","size":2870,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-10T22:53:55.824Z","etag":null,"topics":["backend","docker","docker-stack","docker-swarm","mvc","openapi","rest-api","rspec","rswag","ruby","ruby-on-rails"],"latest_commit_sha":null,"homepage":"https://kodius.com","language":"Ruby","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/kodius.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}},"created_at":"2022-10-17T07:11:10.000Z","updated_at":"2024-08-01T16:14:01.000Z","dependencies_parsed_at":"2023-09-26T19:38:47.660Z","dependency_job_id":"b54f0e51-93c3-43d3-bafa-7c76eb285158","html_url":"https://github.com/kodius/rails-api-rest","commit_stats":null,"previous_names":["kodius/rails-api-rest"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodius%2Frails-api-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodius%2Frails-api-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodius%2Frails-api-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodius%2Frails-api-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kodius","download_url":"https://codeload.github.com/kodius/rails-api-rest/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312172,"owners_count":21082638,"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":["backend","docker","docker-stack","docker-swarm","mvc","openapi","rest-api","rspec","rswag","ruby","ruby-on-rails"],"created_at":"2024-11-18T05:41:06.558Z","updated_at":"2025-04-10T22:54:01.454Z","avatar_url":"https://github.com/kodius.png","language":"Ruby","readme":"# rails-api-rest 📦\n\n![rorimage](https://user-images.githubusercontent.com/8150171/276251204-0e599658-2476-4573-ae96-b68df82fd528.jpg)\n\n## What is this? ❓\n\nThis is a core **rails API starter project** accompanied with examples of a couple of concepts we like to use in our Rails projects. It's meant to be used as a template (meaning when you start a new repository on **Github**, you select this repository as the \"template\" to use). With it you get a barebones rails api setup (initialized with the `--api` flag during generation), using **postgres** for DB and a couple of gems we like to use plus samples of **Actions**, **Validations**, **OpenAPI** definitions and such, to make it easier when starting a new project from scratch instead of having to think what to do.\n\n*   [x] 📐 **MVC**\n*   [x] ☝️ **Actions** (so you don't put it all in any of the MVC components)\n*   [x] 🔐 **Auth**\n*   [x] 🗂️ **Serialization**\n*   [x] 🛡️ **Validations**\n*   [x] 📝 **OpenAPI**\n*   [x] 📦 **Dockerized**\n\n\n\n# 📐 MVC\n\nThe project is meant as a **backend-only rails API**, and as such the \"view\" in MVC in this case means having **JSON responses**, not actual templates. Or rather, any front-end framework handling the viewing whichever way you like.\n\nThe other parts of MVC, the Model and Controller -- they're both meant to be skinny., which is why we're making extensive use of Actions and Validators, to make them clean and make them contain as little as possible.\n\n## ☝️ Actions\n\n[What are Actions and how to use them](/app/interactors/actions/README.md)\n\n## 🔐 Auth\n\nAuth is implemented with JWT, w/o Devise (out of the box, but you can add it if you want).\n\n## 🗂️ Serializers\n\nImplemented with [blueprinter](https://github.com/procore-oss/blueprinter). Click the link for more info.\n\n## 🛡️ Validations\n\nDefault validations are sitting in `app/services/validations`.\n\n## 📝 OpenAPI\n\n[What is OpenAPI and how to use it](/openapi/README.md)\n\nWe're using [rswag](https://github.com/rswag/rswag). The explorer sits over at `/spec`. You write a spec for your controller, along with typed payloads and responses, and then you run `make swagger` to have the latest and greatest API spec available over at `/spec/openapi.json` or via the explorer page on `/spec`!\n\n## 👔 Coding Standards\n\nWe like Ruby for its elegance and almost natural-like syntax and expresiveness.\n\u003chttps://github.com/rubocop/rails-style-guide\u003e\n\n## Recommended extensions\n\n\u003chttps://marketplace.visualstudio.com/items?itemName=shopify.ruby-lsp\u003e\n\n\u003chttps://marketplace.visualstudio.com/items?itemName=misogi.ruby-rubocop\u003e\n\n\u003chttps://marketplace.visualstudio.com/items?itemName=kaiwood.endwise\u003e\n\n\u003chttps://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg\u003e\n\n## Debugging with VS Code\n\n*   Install [VSCode rdbg](https://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg)\n\n*   Run the `Debug Rails` task\n\n*   Enjoy inline VS Code debugging with breakpoints and everything\n\n![VS Code with rdbg](https://kodiusebucket.s3.amazonaws.com/vscode-rdbg.png)\n\n## How to run\n\n```bash\n    rbenv install 3.2.2 #to get the latest version of ruby\n    gem install bundler # to get bundler installed\n    bundle # install dependencies\n    rails db:create # create database\n    make migrate\n    make dev\n```\n\n## Run scripts\n\n```bash\n    make dev\n    make test #all tests\n    make test:swag\n    make test:unit #services\n    make migrate\n    make swagger\n```\n\n## Miscellaneous\n\nAny other additions are welcome! Just open up a PR or an issue!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkodius%2Frails-api-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkodius%2Frails-api-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkodius%2Frails-api-rest/lists"}