A test task: create an app for artworks using Rails and VueJS. These are two applications: Rails API in the backend and VueJS in the frontend.
To find out how to integrate Rails API with VueJS app.
I managed to deploy it to Heroku so the results are all here. Heroku doesn't allow several dynos for free, so I had to create two separate Heroku apps, and the SPA fires requests to the API app. As I stored pictures in the Rails public folder, they are not reachable with Heroku. It took me much longer to properly deploy it there and set up the endpoints than the development itself.
- Ruby 2.4.0
- PostgreSQL 8+
- Node and npm
- imagemagick for paperclip attachments:
$ sudo apt-get install imagemagick libmagickwand-dev
$ bin/setup
This will install gems and npm packages, create database.yml file for you and will fail at creating the DB.
You will have to change the database.yml and then rerun bin/setup
.
$ npm run dev
This will launch a Puma instance at http://localhost:3000 and a Webpack-dev-server at http://localhost:9000 for you.