Git Product home page Git Product logo

api-starter-kit's Introduction

AdonisJS API Starter Kit

This repo contains an AdonisJS application tailored for building an API server that responds with JSON.

What's included

  • TypeScript setup with commands to run developments server using ts-node + swc and create production build.
  • ESLint and Prettier setup extending the AdonisJS tooling config presets.
  • Ace command line framework.
  • Everything else you get with the core of AdonisJS.

On top of the framework core and dev-tooling, the following features are enabled by the API starter kit.

  • Lucid ORM ( Installed, but not configured )
  • Auth module ( Installed, but not configured )
  • CORS
  • VineJS for validations

Usage

You can create a new app using the api boilerplate by executing the following command. The command will perform the following steps.

  • Clone the repo
  • Install dependencies
  • Copy .env.example to .env
  • Set app key using node ace generate:key command.
  • Configure @adonisjs/lucid package.
  • Install and configure @adonisjs/session package (if using auth session guard).
  • Configure @adonisjs/auth package.
npm init adonisjs -- -K=api

Configuring Lucid database dialect

By default, the npm init adonisjs command configures Lucid to use sqlite. However, you can define a custom database dialect as follows.

npm init adonisjs -- -K=api --db=postgres

Available options for the --db flag.

  • sqlite
  • postgres
  • mysql
  • mssql

Configuring Auth package guard

By default, the npm init adonisjs command configures the Auth package to use session guard. However, you can define a custom auth guard as follows.

npm init adonisjs -- -K=api --auth-guard=access_tokens

Available options for the --auth-guard flag.

  • session
  • basic_auth
  • access_tokens

api-starter-kit's People

Contributors

thetutlage avatar julien-r44 avatar arthurmtro avatar romainlanz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.