2022-11-06 17:39:49 +01:00
|
|
|
---
|
2023-05-22 17:33:03 +02:00
|
|
|
title: Backend REST API
|
2022-11-06 17:39:49 +01:00
|
|
|
---
|
|
|
|
|
2023-05-22 16:41:02 +02:00
|
|
|
This is the reference documentation for the FreeSewing backend REST API.
|
|
|
|
|
2023-05-22 17:33:03 +02:00
|
|
|
## REST API docs
|
|
|
|
|
2024-09-28 13:13:48 +02:00
|
|
|
:::tip
|
|
|
|
The documentation generated from the OpenAPI specification is available
|
|
|
|
alt [backend3.freesewing.org/docs/](https://backend3.freesewing.org/docs/)
|
|
|
|
:::
|
2023-05-22 17:33:03 +02:00
|
|
|
|
2024-09-28 13:13:48 +02:00
|
|
|
:::note FIXME
|
|
|
|
This documentation is under construction.
|
|
|
|
Meanwhile, check the Swagger docs, linked above.
|
|
|
|
:::
|
2023-05-22 17:33:03 +02:00
|
|
|
|
2023-05-22 16:41:02 +02:00
|
|
|
## About the FreeSewing backend
|
|
|
|
|
2022-11-06 20:16:01 +01:00
|
|
|
The FreeSewing backend handles all user data. Prior to version 3 of FreeSewing,
|
|
|
|
the backend was only used internally as the data store for our frontend, the
|
|
|
|
FreeSewing.org website.
|
|
|
|
|
|
|
|
In version 3, we have rewritten the backend with the explicit goal to offer it
|
|
|
|
as a service to users and developers. This allows integration with other tools
|
|
|
|
such as hosted instances of our lab, CLI tools, serverless runners, CI/CD
|
|
|
|
environments and so on.
|
|
|
|
|
2024-09-28 13:13:48 +02:00
|
|
|
In other words, we no longer merely provide our own frontend, you can now also
|
2022-11-06 20:16:01 +01:00
|
|
|
use our backend as a service to build your own projects.
|
|
|
|
|
2024-09-28 13:13:48 +02:00
|
|
|
:::warning
|
2022-11-06 20:16:01 +01:00
|
|
|
|
2023-05-22 16:41:02 +02:00
|
|
|
##### Use, don't abuse
|
2022-11-06 20:16:01 +01:00
|
|
|
|
|
|
|
Our backend API runs in a cloud environment and while we do not charge for
|
|
|
|
access to the API, we do need to pay the bills of said cloud provider.
|
|
|
|
|
|
|
|
As such, please be mindful of the amount of requests you generate. And if you
|
|
|
|
have big plans, please reach out to us to discuss them first.
|
|
|
|
|
|
|
|
We will monitor the use of our backend API and we may at any moment decide to
|
|
|
|
revoke API keys if we feel the use is beyond what we can or want to support.
|
2023-05-22 16:41:02 +02:00
|
|
|
|
2024-09-28 13:13:48 +02:00
|
|
|
:::
|
2023-05-22 16:41:02 +02:00
|
|
|
|
|
|
|
## Database schema
|
|
|
|
|
|
|
|
The database schema for the backend is available in the [prisma.schema][prisma]
|
|
|
|
file in our monorepo.
|
|
|
|
|
|
|
|
## Under the hood
|
|
|
|
|
|
|
|
The FreeSewing backend is written in [NodeJS](https://nodejs.org/en/) on top of
|
|
|
|
[Express](https://expressjs.com/). It uses [Prisma](https://www.prisma.io/) to
|
|
|
|
interface with a [SQLite database](https://www.sqlite.org/) database,
|
|
|
|
[Sanity](https://www.sanity.io/) to store images, [AWS SES](
|
|
|
|
https://aws.amazon.com/ses/) to send out emails, and
|
|
|
|
[pino](https://github.com/pinojs/pino) for logging.
|
|
|
|
|