Code Monkey home page Code Monkey logo

chess-database's Introduction

chess-database

Web site. Save chess games.

See

Chess Database

Get Started

  • docker-compose build
  • docker-compose run web rails db:create
  • docker-compose run web rails db:migrate
  • docker-compose up
  • open http://localhost:3001

In Production

  • copy config/master.key (this file is ignored from git)
    • or you can recreate credentials.yml.enc and master.key:
      • rm credentials.yml.enc
      • docker-compose run -e EDITOR=vim web rails credentials:edit
        • you need to set Rails.application.credentials variables
  • docker-compose -f docker-compose.production.yml build
  • docker-compose -f docker-compose.production.yml run web rails db:create RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1
  • docker-compose -f docker-compose.production.yml up -d
  • when nginx exit before web started: docker-compose -f docker-compose.production.yml up -d nginx

Development

  • generate Home controller docker-compose run web rails g controller Users

after you change something

  • docker-compose run web bundle install
  • docker-compose up --build

before Pull Request

  • docker-compose run web rubocop -A
  • docker-compose run web rails test

sitemap

We use sitemap_generator.

Generate public/sitemap.xml.gz file by

  1. rake sitemap:install.
  2. rake sitemap:refresh.

This file is ignored by git.

create players DB

from chess ranking site docker-compose run web rake player:fetch_players

or from csv file

  1. mv lib/runner/players.tmp.csv lib/runner/players.csv
  2. docker-compose run web rails runner lib/runner/adder.rb

pry

  1. set binding.pry
  2. check container id: docker ps
  3. docker attach container_id
  4. open browser
  5. exit
  6. Ctrl + q

images

ogp: https://unsplash.com/ja/%E5%86%99%E7%9C%9F/G1yhU1Ej-9A

iframe example

iframe parent page

Backup Database

  1. docker-compose run web bash
  2. pg_dump -h db -p 5432 -U postgres chess_database_development > /chess_database/backup/2023-11-14.psql

restore

  1. create database chess_database_development (or do it using rails)
  2. psql -h db -p 5432 -U postgres d2 < /chess_database/backup.psql

chess-database's People

Contributors

st34-satoshi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.