@backan/core
Version:
All in one web API builder. Create endpoints with type validations and OpenApi documentation, safely and quickly.
282 lines (191 loc) ⢠13.7 kB
Markdown
# š„ Backan - Core
All in one web API builder.
<!-- PIGEONPOSSE START HEADER -->
[](https://backan.pigeonposse.com/)
[](https://pigeonposse.com)
[](https://pigeonposse.com?popup=about)
[](https://pigeonposse.com/?popup=donate)
[](https://github.com/pigeonposse)
[](https://twitter.com/pigeonposse_)
[](https://www.instagram.com/pigeon.posse/)
[](https://medium.com/@pigeonposse)
[](/LICENSE)
[](https://www.npmjs.com/package/backan)
[**BACKAN**](https://backan.pigeonposse.com/) Create endpoints with type validations and OpenApi documentation, safely and quickly.
<!-- PIGEONPOSSE END HEADER -->
> This package contains **_BACKAN_** Core library
<!-- PIGEONPOSSE START DOCS -->
## Table of Contents
- [š Installation](#-installation)
- [Install only `core`](#install-only-core)
- [Setup](#setup)
- [Create `App` instace](#create-app-instace)
- [Create `Route`](#create-route)
- [Add `Endpoints`](#add-endpoints)
- [What is BACKAN?](#what-is-backan)
- [Project intention](#project-intention)
- [Contains](#contains)
- [Todo](#todo)
- [What is `backan` built with?](#what-is-backan-built-with)
- [š Get started with `Backan`](#-get-started-with-backan)
- [šļø Get started with `Backan` server](#-get-started-with-backan-server)
- [š¦ Build your project](#-build-your-project)
Start building your restAPI app now š.
## š Installation
```bash [npm]
npm install backan
```
```bash [pnpm]
pnpm add backan
```
```bash [yarn]
yarn add backan
```
```bash [bun]
bun add backan
```
[](https://www.npmjs.com/package/backan)
### Install only `core`
```bash [npm]
npm install @backan/core
```
```bash [pnpm]
pnpm add @backan/core
```
```bash [yarn]
yarn add @backan/core
```
```bash [bun]
bun add backan
```
[](https://www.npmjs.com/package/@backan/core)
## Setup
You can automatically create a `backan` template with:
```bash [npm]
npm create backan
```
```bash [pnpm]
pnpm create backan
```
```bash [yarn]
yarn create backan
```
```bash [bun]
bun create backan
```
[Read more](https://backan.pigeonposse.com/guide/create/index)
## Create `App` instace
[Read more](https://backan.pigeonposse.com/guide/core/app)
## Create `Route`
[Read more](https://backan.pigeonposse.com/guide/core/route)
## Add `Endpoints`
- [GET](https://backan.pigeonposse.com/guide/core/get)
- [POST](https://backan.pigeonposse.com/guide/core/post)
- [STREAM](https://backan.pigeonposse.com/guide/core/stream)
## What is BACKAN?

**`BACKAN`** is a library designed to build **REST API** applications quickly and easily.
> [!IMPORTANT]
> Currently in phase `Beta`
> The library can be used perfectly in production, but could undergo changes and new features until version `1`.
> To avoid ongoing maintenance issues, we recommend installing a fixed version (without `^`) in your project.
## Project intention
Our project is not intended to be a substitute for any web framework. Our library aims to cover a specific use case, that of building APIs, simplifying this process as much as possible and creating APIs in a robust way.
The creation of this project is also due to the need of our [collective](htpps://pigeonposse.com) to create APIs with good documentation and in a simple way, an example of this is the Api section of [`bepp`](https://github.com/pigeonposse/bepp/tree/main/packages/api) (a web extension packager).
## Contains
- ā
Simple `data validation`, so that your endpoints are as secure as possible and reduce repetitive code (boilerplate).
- ā
Built-in and almost `automatic OpenAPI documentation`, improving the visibility of our API without the need to import other projects.
In addition, **BACKAN** also provides:
- A backan project creator with templates of greater and lesser complexity. [Read more](https://backan.pigeonposse.com/guide/core/index.md#setup)
- Configuration to create your [Node server](https://backan.pigeonposse.com/guide/server/index), perfect for running your application without having to configure anything. [Read more](https://backan.pigeonposse.com/guide/server/index)
- Tool to build the binary of your application, ideal for running the app without the need for a Node.js environment. [Read more](https://backan.pigeonposse.com/guide/builder/index)
> [!note]
> The documentation is under construction. Soon, we will write all the points it contains
## Todo
- š” Typing for make your frontend projects more easy.
[Read more](https://backan.pigeonposse.com/guide/todo/v1)
## What is `backan` built with?
Our library is built under the `hono` framework, which is why you will see references to it in our documentation and our code. **BACKAN** is an implementation that aims to simplify the construction of apirest for specific use cases.
You want to build an apirest quickly and safely and without thinking about third-party implementations, well here we propose our [alternative](https://backan.pigeonposse.com/guide/core/index).
## š Get started with `Backan`
Start building your restAPI app now š.
[Read more](https://backan.pigeonposse.com/guide/core/index)
## šļø Get started with `Backan` server
[Read more](https://backan.pigeonposse.com/guide/server/index)
## š¦ Build your project
The backan builder library allows you to build multiple things. Among others:
- [**`Executables / binaries`**](https://backan.pigeonposse.com/guide/builder/index.md#build-binaries): Create binaries of your project for all **systems** and **architectures** with zero config.
- [**`Client library`**](https://backan.pigeonposse.com/guide/builder/index.md#create-client): Create a client to facilitate the implementation of the API in a frontend or other service.
- [**`JSON schema file`**](https://backan.pigeonposse.com/guide/builder/index.md#build-json-types-schema): Export the **OpenAPI schema** to a **JSON file**.
- [**`TypeScript definitions file`**](https://backan.pigeonposse.com/guide/builder/index.md#build-json-types-schema): Export **OpenAPI schema** to a **d.ts file**.
- [**`Markdown documentation`**](https://backan.pigeonposse.com/guide/builder/index.md#build-markdown-documentation): Build your application documentation in a **Markdown file**.
[Read more](https://backan.pigeonposse.com/guide/builder/index)
<!-- PIGEONPOSSE END DOCS -->
<!-- PIGEONPOSSE START INDEX -->
## More from Backan
- [Documentation](https://backan.pigeonposse.com/)
- š [Library](https://backan.pigeonposse.com/guide/core)
- š [Create (setup)]( https://backan.pigeonposse.com/guide/create )
- šļø [Server]( https://backan.pigeonposse.com/guide/server )
- š¦ [Builder]( https://backan.pigeonposse.com/guide/builder )
- [Installation](https://backan.pigeonposse.com/guide/core/#installation)
<!-- PIGEONPOSSE END INDEX -->
<!-- PIGEONPOSSE START ORG -->
## šØāš» Development
**BACKAN** is an open-source project and its development is open to anyone who wants to participate.
[](https://github.com/pigeonposse/backan/issues)
[](https://github.com/pigeonposse/backan/pulls)
[](https://backan.pigeonposse.com/)
## ā Donate
Help us to develop more interesting things.
[](https://pigeonposse.com/?popup=donate)
## š License
This software is licensed with **[GPL-3.0](/LICENSE)**.
[](/LICENSE)
## š¦ About us
_PigeonPosse_ is a ⨠**code development collective** ⨠focused on creating practical and interesting tools that help developers and users enjoy a more agile and comfortable experience. Our projects cover various programming sectors and we do not have a thematic limitation in terms of projects.
[](https://github.com/pigeonposse)
### Collaborators
| | Name | Role | GitHub |
| ---------------------------------------------------------------------------------- | ----------- | ------------ | ---------------------------------------------- |
| <img src="https://github.com/angelespejo.png?size=72" alt="Angelo" style="border-radius:100%"/> | Angelo | Author & Development | [@Angelo](https://github.com/angelespejo) |
| <img src="https://github.com/PigeonPosse.png?size=72" alt="PigeonPosse" style="border-radius:100%"/> | PigeonPosse | Collective | [@PigeonPosse](https://github.com/PigeonPosse) |
<br>
<p align="center">
[](https://pigeonposse.com)
[](https://pigeonposse.com?popup=about)
[](https://pigeonposse.com/?popup=donate)
[](https://github.com/pigeonposse)
[](https://twitter.com/pigeonposse_)
[](https://www.instagram.com/pigeon.posse/)
[](https://medium.com/@pigeonposse)
</p>
<!-- PIGEONPOSSE END ORG -->
<!-- PIGEONPOSSE START MARK -->
<!--
āāāāāāā āāā āāāāāāā āāāāāāāā āāāāāāā āāāā āāā
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāā āāā
āāāāāāāāāāāāāā āāāāāāāāāā āāā āāāāāāāāā āāā
āāāāāāā āāāāāā āāāāāāāāā āāā āāāāāāāāāāāāā
āāā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā āāāāāā
āāā āāā āāāāāāā āāāāāāāā āāāāāāā āāā āāāāā
āāāāāāā āāāāāāā āāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāā āāā āāāāāāāāāāāāāāāāāāāāāāāāā
āāā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāā āāāāāāā āāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāā āāāāāā āāāāāāāāāā āāā āāāāāā āāāā āāā
āāāāāāāāāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāā āāā
āāāāāāāāāāāāāāāāāāā āāāāāāā āāāāāāāāāāāāāā āāā
āāāāāāāāāāāāāāāāāāā āāāāāāā āāāāāāāāāāāāāāāāāā
āāāāāāāāāāā āāāāāāāāāāāāāā āāāāāā āāāāāā āāāāāā
āāāāāāā āāā āāā āāāāāāāāāā āāāāāā āāāāāā āāāāā
REPOSITORY: https://github.com/pigeonposse/backan
AUTHORS:
- Angelo (https://github.com/angelespejo)
DEVELOPED BY Angelo š¦š
-->
<!-- PIGEONPOSSE END MARK -->