All Projects → Julien-R44 → adonis-sail

Julien-R44 / adonis-sail

Licence: MIT license
⛵Generate a ready-to-use local docker environment for your Adonis application

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to adonis-sail

Adonis Bumblebee
Api Transformer for AdonisJs Framework
Stars: ✭ 125 (+247.22%)
Mutual labels:  adonisjs
saas-react-starter-kit-boilerplate
SaaStr is a React SaaS boilerplate to kickstart your new SaaS adventure as fast as possible. Built on top of Adonis JS for the BackEnd and React Starter Kit for the Front-End
Stars: ✭ 100 (+177.78%)
Mutual labels:  adonisjs
youtube-adonisjs-iniciando
Project created in the AdonisJS video
Stars: ✭ 16 (-55.56%)
Mutual labels:  adonisjs
Leaguestats
📈 League of Legends Stats Web App
Stars: ✭ 172 (+377.78%)
Mutual labels:  adonisjs
create-adonis-ts-app
Boilerplate to create a new AdonisJs typescript project
Stars: ✭ 94 (+161.11%)
Mutual labels:  adonisjs
adonis-lucid-soft-deletes
Addon for soft deletes AdonisJS Lucid ORM
Stars: ✭ 55 (+52.78%)
Mutual labels:  adonisjs
Adonis Lucid Filter
Addon for filtering AdonisJS Lucid ORM
Stars: ✭ 67 (+86.11%)
Mutual labels:  adonisjs
adonisjs-laravel-mix
An AdonisJs fullstack application blueprint with Laravel Mix
Stars: ✭ 17 (-52.78%)
Mutual labels:  adonisjs
gavn
Invoice System for Freelancers as a Single Page Application built with AdonisJs and Vue.js
Stars: ✭ 54 (+50%)
Mutual labels:  adonisjs
electro
A free and open-source Automatic Account Creator (AAC) written in Javascript Stack;
Stars: ✭ 20 (-44.44%)
Mutual labels:  adonisjs
Adonis Acl
demo app: https://github.com/enniel/adonis-acl-blog-demo
Stars: ✭ 195 (+441.67%)
Mutual labels:  adonisjs
Moviepark
A Nuxt universal app with an Adonis 5 api server using the TMDb API for its movie catalog.
Stars: ✭ 32 (-11.11%)
Mutual labels:  adonisjs
adonis-fcm
Firebase Cloud Messaging for AdonisJS
Stars: ✭ 19 (-47.22%)
Mutual labels:  adonisjs
Adonisjs Hackathon Starter
A boilerplate for AdonisJS web framework
Stars: ✭ 142 (+294.44%)
Mutual labels:  adonisjs
XENA
XENA is the managed remote administration platform for botnet creation & development powered by blockchain and machine learning. Aiming to provide an ecosystem which serves the bot herders. Favoring secrecy and resiliency over performance. It's micro-service oriented allowing for specialization and lower footprint. Join the community of the ulti…
Stars: ✭ 127 (+252.78%)
Mutual labels:  adonisjs
Adonis Adminify
Admin dashboard based on AdonisJs + Adminify (based on vuetify)
Stars: ✭ 90 (+150%)
Mutual labels:  adonisjs
gerar-boletos
Biblioteca em Node.js para geração de boletos utilizando PDFKit.
Stars: ✭ 81 (+125%)
Mutual labels:  adonisjs
server
👨🏾‍🍳 Server for Ferdi that you can re-use to run your own
Stars: ✭ 26 (-27.78%)
Mutual labels:  adonisjs
adonisjs-create-react-app
Adonisjs + Create React App Boilerplate
Stars: ✭ 22 (-38.89%)
Mutual labels:  adonisjs
adonis-support-ticket
A support ticket application in AdonisJs
Stars: ✭ 28 (-22.22%)
Mutual labels:  adonisjs

Adonis Sail

Generate a ready-to-use local docker environment for your Adonis application

