MWGuy / shikimori

Home Page:https://shikimori.one

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RSpec CI

Contributing

Feel free to open tickets or send pull requests with improvements. Thanks in advance for your help!

Please follow the contribution guidelines.

Requirements

OSX or Linux

PostgreSQL >= 10.0, Ruby >= 2.6, NodeJS >= 10.0, Elasticsearch 6.x (7.0 not supported), Memcached, Redis

Issues Board (Agile Season)

https://agileseason.com/#/shared/board/098d2e36dff32f296d7815cf943ac8eb

Requirements

Checkout all projects

git clone git@github.com:shikimori/shikimori.git
git clone git@github.com:shikimori/neko-achievements.git
cd neko-achievements
mix local.hex --force
mix deps.get
cd ..
git clone git@github.com:shikimori/camo-server.git
cd camo-server
yarn
cd ..
git clone git@github.com:shikimori/faye-server.git
cd faye-server
yarn
cd ..
cd shikimori

Install yarn, tmux and overmind via Homebrew (OSX)

brew install yarn tmux overmind

In linux you have to install them another way.

Install dependent gems and npm packages

yarn install
bundle install

PostgreSQL

DB

psql -d postgres
create user shikimori_production;
create user shikimori_test;
alter user shikimori_production createdb;
alter user shikimori_test createdb;
alter user shikimori_production with superuser;
alter user shikimori_test with superuser;

Create databases

Make sure en_US.UTF-8 database collation is set https://gist.github.com/ffmike/877447#gistcomment-2851598

Or you manually initialize new database with command

initdb --pgdata=/usr/local/var/postgres-13 -E 'UTF-8' --lc-collate='en_US.UTF-8' --lc-ctype='en_US.UTF-8'

Create rails databases

rails db:create

Extensions

psql -d shikimori_test_
CREATE EXTENSION unaccent;
CREATE EXTENSION hstore;
CREATE EXTENSION pg_stat_statements;
psql -d shikimori_production
CREATE EXTENSION unaccent;
CREATE EXTENSION hstore;
CREATE EXTENSION pg_stat_statements;

Local Run

Everything you need to run is listed in Procfile. Shikimori uses Overmind to execute Procfile.

Restore from a backup

rails db:drop && rails db:create
unzip -d db/ db/dump.sql.zip
psql -U shikimori_production -d shikimori_production -f db/dump.sql
rm db/dump.sql
RAILS_ENV=test rails db:schema:load
# migrate dump to latest schema
rails db:migrate

Start rails server

rails server

Start related services

overmind start

Start some of related services

OVERMIND_PROCESSES=camo,faye overmind start

Elasticsearch

In rails console:

Elasticsearch::RebuildIndexes.new.perform

Update neko rules

rails neko:update

Other

Make a backup

pg_dump -c shikimori_production > db/dump.sql

Autorun rspec & rubocop

guard

Add new video hosting

# app/services/video_extractor/player_url_extractor.rb

Webpack debugger

https://nodejs.org/en/docs/inspector/ Install the Chrome Extension NIM (Node Inspector Manager): https://chrome.google.com/webstore/detail/nim-node-inspector-manage/gnhhdgbaldcilmgcpfddgdbkhjohddkj

RAILS_ENV=development NODE_ENV=development NODE_PATH=node_modules node --inspect-brk node_modules/.bin/webpack-dev-server --progress --color --config config/webpack/development.js

Webpack visualizer

https://chrisbateman.github.io/webpack-visualizer/

Dependabot

@dependabot ignore this dependency

About

https://shikimori.one

License:Open Software License 3.0


Languages

Language:Ruby 69.8%Language:Slim 13.5%Language:JavaScript 9.0%Language:Sass 6.4%Language:Vue 0.5%Language:SCSS 0.4%Language:HTML 0.3%Language:Pug 0.1%Language:CSS 0.0%Language:Procfile 0.0%Language:Shell 0.0%