Feel free to open tickets or send pull requests with improvements. Thanks in advance for your help!
Please follow the contribution guidelines.
OSX or Linux
PostgreSQL >= 10.0, Ruby >= 2.6, NodeJS >= 10.0, Elasticsearch 6.x (7.0 not supported), Memcached, Redis
https://agileseason.com/#/shared/board/098d2e36dff32f296d7815cf943ac8eb
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
brew install yarn tmux overmind
In linux you have to install them another way.
yarn install
bundle install
psql -d postgres
create user shikimori_development;
create user shikimori_test;
alter user shikimori_development createdb;
alter user shikimori_test createdb;
alter user shikimori_development with superuser;
alter user shikimori_test with superuser;
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-16 -E 'UTF-8' --lc-collate='en_US.UTF-8' --lc-ctype='en_US.UTF-8'
Or initdb for apple M1
initdb --pgdata=/usr/local/var/postgresql@16 -E 'UTF-8' --lc-collate='en_US.UTF-8' --lc-ctype='en_US.UTF-8'
Create rails databases
rails db:create
Everything you need to run is listed in Procfile.
Shikimori uses Overmind to execute Procfile
.
rails db:drop && rails db:create
unzip -d db/ db/dump.sql.zip
psql -U shikimori_development -d shikimori_development -f db/dump.sql
rm db/dump.sql
RAILS_ENV=test rails db:schema:load
# migrate dump to latest schema
rails db:migrate
rails server
overmind start
OVERMIND_PROCESSES=camo,faye overmind start
In rails console:
Elasticsearch::RebuildIndexes.new.perform
Homebrew/homebrew-core#100260 (comment)
I've finally made it work, but I'm not sure this is the right call:
I've edited the service plist at /usr/local/Cellar/elasticsearch@6/6.8.23/homebrew.mxcl.elasticsearch@6.plist:
<key>ProgramArguments</key>
<array>
<string>/usr/local/opt/elasticsearch@6/bin/elasticsearch</string>
</array>
<key>EnvironmentVariables</key>
<dict>
+ <key>JAVA_HOME</key>
+ <string>'/usr/libexec/java_home -v 17'</string>
</dict>
I had to edit the plist in the Cellar folder instead of the one in ~/Library/LaunchAgents because brew services is overwriting it at every start.
rails neko:update
pg_dump -c shikimori_development > db/dump.sql
guard
APIPIE_RECORD=all rspec spec/controllers/api/**
# app/services/video_extractor/player_url_extractor.rb
RAILS_ENV=production rails assets:precompile && IS_LOCAL_RUN=true RAILS_ENV=production rails server
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
https://chrisbateman.github.io/webpack-visualizer/
@dependabot ignore this dependency