How to Install Adonisjs in ubuntu
Adonisjs is a node js framework that run almost all major OS. It offers stable server side applications with good scalability. It also offers full stack development or micro API servers. So lets start how to install Adonisjs on ubuntu machine.
System Requirement & Installation
There are following methods to install the adonisjs –
1. Via Adonisjs CLI – we can install adonisjs by npm as –
$ npm i -h @adonisjs/cli
make sure to add the npm system-wide node_modules/.bin directory to your $PATH to be able to access the installed binary. One adonisjs is installed you can use adonisjs new command to create fresh installation of adonisjs.
create new <projectName>
2. Via git – We can directly fetch our boilerplates by using git.
# fullstack $ git clone --dissociate https://github.com/adonisjs/adonis-fullstack-app # API $ git clone --dissociate https://github.com/adonisjs/adonis-api-app # Slim git clone --dissociate https://github.com/adonisjs/adonis-slim-app
after cloning any of the boilerplate, install the dependencies by npm install command.
Running the Application
Once the installation process completed and all dependencies have been installed, you can go to that project directory using cd and then run the command to start the HTTP server –
$ adonisjs serve --dev
This command starts the server on the port. The port is defined inside the .env file inside the project directory.
Adonisjs contains directory structure as follows –
app : app folder contains controllers, middlewares and models.
config: config folder contains all configurations, database settings, session and sheild
database: it contains migration to create database tables from code
public: contain public content such as css,js etc
resources: contains view (edge) files
start: It contains routes file and kernel file