A horror movie database, and movie list site. Allgore is a website dedictaed to horror movies with hundreds of movies seeded from TMDB.
- Rails 6 - Backend / Front-end
- Heroku - Deployment
- PostgreSQL - Database
- Bootstrap — Styling
Download this project code from this Github page. Either do a direct download or use a command line git clone command:
git clone git@github.com:gperilli/allgore.git
For more information on getting git (version control system) on your local machine, see this.
This is a ruby on rails web app, so first set up a rails development environment on your local machine. If you are using Windows, this will probably involve setting up WSL, Windows subsystem for Linux, rbenv, a ruby environment manager, and Ruby, the language upon which Rails works. Next install Node.js, yarn, and PostgreSQL, then you're good to go.
Install git:
sudo apt update
sudo apt install -y git
Install github CLI:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C99B11DEB97541F0
sudo apt-add-repository https://cli.github.com/packages
sudo apt update
Then:
sudo apt install -y gh
Check the version:
gh --version
Configure Github CLI
gh auth login -s 'user:email' -w
Follow the instructions to connect the local Guthub CLI with your Github account.
Confirm Guthub CLI connection with:
gh auth status
This should display: Logged in to github.com as <YOUR USERNAME>
Configure GIthub CLI with SSH:
gh config set git_protocol ssh
Generate SSH codes:
mkdir -p ~/.ssh && ssh-keygen -t ed25519 -o -a 100 -f ~/.ssh/id_ed25519 -C "TYPE_YOUR_EMAIL@HERE.com"
Give the SSH public key to your Guthub account:
gh auth refresh -s write:public_key
Run this to set the SSH key locally:
gh ssh-key add ~/.ssh/id_ed25519.pub
Install imagemagick:
sudo apt install -y zsh curl vim imagemagick jq
install zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Check if rbenv is installed:
rvm implode && sudo rm -rf ~/.rvm
The response should be zsh: command not found: rvm
if it is absent.
Use this to remove previous installation:
rm -rf ~/.rbenv
install rbenv using git clone:
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
configure the shell to load rbenv for Zsh:
echo 'eval "$(~/.rbenv/bin/rbenv init - zsh)"' >> ~/.zshrc
rbenv repository details: https://github.com/rbenv/rbenv#basic-git-checkout
Install Ruby version 2.7.4:
rbenv install 2.7.4
Set Ruby 2.7.4 as the gloabl default Ruby version:
rbenv global 2.7.4
Restart the terminal, and check the installed Ruby version with:
ruby -v
Install the Node version manager:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh | zsh
restart the terminal, then confirm the installed version of Node:
nvm -v
Install Node version 14.15:
nvm install 14.15
Confirm the installation of Node:
node -v
Install yarn:
npm install --global yarn
Confirm the installed yarn version:
yarn -v
Install the PostgreSQL database:
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
Navigate to the downloaded project files, then do the following to run the web app on a local server:
Install gems
bundle install
Install JS packages
yarn install
Install Rails:
gem install rails -v 6.0.3
In another terminal window:
sudo systemctl status postgresql
This sholud show something like:
postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor pr>
Active: active (exited) since Mon 2023-10-23 07:59:05 JST; 4h 5min ago
Main PID: 974 (code=exited, status=0/SUCCESS)
CPU: 1ms
The databse server can be started and stopped with:
sudo systemctl start postgresql
sudo systemctl stop postgresql
An IMDB API key is required to add more movies to the database. Please create a .env
file and add your IMDB API key in order to do this.
Create .env
file in the project folder:
touch .env
Inside .env
, set this variable:
IMDB_KEY='********'
rails db:create
rails db:migrate
rails db:seed
The seed file will import all the movies in the seed_list_curated.csv
file.
To get more horror movies from the IMDB database, use this command:
rails runner lib/generate_csv_data_from_api_search.rb
This will output a csv file with the movie data. Add this manuualy to the seed_list_curated.csv
file, and then run the Rails seed, rails db:seed
to get these movies in the database.
Running rails runner lib/generate_csv_data_from_api_search.rb
can take some time because the code is looking through the IMDB collection and selecting movies within the horror genre.
Run this command to execute the Rails server, then go to localhost:3000
to see the running app.
rails s
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.