Pre-req:
- You have nodenv installed
Check the .node-version file in the root to see if you have the required version.
If you don't have the correct version, install it with:
nodenv install [version]
Check system requirements here.
Install Adonis globally:
npm i -g @adonisjs/cli
Create a .env file with the following env vars:
HOST=127.0.0.1
PORT=3333
NODE_ENV=development
APP_URL=http://${HOST}:${PORT}
CACHE_VIEWS=false
APP_KEY=
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_USER=root
DB_PASSWORD=
DB_DATABASE=adonis
SESSION_DRIVER=cookie
HASH_DRIVER=bcrypt
Generate an APP_KEY. This will populate APP_KEY= in your .env:
adonis key:generate
Run the application. Note: If you have a db error, you might need to set up mysql on your machine.
npm start
Run the db migration:
adonis migration:run
Visit http://127.0.0.1:3333/login
Run npm test
This is the fullstack boilerplate for AdonisJs, it comes pre-configured with.
- Bodyparser
- Session
- Authentication
- Web security middleware
- CORS
- Edge template engine
- Lucid ORM
- Migrations and seeds
Use the adonis command to install the blueprint
adonis new yardstickor manually clone the repo and then run npm install.
Run the following command to run startup migrations.
adonis migration:run