Centralized blacklist database, API, and management panel primarily intended for use in Hololive fan Discord servers.
Component | Tech |
---|---|
Primary programming language | TypeScript |
Web framework (backend and routing) | Express and Next.js |
Frontend library | React |
Content markup languages | Markdown, MDX |
Styling | SCSS |
Styling utility framework | Tailwind |
Database models and migrations | TypeORM |
Asynchronous jobs | Bull + Redis |
Workers | Go |
Nakiri Gateway | Websockets |
Documentation pages | Nextra |
Source control | Git/GitHub |
Error logs and reporting | Sentry |
- Node.js v12 or newer
- MySQL (other databases might work but I have not tested it)
- Redis
1. Clone the repository:
git clone git@github.com:jozsefsallai/nakiri.git
cd nakiri
2. Install the dependencies:
npm i -g yarn
yarn
3. Create a user and a database:
(instructions are for MySQL, if you're using a different database driver, the steps should be similar)
mysql -u root -p
CREATE USER ayame@localhost IDENTIFIED BY 'nakiri';
CREATE DATABASE nakiriapi;
GRANT ALL PRIVILEGES ON nakiriapi.* TO ayame@localhost WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit;
4. Create a dotenv config:
cp .env.example .env
nvim .env
5. Run the migrations:
yarn migrate
6. Authorize the first Discord user:
node bin/authorizeUser
It is recommended that you grant all permissions to the first user.
7. Start the dev server:
yarn dev
yarn lint
yarn migration:generate NameOfMigration
yarn migration:rollback
node bin/generateKey
node bin/import
Create a production build:
yarn build
Run the following command in your favorite Node process manager (e.g. PM2):
yarn start
This job should be running on a tidy schedule:
NODE_ENV=production node bin/updateUsers
You can back up your database and environment configuration to an S3 bucket. For
this, you should install AWS CLI, run aws configure
to set up your
credentials, then if you're on Linux or Mac, run or schedule the following
script:
sh bin/backup.sh
If you're on Windows, sorry.
The source code of this app is licensed under MIT. Refer to the LICENSE file for more details.