anipiano / anipianolist

"ok guys we need to make the myanimelist of all piano arrangements" – fruit 2022
MIT License
0 stars 2 forks source link

anipianolist (name is a work-in-progress)

"ok guys we need to make the myanimelist of all piano arrangements" – fruit 2022

Getting started

git clone https://github.com/anipiano/anipianolist
source env/bin/activate
cd anipianolist
pip install -r requirements.txt
#edit your .env before starting
python manage.py makemigrations && python manage.py migrate
python manage.py runserver

Before you dive in

Authentication

You'll need to register applications in both Discord and Google to use OAuth2 authentication.

  1. Discord - https://discord.com/developers > New application > OAuth2 > redirect URL: http://replace-me-you-baka.net/oauth2/discord/login/callback/
  2. Google - https://console.cloud.google.com/apis/credentials > OAuth2 client ID > Web application > redirect URI: http://replace-me-you-baka.net/oauth2/google/login/callback/

Database

You'll need to set some things up before you can spam your love for 150bpm in every row of the object-relational database. We use PostgreSQL over the default SQLite3 setup due to its support for write concurrency and generally better performance in our specific production use case.

This guide assumes you're running a derivative of Ubuntu or Debian, but you should easily be able to substitute commands for Microsoft Windows, other Linux distributions or macOS where necessary.

Thanks to Digital Ocean for being my senpai for this guide.

  1. Start by installing the necessary psql-related dependencies for your operating system. For example, on Ubuntu/Debian-based Linux distributions:
sudo apt update
sudo apt install python3-pip python3-dev libpq-dev postgresql postgresql-contrib
  1. Log into a psql session.
sudo -u postgres psql
  1. In the postgres=# console, set up your PostgreSQL database. Feel free to change names like myproject and myprojectuser to something more descriptive.
CREATE DATABASE myproject;
CREATE USER myprojectuser WITH PASSWORD 'password';
ALTER ROLE myprojectuser SET client_encoding TO 'utf8';
ALTER ROLE myprojectuser SET default_transaction_isolation TO 'read committed';
ALTER ROLE myprojectuser SET timezone TO 'UTC';
GRANT ALL PRIVILEGES ON DATABASE myproject TO myprojectuser;

You can leave the console with \q.

  1. In $ROOT/anipianolist/anipianolist/.env, where $ROOT is the root of the git repository as given by git rev-parse --show-toplevel, you'll need to amend the environment variables with the credentials you set up in Step 3. This should not be committed and will be automatically ignored as specified by .gitignore.
...
DB_NAME=myproject
DB_USERNAME=myprojectuser
DB_PASSWORD=password
...

Groups

Set up these groups in Django to take advantage of internal management systems.

All moderation actions are logged.

Environment variables

Use the provided .env.example template to set up your environment variables for local or production instances.

$ROOT/anipianolist/anipianolist/.env

where $ROOT is the root of the git repository as given by git rev-parse --show-toplevel

.env and other files beginning with a dot may be hidden by macOS. Use Command+Shift+Dot in Finder or ls -a in shell to unhide these files.

Apps

Different components of the anipianolist application are segmented into their own app.

i18n

i18n is not supported at the time.