2

First thing i am very new in Vue, adonis and heroku. so please tell me all the steps in answer

i have a project build in vuejs(frontend) and adonisjs api-only and i want to deploy this project on heroku with postgresql database.

What i am done till now:-

1). create a heroku account 2). create a project on heroku 3). upload frontend dist/ folder on heroku using these command

git add --all
git commit -m "initial commit"
git push heroku master

And my frontend run perfectly but i don't know how to deploy backend and how to create database in heroku.

my working directories are

working directory

IT MAIL
  • 101
  • 6

1 Answers1

1

To deploy the back-end application you can do the same steps as you did for the other application.

Here's what's changing:

Interesting things to know:

To execute Adonis commands : node ace <your_command> (node ace migration:run) run console - heroku

I advise you to use the heroku environment variables. Don't forget to add the variable ENV_SILENT = true to avoid errors because of the.env file. heroku variables

Get connection db informations: (on your postgresql add-on): db credentials

Some additional information

Personal project deployed on heroku (.gitlab-ci.yml) : https://gitlab.com/CrBast/website

Interesting article : https://scotch.io/tutorials/deploying-adonisjs-apps-to-heroku

If my explanations are not clear, don't hesitate to tell me :)

crbast
  • 2,192
  • 1
  • 11
  • 21
  • 1
    What are the changes require in config/database.js for postgresql database – IT MAIL Dec 05 '19 at 02:27
  • 1
    my Procfile look like release: ENV_SILENT=true node ace migration:run --force web: ENV_SILENT=true npm start but then it give error when run command RuntimeException: E_MISSING_ENV_KEY: Make sure to define environment variable APP_KEY. > More details: https://err.sh/adonisjs/errors/E_MISSING_ENV_KEY – IT MAIL Dec 05 '19 at 03:31
  • 1
    `What are the changes require in config/database.js for postgresql database`: nothing, just update your environement variables – crbast Dec 05 '19 at 08:38
  • 1
    `my Procfile look like release: ENV...`: make sure to have this variables (not SENDGRID_USERNAME+SENDGRID_USERNAME) : https://ibb.co/h1THvdS – crbast Dec 05 '19 at 08:46
  • 1
    `"bash: node: command not found" in run console of heroku`: What order did you execute? What result does this command give you `node -v`? – crbast Dec 05 '19 at 08:49
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/203657/discussion-between-it-mail-and-crbast). – IT MAIL Dec 05 '19 at 09:42