Installation

npm i --save-dev adonis-sail
node ace configure adonis-sail

Available services

  • PostgreSQL
  • MySQL
  • Redis
  • MinIO
  • MailHog

Usage

Make sure to install needed Adonis Package, and follow instructions before running Sail's commands. @adonisjs/redis, @adonisjs/lucid, @adonisjs/drive-*, @adonisjs/mail.

Now you can set your environment variables. Many of these will also be used in the generated docker-compose (look inside once created to know which ones). Especially the *_PORT or *_PASSWORD.

Once this is done you can run the command node ace sail:install and select the services you want. A docker-compose.yml file will be created at the root of your project, you now just have to launch it by doing docker-compose up -d.

You can launch again the node ace sail:install command at any time to add new services.

MinIO

If you plan to use Amazon S3 to store files while running your application in its production environment, you may wish to install the MinIO service when installing Sail. MinIO provides an S3 compatible API that you may use to develop locally using Adonis's s3 storage driver without creating "test" storage buckets in your production S3 environment. If you choose to install MinIO while installing Sail, a MinIO configuration section will be added to your application's docker-compose.yml file.

You will need to install the official Adonis drive-s3 package to use MinIO locally. So install the package by following the documentation correctly, then in your .env file, use these variables :

S3_KEY=sail
S3_SECRET=password
S3_BUCKET=local
S3_REGION=us-east-1
S3_ENDPOINT=http://localhost:9000

And add this to config/drive.ts :

...
  s3: {
      forcePathStyle: true, // 👈 Don't forget this !
      key: Env.get('S3_KEY'),
      secret: Env.get('S3_SECRET'),
      region: Env.get('S3_REGION'),
      bucket: Env.get('S3_BUCKET'),
      endpoint: Env.get('S3_ENDPOINT'),
  }
...

You can now use the @adonisjs/drive-s3 package to store and fetch files like you would do normally on a real AWS bucket. You can also access MinIO dashboard at : http://localhost:8900/dashboard

Databases

To connect to your application's databases from your local machine, you may use a graphical database management application such as TablePlus. By default, exposed ports are :

  • MySQL: 3306
  • PostgreSQL: 5432
  • Redis: 6379

MailHog

MailHog intercepts emails sent by your application during local development and provides a convenient web interface so that you can preview your email messages in your browser. To use MailHog install install the official Adonis Mailer package. Follow the installation instructions, and select SMTP when prompted. You have to set theses variables in your .env file :

SMTP_HOST=localhost
SMTP_PORT=1025
SMTP_USERNAME=
SMTP_PASSWORD=

In config/mail.ts, remove the auth part in the smtp configuration object.

...
  smtp: {
    driver: 'smtp',
    host: Env.get('SMTP_HOST'),
    port: Env.get('SMTP_PORT'),
  },
...

You can now access the MailHog dashboard at http://localhost:8025/ to preview emails.

Known issues

MySQL 8

If you are using MySQL 8 (the default image), and you encounter the following error:

ER_NOT_SUPPORTED_AUTH_MODE: 
  Client does not support authentication protocol requested by server; consider upgrading MySQL client 

You need to install mysql2 :

npm install mysql2

And now configure Adonis to use it, in config/database.ts :

...
mysql: {
  client: 'mysql2' // 👈 Set this to 'mysql2'
  connection: {
    user: Env.get('MYSQL_USER'),
    password: Env.get('MYSQL_PASSWORD'),
    database: Env.get('MYSQL_DB_NAME'),
  },
...

Details

Currently, the Adonis application is not dockerised. I rarely encountered problems on my applications depending on the version of Node.JS I use (it happens, but with a tool like nvm it's usually fixed pretty quickly). And it's obviously easier to handle your Adonis application when it's running outside a docker container. That's why I decided not to dockerise the Adonis app.

If you think it's really necessary to dockerise the Adonis application in local development, let me know and we'll see what we can do !

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].