Skip to content

A complete example of a CRUD service with API secured with JSON Web Token (JWT)

License

Notifications You must be signed in to change notification settings

oatpp/example-jwt

Repository files navigation

Example-JWT Build Status

A complete example of a "CRUD" API secured with JSON Web Token (JWT) built with Oat++ and jwt-cpp.

In this example:

  • How to create CRUD endpoints.
  • How to secure endpoints with JWT.
  • How to use Oat++ ORM - PostgreSQL example.
  • How to document API with Swagger-UI and OpenApi 3.0.0.

More about Oat++:

Overview

This project is using the following oatpp modules:

3rd party dependencies

Project layout

|- CMakeLists.txt                        // projects CMakeLists.txt
|- sql/                                  // SQL migration scripts
|- src/
|   |
|   |- controller/                       // Folder containing REST Controllers (AuthController, StoryController)
|   |- db/                               // Folder containing database clients
|   |- dto/                              // DTOs are declared here
|   |- service/                          // Service business logic classes (AuthService, StoryService)
|   |- AppComponent.hpp                  // Service config
|   |- DatabaseComponent.hpp             // Database config
|   |- SwaggerComponent.hpp              // Swagger-UI config
|   |- App.cpp                           // main() is here
|
|- test/                                 // test folder
|- utility/install-oatpp-modules.sh      // utility script to install required oatpp-modules.

About

A complete example of a CRUD service with API secured with JSON Web Token (JWT)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published