# adonisx

> The fastest way to create Rest API by defining database models and their relations.

Latest version **0.3.1** (published 2020-05-09) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install adonisx
pnpm add adonisx
yarn add adonisx
bun add adonisx
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2020-05-09 |
| First published | 2020-04-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 349.5 KB |
| Known vulnerabilities | 0 (+5 in 3 direct dependencies) |
| Install scripts | no |
| Author | Özgür Adem Işıklı |
| Maintainers | ozziest |
| Keywords | adonis, adonisx, api, rest |

## Links

- npm: https://www.npmjs.com/package/adonisx
- Repository: https://github.com/adonisx/adonisx
- Homepage: https://github.com/adonisx/adonisx#readme
- Issues: https://github.com/adonisx/adonisx/issues
- npm.io page: https://npm.io/package/adonisx

## Dependencies (11)

- [knex](https://npm.io/package/knex.md) ^0.20.13
- [pluralize](https://npm.io/package/pluralize.md) ^8.0.0
- [change-case](https://npm.io/package/change-case.md) ^4.1.1
- [@adonisjs/ace](https://npm.io/package/@adonisjs/ace.md) ^5.0.8
- [@adonisjs/vow](https://npm.io/package/@adonisjs/vow.md) ^1.0.17
- [@adonisjs/fold](https://npm.io/package/@adonisjs/fold.md) ^4.0.9
- [@adonisjs/lucid](https://npm.io/package/@adonisjs/lucid.md) ^6.1.3
- [@adonisjs/ignitor](https://npm.io/package/@adonisjs/ignitor.md) ^2.0.8
- [@adonisjs/framework](https://npm.io/package/@adonisjs/framework.md) ^5.0.13
- [@adonisjs/validator](https://npm.io/package/@adonisjs/validator.md) ^5.0.6
- [@adonisjs/bodyparser](https://npm.io/package/@adonisjs/bodyparser.md) ^2.0.9

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.3.1 (latest) — 2020-05-09
- 0.3.0 — 2020-05-01
- 0.2.2 — 2020-04-26
- 0.2.1 — 2020-04-24
- 0.2.0 — 2020-04-24
- 0.1.0 — 2020-04-23

## README

<h1 align="center">
  <br>
  <a href="https://adonisx.github.io">
    <img src="https://adonisx.github.io/logo.png" alt="Markdownify" width="200">
  </a>
  <br>
  AdonisX
  <br>
  <a href="https://travis-ci.org/adonisx/adonisx" target="_blank">
    <img src="https://travis-ci.org/adonisx/adonisx.svg?branch=master">
  </a>
  <a href="https://sonarcloud.io/dashboard?id=ozziest_apix" target="_blank">
    <img src="https://sonarcloud.io/api/project_badges/measure?project=ozziest_apix&metric=alert_status">
  </a>
  <a href="https://github.com/adonisx/adonisx/issues" target="_blank">
    <img src="https://img.shields.io/github/issues/adonisx/adonisx.svg">
  </a>
  <a href="https://opensource.org/licenses/MIT" target="_blank">
    <img src="https://img.shields.io/badge/license-MIT-blue.svg">
  </a>
</h1>

<h4 align="center" style="color: #444">
  The fastest way to create Rest API by defining database models and their relations.
</h4>

# Overview

> This project is under development and not ready for production.

**AdonisX** is the *fastest* way to create **Rest API** by defining only database models and their relationships between them. It is built on [AdonisJs](https://adonisjs.com), and it's an awesome ORM library, [Lucid](https://adonisjs.com/docs/4.1/lucid). AdonisX takes AdonisJs' power and speeds it up! It analyzes models and their relationships and creates all Rest API routes automatically.

You are going to be able to develop an API **10 times faster!**

[Full Documentation](https://adonisx.github.io)

## How It Works?

**AdonisX** uses the basic structure of *AdonisJs*. It is a [Service Provider](https://adonisjs.com/docs/4.1/service-providers) which works in the initialization process of an AdonisJs application. It performs two basic functions;

- **Analyzes** your models and their relationships to create routes (*Initialization*)
- **Handles** all HTTP requests with a shared Controller (*Processing*)

Let's assume that you have a model like this;

```js
const XModel = use('AdonisX/Models/XModel')

class User extends XModel {

}
```

With this model, you will have all of the endpoints for **users** resource. **AdonisX** will create **CRUD** routes for you in the *initialization* and routes will be completely ready to be handled and processed by the shared controller.

If you execute **adonis route:list** command in your terminal, you can see all routes which have been created by **AdonisX**. 

![Adonis Routes](https://adonisx.github.io/images/03-routes.jpg)

All these requests will be handled by **MainController**. **MainController** is a controller which is controlled by **AdonisX**. It *handles* requests for all models. It is responsible to prepare a *response* for the user by model definitions. In model definitions, you can decide many things such as *form validation*, *custom middlewares* and *, etc*.

When you visit `/api/users` URL in your browser, you can see **AdonisX** is responding your request;

![Adonis Routes](https://adonisx.github.io/images/01-paginate.jpg)

With AdonisX, you **don't** have to code for all CRUD actions. You **don't** have to implement advanced query features. The only thing to do is **defining models** and **their relations** between each other. That's all! <Emoji code="1f389"></Emoji>

[Full Documentation](https://adonisx.github.io)

## Key Features

- Automatic route creating
- Automatic route handling
- Form validation support
- Middlewares
- Strong query features
- Recursive resources
- The extendable business logic structure
- Multiple database support (Postgres, MSSQL, MySQL, MariaDB, SQLite3, Oracle, and Amazon Redshift)
- Well documented

## Getting Started

To clone and run this application, you'll need [Git](https://git-scm.com/), [Node.js](https://nodejs.org) and [nodemon](https://www.npmjs.com/package/nodemon) installed on your computer. From your command line:

```bash
$ npm install -g @adonisjs/cli adonisx-cli
$ adonisx new
$ cd adonisx-example
$ yarn
$ adonis migration:run
$ yarn serve

nodemon server.js
[nodemon] 2.0.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node server.js`
info: serving app on http://127.0.0.1:3333
```

That's all! Your API is ready to develop!

## Documentation

Do you need more? Check the awesome [documentation](https://adonisx.github.io).

## Contributing

Please take a look at our [contributing](https://adonisx.github.io/01-introduction/#contribution-guide) guidelines if you're interested in helping!

## License

[MIT License](LICENSE)

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