Simple project Adonis 4.0
- 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) ornode server.js
(production)
- 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
- Use pm2 to start the server, use command
pm2 start pm2-config.yml
. If only single instance using commandpm2 start server.js
. - Run Queue and Scheduler using supervisor:
- Copy supervisor-adonis4.conf to
/etc/supervisor/conf.d/<COPY HERE>
. - Reread
supervisor
using commandsupervisorctl 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:*
.
- Copy supervisor-adonis4.conf to
- Manage your NodeJS & NPM version, please use NVM (Node Version Manager) like n or nvm-windows for simplicity.