Adonis Fullstack App Template
Go to file Use this template
Romain Lanz 8e46d02ed1
feat: add NoTimestamp trait + ConvertEmptyStringsToNull middleware (#30)
Hey! 👋 

This PR add some middleware and traits by default.

**Middleware**:

- `AllowGuestOnly` throws an exception if you are authenticated.
- `ConvertEmptyStringsToNull` converts empty strings in the request body to `null`

**Trait**:

- `NoTimestamp` removes the need for `created_at` and `updated_at` fields.
- `FormatDate` formats the date following a convention.

**FormatDate**

The convention is:
- Ends with `_at` => DateTime
- Ends with `_on` => Date

You can change the format you use in your UI with two getters.

```js
class MyModel extends Model {
  static get formatDate () { return 'DD.MM.YYYY' }
  static get formatDateTime () { return 'DD.MM.YYYY HH:mm' }
}
```

You can also directly change default values inside the Trait since it is a user Trait and not defined in the core.

<hr>

If this is merged, I'll provide the same PR to the `API` blueprint.
2019-01-02 10:10:56 +01:00
app feat: add NoTimestamp trait + ConvertEmptyStringsToNull middleware (#30) 2019-01-02 10:10:56 +01:00
config fix(session): cookie sameSite must be false 2018-10-01 20:25:43 +02:00
database feat(intellisense): add type comments 2018-09-15 09:37:07 +02:00
public feat(views): link to the doc (#34) 2018-12-27 08:47:12 +01:00
resources/views feat(views): link to the doc (#34) 2018-12-27 08:47:12 +01:00
start feat: add NoTimestamp trait + ConvertEmptyStringsToNull middleware (#30) 2019-01-02 10:10:56 +01:00
.editorconfig feat(*) initial commit 2017-08-20 22:39:25 +05:30
.env.example chore(env): remove default APP_KEY 2018-06-06 09:11:41 +02:00
.gitignore chore: remove package-lock 2018-09-22 10:05:51 +02:00
ace feat(*) initial commit 2017-08-20 22:39:25 +05:30
package.json chore(package): update dependencies 2018-10-01 20:25:43 +02:00
README.md feat(*) initial commit 2017-08-20 22:39:25 +05:30
server.js feat(*) initial commit 2017-08-20 22:39:25 +05:30

Adonis fullstack application

This is the fullstack boilerplate for AdonisJs, it comes pre-configured with.

  1. Bodyparser
  2. Session
  3. Authentication
  4. Web security middleware
  5. CORS
  6. Edge template engine
  7. Lucid ORM
  8. Migrations and seeds

Setup

Use the adonis command to install the blueprint

adonis new yardstick

or manually clone the repo and then run npm install.

Migrations

Run the following command to run startup migrations.

adonis migration:run