Architecture
Platformatic is a collection of Open Source tools designed to eliminate friction
in backend development. The first of those tools is Platformatic DB, which is developed
as @platformatic/db
.
Platformatic DB
Platformatic DB can expose a SQL database by dynamically mapping it to REST/OpenAPI and GraphQL endpoints. It supports a limited subset of the SQL query language, but also allows developers to add their own custom routes and resolvers.
Platformatic DB is composed of a few key libraries:
@platformatic/sql-mapper
- follows the Data Mapper pattern to build an API on top of a SQL database. Internally it uses the@database
project.@platformatic/sql-openapi
- usessql-mapper
to create a series of REST routes and matching OpenAPI definitions. Internally it uses@fastify/swagger
.@platformatic/sql-graphql
- usessql-mapper
to create a GraphQL endpoint and schema.sql-graphql
also support Federation. Internally it usesmercurius
.
Platformatic DB allows you to load a Fastify plugin during server startup that contains your own application-specific code. The plugin can add more routes or resolvers — these will automatically be shown in the OpenAPI and GraphQL schemas.
SQL database migrations are also supported. They're implemented internally with the postgrator
library.