Platformatic v0.29.0 is out now!

Search for a command to run...

No comments yet. Be the first to comment.
Nitro is a server toolkit used by many JavaScript applications. You can use it on its own for APIs or full-stack servers, or combine it with Vite to get a familiar frontend workflow with a Nitro serve

All durable execution engines give the same versioning advice: pin your runs. Temporal pins runs to worker builds. Vercel's Workflow SDK pins each run to the deployment that started it. Azure Durable

Eve organizes AI agents in a simple way: use Markdown for instructions and skills, TypeScript for tools, and separate files for channels, schedules, and subagents. Behind this setup, Eve relies on the

Picture an online store launching a new product and sending out a mailing list campaign. Thousands of users click the same link at once. The product page, built with a Node.js app like Next.js, needs

How Platformatic ICC Outperforms AWS ECS Target Tracking and Step Scaling

Today we are releasing v0.29.0 of Platformatic, packing in many improvements.
Through this exciting release, we’ve improved TypeScript support. We now allow you to edit your APIs on the fly with Platformatic Composer, you’ll be able to make platformatic client runtime aware, and we’ve improved the generator.
Check out the full release notes at: https://github.com/platformatic/platformatic/releases/tag/v0.29.0
Here is a summary of the major features.
Platformatic Service provides automatic TypeScript compilation during the startup of your Node.js server. While this provides a great developer experience, it adds additional startup time and requires more resources – something that comes at a premium in production environments.
In Platformatic v0.29.0 we changed how the plugin configuration is generated by npx create-platformatic@latest, adding a {PLT_TYPESCRIPT} env variable:
{
...
"plugins": {
"paths": [{
"path": "plugins",
"encapsulate": false
}, "routes"],
"typescript": "{PLT_TYPESCRIPT}"
}
}
Note that the {PLT_TYPESCRIPT} will be automatically replaced with the PLT_TYPESCRIPT environment variable, that is configured in your
.env (and .env.sample) file:
PLT_TYPESCRIPT=true
Compiling for deployment is as easy as running plt service compile in said folder.
Remember to set PLT_TYPESCRIPT=false in your environment variables in the deployed environments.
If you are building a Runtime-based application, you will need
to compile every service independently or with the use of plt runtime compile.
Platformatic Runtime allows you to create a network of services that are not exposed. To create a client to invoke one of those services from another, run:
$ platformatic client --name <clientname> --runtime <serviceId>
Where <clientname> is the name of the client and <serviceId> is the id of the given service
(which correspond in the basic case with the folder name of that service).
The client generated is identical to the one in the previous section.
Note that this command looks for a platformatic.runtime.json in a parent directory.
Platformatic Composer allows you to compose multiple services exposing OpenAPI definitions:
Composition of two remote services:
```json
{
"composer": {
"services": [
{
"id": "auth-service",
"origin": "https://auth-service.com",
"openapi": {
"url": "/documentation/json",
"prefix": "auth",
"config": "./auth-openapi-config.json"
}
},
{
"id": "payment-service",
"origin": "https://payment-service.com",
"openapi": {
"file": "./schemas/payment-service.json",
"config": "./payment-openapi-config.json"
}
}
],
"refreshTimeout": 1000
}
}
Each service API can be modified on the fly by Platformatic Composer via the use of a service-specific config file (composer.services.openapi.config property). It supports the following options:
ignore (boolean) - If true, the route will be ignored by the composer.
If you want to ignore a specific method, use the ignore option in the nested method object.
Example
{
"paths": {
"/users": {
"ignore": true
},
"/users/{id}": {
"get": { "ignore": true },
"put": { "ignore": true }
}
}
}
alias (string) - Use it create an alias for the route path. The original route path will be ignored.
Example
{
"paths": {
"/users": {
"alias": "/customers"
}
}
}
rename (string) - Use it to rename composed route response fields.
Use JSON Schema format to describe the response structure. For now, this will only work for 200 responses.
Example
{
"paths": {
"/users": {
"responses": {
"200": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": { "rename": "user_id" },
"name": { "rename": "first_name" }
}
}
}
}
}
}
}
We have updated our create-platformatic command to generate the correct environment variables and schema definitions for Platformatic DB, should you want to connect to MySQL, MariaDB and PostgreSQL
➜ create-platformatic
Hello, Matteo Collina welcome to Platformatic 0.28.1!
Let's start by creating a new project.
? Which kind of project do you want to create? DB
? Where would you like to create your project? .
? What database do you want to use? (Use arrow keys)
SQLite
❯ PostgreSQL
MySQL
MariaDB
? Do you want to use the connection string "postgres://postgres:postgres@127.0.0.1:5432/postgres"? (yeH)
Remember to start the correct databases if you are developing locally.
docker run --env MYSQL_ALLOW_EMPTY_PASSWORD=true --env MYSQL_DATABASE=test -p 3306:3306 mysql
docker run --env MYSQL_ALLOW_EMPTY_PASSWORD=true --env MYSQL_DATABASE=test -p 3306:3306 mysql:5.7
docker run -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=test -p 5432:5432 postgres