Jiffy Application Architecture
Jiffy Application Architecture
Jiffy approaches the API from a services perspective. Each entity has a corresponding service that can be started when the application initializes. The Usr, UsrGroup, Auth and GroupAuth services are always generated by default when creating a Jiffy application. Additional services are generated based on the content of your project’s model files.
Generated application services can be broken down into five high-level areas:
graph TD;
subgraph
A(End-Points)-->B(Middleware)
B-->C(Controllers)
C-->D(Models)
D-->E(Database)
end
- End-Points expose the service APIs to the consumer, such as a web-app or another server. End-points may be customized by way of the application model files.
- Middleware provides user authentication / authorization services and is tightly-coupled to the end-point definitions. The middleware offers comprehensive services such as authorization via JWT claim inspection, as well as some caching of user and group authorization details. This is an area of active development.
- Controllers are the entry point into the application proper, and are called after a request has been granted access to the end-point by the middleware. It is here that the body of the request is unmarshalled and mapped into the correct go model structure. Extension-points conforming to standard Jiffy interfaces are provided in the controllers for post-generation enhancements.
- Models are where the entity data from the request is checked, normalized and prepared for submission to the database. Extension-points conforming to standard Jiffy interfaces are provided in the models for post-generation enhancements.
- Database refers to the backend DBMS that is used to house the entity data. Jiffy generated applications can connect to PostgreSQL, MariaDB/MySQL, MSSQL, SAP HanaDB or SQLite. It is easy to extend the database support to other relational platforms provided that there is an existing go sql driver for the database in question. It is possible to override the generated Jiffy call to the database and ‘roll-your-own’ should the need arise.