This project features an integrated Adonis/Nuxt full-stack application created as a starter template for Progressive Web Applications(PWAs).
Featuring a full user module, example CRUD resources, and web optimization, this starter project pre-installs and configures a lot of common needs for you out of the box. It was built with the intent to give the developer a powerful base starting point with a lot of things every app needs set up for you.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Clone the repo locally
git clone [email protected]:jbratcher/Adonis-Nuxt-Starter.git myProject
Install the dependencies
cd myProject && npm install
Run the server
adonis serve --dev
Run the client
npm run dev
You will need to have Node and npm installed.
Once the above steps are complete, you should create a .env
file.
cp .env.example .env
The .env
file is where you will tell Adonis your database and mail settings.
By default, this project uses PostgreSQL for the data layer but this can be easily changed in the .env
file.
DB_CONNECTION=pg
DB_HOST=127.0.0.1
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=
DB_DATABASE=adonis_nuxt_starter
If you use another database type, you will need to install the appropriate driver.
The default mail settings use smtp through gmail.
In .env
:
MAIL_CONNECTION=smtp
SMTP_PORT=465
SMTP_HOST=smtp.gmail.com
MAIL_USERNAME=youraddress@gmail.com
MAIL_PASSWORD=Y0urPa$$w0rd!
The Gmail SMTP provider was chosen to provide a free and simple mailer for starter projects. This provider is limited to sending 500 emails per day. You may also need to change your Gmail account settings in regards to allowing your local development environment interact with this service.
An environment variable is used to set the URL of the client (front-end) for easy deployment. This variable must be set locally for some features to work.
.env
CLIENT_APP_URL = http://localhost:3000
After your database is set up, you should run migrations. This will allow you to manage users and use CRUD operations for the example resources.
In the terminal:
adonis migration:run
The project does come with some faked resource data in a seeder. If you would like to auto populate this data, make sure to run migrations with the seed flag.
adonis migration:run --seed
At this point you should be able to start customizing the application to your requirements.
-
User Module
- Register, login, logout, and manage user profiles
- New registration email with link to verify account
- Forgot password/password reset
- Authentication and Authorization synced between client and server
-
Example CRUD
- Adonis migration, model and controller
- Adonis CRUD routes
- PostgreSQL database with example resource table
- Nuxt CRUD operations with Vuex methods
# build for production and launch server
npm run build
npm run start
# generate static project
npm run generate
# from app root
cd server
npm run deploy
For detailed explanation on how things work, check out Nuxt.js docs.