{"id":19492795,"url":"https://github.com/oatpp/example-crud","last_synced_at":"2025-05-08T23:45:03.026Z","repository":{"id":40282321,"uuid":"167868585","full_name":"oatpp/example-crud","owner":"oatpp","description":"A complete example of a \"CRUD\" service (UserService) built with Oat++.","archived":false,"fork":false,"pushed_at":"2024-12-12T22:54:38.000Z","size":79,"stargazers_count":111,"open_issues_count":16,"forks_count":66,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-29T22:31:14.835Z","etag":null,"topics":["cpp","crud-api","oatpp","orm","sqlite3","swagger-ui"],"latest_commit_sha":null,"homepage":"https://oatpp.io/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oatpp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-01-27T22:59:55.000Z","updated_at":"2025-03-31T18:57:56.000Z","dependencies_parsed_at":"2024-11-07T00:26:17.822Z","dependency_job_id":"2e065fb8-084b-4cd3-9716-bde5abb7d0be","html_url":"https://github.com/oatpp/example-crud","commit_stats":{"total_commits":73,"total_committers":6,"mean_commits":"12.166666666666666","dds":0.09589041095890416,"last_synced_commit":"325bc0720fd3079831f36989587bff6d6ee6541a"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Fexample-crud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Fexample-crud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Fexample-crud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Fexample-crud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oatpp","download_url":"https://codeload.github.com/oatpp/example-crud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252958224,"owners_count":21831626,"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":["cpp","crud-api","oatpp","orm","sqlite3","swagger-ui"],"created_at":"2024-11-10T21:23:02.987Z","updated_at":"2025-05-08T23:45:03.009Z","avatar_url":"https://github.com/oatpp.png","language":"C++","readme":"# Example-CRUD [![Build Status](https://dev.azure.com/lganzzzo/lganzzzo/_apis/build/status/oatpp.example-crud?branchName=master)](https://dev.azure.com/lganzzzo/lganzzzo/_build?definitionId=9?branchName=master)\n\nA complete example of a \"CRUD\" service (UserService) built with Oat++.\n\nIn this example:\n\n- How to create CRUD endpoint.\n- How to use [oatpp ORM](https://oatpp.io/docs/components/orm/#high-level-overview) - SQLite example.\n- How to document API with Swagger-UI and OpenApi 3.0.0.\n\nMore about Oat++:\n\n- [Oat++ Website](https://oatpp.io/)\n- [Oat++ Github Repository](https://github.com/oatpp/oatpp)\n- [Get Started](https://oatpp.io/docs/start)\n\n## Overview\n\nThis project is using the following oatpp modules:\n\n- [oatpp](https://github.com/oatpp/oatpp) \n- [oatpp-swagger](https://github.com/oatpp/oatpp-swagger)\n- [oatpp-sqlite](https://github.com/oatpp/oatpp-sqlite)\n\n### Project layout\n\n```\n|- CMakeLists.txt                        // projects CMakeLists.txt\n|- sql/                                  // SQL migration scripts for SQLite database\n|- src/\n|   |\n|   |- controller/                       // Folder containing REST Controllers (UserController)\n|   |- db/                               // Folder containing the database client\n|   |- dto/                              // DTOs are declared here\n|   |- service/                          // Service business logic classes (UserService)\n|   |- AppComponent.hpp                  // Service config\n|   |- DatabaseComponent.hpp             // Database config\n|   |- SwaggerComponent.hpp              // Swagger-UI config\n|   |- App.cpp                           // main() is here\n|\n|- test/                                 // test folder\n|- utility/install-oatpp-modules.sh      // utility script to install required oatpp-modules.\n```\n\n---\n\n### Build and Run\n\n#### Using CMake\n\n##### Pre Requirements\n\n- `oatpp` \n- `oatpp-swagger`\n- `oatpp-sqlite` with `-DOATPP_SQLITE_AMALGAMATION=ON` cmake flag.\n\n**Note:** You may run `utility/install-oatpp-modules.sh` script to install required oatpp modules.\n\n##### Build Project\n\n```\n$ mkdir build \u0026\u0026 cd build\n$ cmake ..\n$ make \n$ ./crud-exe        # - run application.\n```\n\n#### In Docker\n\n```\n$ docker build -t example-crud .\n$ docker run -p 8000:8000 -t example-crud\n```\n\n---\n\n### Endpoints \n\n#### HTML\n\n|HTTP Method|URL|Description|\n|---|---|---|\n|`GET`|http://localhost:8000/ | Root page |\n|`GET`|http://localhost:8000/swagger/ui | Swagger UI page |\n\n#### User Service\n\n|HTTP Method|URL|Description|\n|---|---|---|\n|`POST`|http://localhost:8000/users | Create new User |\n|`PUT`|http://localhost:8000/users/{userId} | Update User by ID |\n|`GET`|http://localhost:8000/users/{userId} | Get User by ID |\n|`DELETE`|http://localhost:8000/users/{userId} | Delete User by ID |\n|`GET`|http://localhost:8000/users/offset/{offset}/limit/{limit} | Get All Users with Paging |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foatpp%2Fexample-crud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foatpp%2Fexample-crud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foatpp%2Fexample-crud/lists"}