# @flexiblepersistence/backapi

> A simple API framework using Flexible Persistence

Latest version **0.1.18** (published 2021-01-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @flexiblepersistence/backapi
pnpm add @flexiblepersistence/backapi
yarn add @flexiblepersistence/backapi
bun add @flexiblepersistence/backapi
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.18 |
| Published | 2021-01-08 |
| First published | 2020-12-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 9 |
| Unpacked size | 78.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Judah Holanda Correia Lima |
| Maintainers | judahh |
| Keywords | api, api-framework, nodejs, typescript, javascript |

## Links

- npm: https://www.npmjs.com/package/@flexiblepersistence/backapi
- Repository: https://github.com/Judahh/backApi
- Homepage: https://github.com/Judahh/backApi#readme
- Issues: https://github.com/Judahh/backApi/issues
- npm.io page: https://npm.io/package/@flexiblepersistence/backapi

## Dependencies (9)

- [pg](https://npm.io/package/pg.md) latest
- [cors](https://npm.io/package/cors.md) latest
- [express](https://npm.io/package/express.md) latest
- [journaly](https://npm.io/package/journaly.md) latest
- [ts-mixer](https://npm.io/package/ts-mixer.md) latest
- [flexiblepersistence](https://npm.io/package/flexiblepersistence.md) latest
- [@flexiblepersistence/dao](https://npm.io/package/@flexiblepersistence/dao.md) latest
- [@flexiblepersistence/service](https://npm.io/package/@flexiblepersistence/service.md) latest
- [@flexiblepersistence/sequelize](https://npm.io/package/@flexiblepersistence/sequelize.md) latest

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.1.18 (latest) — 2021-01-08
- 0.1.17 — 2021-01-08
- 0.1.16 — 2021-01-07
- 0.1.15 — 2021-01-04
- 0.1.14 — 2021-01-04
- 0.1.13 — 2021-01-04
- 0.1.12 — 2020-12-30
- 0.1.11 — 2020-12-28
- 0.1.10 — 2020-12-28
- 0.1.9 — 2020-12-24
- 0.1.8 — 2020-12-21
- 0.1.7 — 2020-12-21
- 0.1.6 — 2020-12-21
- 0.1.5 — 2020-12-20
- 0.1.4 — 2020-12-20
- … 4 more at https://npm.io/package/@flexiblepersistence/backapi/versions

## README

# backApi

![Publish](https://github.com/Judahh/backApi/workflows/Publish/badge.svg)
[![npm version](https://badge.fury.io/js/@flexiblepersistence/backapi.svg)](https://badge.fury.io/js/@flexiblepersistence/backapi)
[![npm downloads](https://img.shields.io/npm/dt/@flexiblepersistence/backapi.svg)](https://img.shields.io/npm/dt/@flexiblepersistence/backapi.svg)

A simple API framework using Flexible Persistence

```js
const pool = new Pool(
((DBHandler.getReadHandler() as ServiceHandler)
    .persistence as SequelizeDB).getPersistenceInfo()
);
await Utils.init(pool);
const obj = {};
obj['test'] = 'test';
const handler = DBHandler.getHandler();
const controller = new TestController(DBHandler.getInit());

await ((DBHandler.getReadHandler() as ServiceHandler)
    .persistence as SequelizeDB)
    .getSequelize()
    .models.Test.sync({ force: true });
await handler.getWrite().clear('events');

const sentTest = new Test();
const sentTest2 = new Test();

const store = await controller.store(
    ({
    body: sentTest,
    } as unknown) as Request,
    (mockResponse as unknown) as Response
);
console.log('store:', store);
```

![Overview](./doc/overview.svg)

## Installation

This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/).

Before installing,
[download and install Node.js](https://nodejs.org/en/download/).

If this is a brand new project, make sure to create a `package.json` first with
the [`npm init` command](https://docs.npmjs.com/creating-a-package-json-file) or
[`yarn init` command](https://classic.yarnpkg.com/en/docs/cli/init/).

Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally)
or [`yarn add` command](https://classic.yarnpkg.com/en/docs/cli/add):

```bash
$ npm install @flexiblepersistence/backapi
```

or

```bash
$ yarn add @flexiblepersistence/backapi
```

## Tests

To run the test suite, first install Docker and dependencies, then run
`docker-compose up -d` and `npm test`:

```bash
$ docker-compose up -d
$ npm install
$ npm test
```

or

```bash
$ docker-compose up -d
$ yarn
$ yarn test
```

## People

The original author of Journaly is [Judah Lima](https://github.com/Judahh)

[List of all contributors](https://github.com/Judahh/backApi/graphs/contributors)

---
_Source: https://npm.io/package/@flexiblepersistence/backapi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
