Giter Club home page Giter Club logo

adonisjs-template's Introduction

adonisjs-template

This is a boiler plate for building nodejs/adonisjs api

Requirements

  • npm >= 7.6.2
  • node >= 15.11.0
  • the version of adonis use is 5.0.4 preview without the above requirement, the app may not work

Setup

  • clone
  • install dependencies: npm install
  • create .env and save it at the root of the project
  • copy the content of env.example into .env
    • set it up according to your credential
    • the app has been configured prior for MySQL/MariaDb, to change this and get credential for other databases
    • do node ace invoke @adonisjs/lucid
      • select a database
      • choose where you want to see the default credentail and instruction: preferebaly I used terminal
      • follow the instruction for your chosen database credential
  • generate api: node ace generate:key
    • copy the generated string into your .env and make it equal to or assign it to the key: APP_KEY
  • Set up your local or remote database
    • Run migration: node ace migration:run
  • start the server with: node ace serve --watch
    • the server will start at: localhost:3333

Resource | Routes

Users

  • localhost:3333/api/v1/users
    • / method: Post Create user

    • request data

      {
        "email": "[email protected]"
        "password": "secret-password"
      }
      
    • response

      {
        "success": true,
        "message": "some message",
        "data": {
          "user": {*},
          "token": {*}
        }
      }
      
    • /login method: Post { "token": "some-string "}

    • /logout method: Post

      • request Header: { "Application": "Bearer some-string-token-string" }
      {
        "success": true,
        "message": "logged out"
      }
      

adonisjs-template's People

Contributors

ezehlivinus avatar

Watchers

 avatar  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.