Skip to content

ahmadarif/adonis4

Repository files navigation

Description


Build Status Coverage Status HitCount contributions welcome


Simple project Adonis 4.0

Requirements

  • NodeJS 8.0 or greater
  • NPM 3.0 or greater
  • AdonisJS 4.0 (npm i -g @adonisjs/cli)

Installations

  • Clone this project
  • Goto root folder and install dependency using command npm install
  • Copy .env.example to .env
  • Set your own configuration variable
  • Generate random secret key using command adonis key:generate
  • Start server development using command adonis serve --dev (development) or node server.js (production)

Development

  • Start Queue using command adonis kue:listen
  • Start Scheduler using command adonis run:scheduler
  • Create new Redis listener adonis make:listener ListenerName
  • Create new Scheduler adonis make:task SchedulerName
  • Other Adonis help adonis --help

Production

  • Use pm2 to start the server, use command pm2 start pm2-config.yml. If only single instance using command pm2 start server.js.
  • Run Queue and Scheduler using supervisor:
    • Copy supervisor-adonis4.conf to /etc/supervisor/conf.d/<COPY HERE>.
    • Reread supervisor using command supervisorctl reread.
    • Update process group using command supervisorctl update.
    • Run Queue process using command supervisorctl start adonis4-queue:*.
    • Run Scheduler using command supervisorctl start adonis4-scheduler:*.

Links

Notes

  • Manage your NodeJS & NPM version, please use NVM (Node Version Manager) like n or nvm-windows for simplicity.