Skip to content

harayama2/rails-nuxt-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

Rails API + Nuxt on Docker.

Image from Gyazo

Setup

$ mkdir YOUR_PROJECT
$ cd YOUR_PROJECT
$ git clone [email protected]:harayama-developmer/rails-nuxt-template.git .

$ rm -rf .git/

# Rails Setup
$ rm backend/config/credentials.yml.enc
$ docker-compose run --rm backend rails credentials:edit
#=> create  config/master.key

# Nuxt Setup
$ touch frontend/.env
#=> Edit .env below
# BASE_URL=http://localhost:3000
# API_URL=http://backend:3000
# API_URL_BROWSER=http://localhost:3000

$ docker-compose build
$ docker-compose run --rm backend bundle exec rails db:setup
$ docker-compose up

Access in browser!

Sample CRUD page

http://localhost:8080/events

Table:

create_table "events", force: :cascade do |t|
  t.string "name"
  t.datetime "created_at", precision: 6, null: false
  t.datetime "updated_at", precision: 6, null: false
end

Image from Gyazo