Skip to content

Project: Discord Anime Bot: Watchlist, RPG, and Fun. Created at https://spectra.codes, which is owned by @Drix10

Notifications You must be signed in to change notification settings

coslynx/anime-discord-bot-companion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

85 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


anime-discord-bot-companion

A Discord bot companion for anime enthusiasts, offering features like personalized recommendations, list management, and fun interactions.

Developed with the software and tools below.

Framework: NestJS Frontend: React Backend: Node.js LLMs: OpenAI

git-last-commit GitHub commit activity GitHub top language

πŸ“‘ Table of Contents

  • πŸ“ Overview
  • πŸ“¦ Features
  • πŸ“‚ Structure
  • πŸ’» Installation
  • πŸ—οΈ Usage
  • 🌐 Hosting
  • πŸ“„ License
  • πŸ‘ Authors

πŸ“ Overview

The repository contains a project called "anime-discord-bot-companion" that is a Discord bot designed to provide a rich and interactive experience for anime fans. The bot leverages a powerful backend built with NestJS and a user-friendly frontend crafted with React to offer a wide range of features. It aims to foster a vibrant anime community within Discord by facilitating interactions, discussions, and shared experiences among anime enthusiasts.

πŸ“¦ Features

Feature Description
πŸ€– Anime Recommendation System Provides personalized anime recommendations based on user preferences, helping users discover new shows they might enjoy.
πŸ“ Anime List Management Allows users to create and manage their anime watchlists, tracking their progress, sharing lists with friends, and organizing their anime viewing experience.
πŸŽ‰ Fun Anime Interactions Offers a variety of fun and engaging interactions related to anime, including trivia quizzes, meme generators, character generators, random fact generators, and interactive games.
βš”οΈ MMORPG-Like Anime Experience Allows users to create anime-themed characters, level them up, collect virtual items, and interact with other players in a virtual world, adding a unique and engaging layer to the bot.
🌐 Advanced Features Incorporates AI-powered algorithms for more accurate and personalized recommendations, community features to foster interactions, gamified elements to incentivize user engagement, and visual enhancements for an engaging experience.

πŸ“‚ Structure

β”œβ”€β”€ client
β”‚   β”œβ”€β”€ components
β”‚   β”‚   β”œβ”€β”€ Layout.js
β”‚   β”‚   β”œβ”€β”€ Header.js
β”‚   β”‚   β”œβ”€β”€ Footer.js
β”‚   β”‚   β”œβ”€β”€ AnimeList.js
β”‚   β”‚   β”œβ”€β”€ AnimeDetails.js
β”‚   β”‚   β”œβ”€β”€ MMORPG.js
β”‚   β”‚   β”œβ”€β”€ UserDashboard.js
β”‚   β”‚   β”œβ”€β”€ Login.js
β”‚   β”‚   β”œβ”€β”€ Register.js
β”‚   β”‚   └── Profile.js
β”‚   β”œβ”€β”€ pages
β”‚   β”‚   β”œβ”€β”€ index.js
β”‚   β”‚   β”œβ”€β”€ anime.js
β”‚   β”‚   β”œβ”€β”€ list.js
β”‚   β”‚   β”œβ”€β”€ mmorpg.js
β”‚   β”‚   β”œβ”€β”€ user.js
β”‚   β”‚   └── auth.js
β”‚   β”œβ”€β”€ styles
β”‚   β”‚   β”œβ”€β”€ globals.css
β”‚   β”‚   └── theme.js
β”‚   β”œβ”€β”€ utils
β”‚   β”‚   β”œβ”€β”€ api.js
β”‚   β”‚   └── auth.js
β”‚   └── next.config.js
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ api
β”‚   β”‚   β”œβ”€β”€ anime
β”‚   β”‚   β”‚   β”œβ”€β”€ aniList.service.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ myAnimeList.service.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ jikan.service.ts
β”‚   β”‚   β”‚   └── anime.controller.ts
β”‚   β”‚   β”œβ”€β”€ user
β”‚   β”‚   β”‚   β”œβ”€β”€ user.service.ts
β”‚   β”‚   β”‚   └── user.controller.ts
β”‚   β”‚   β”œβ”€β”€ auth
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.service.ts
β”‚   β”‚   β”‚   └── auth.controller.ts
β”‚   β”‚   └── list
β”‚   β”‚       β”œβ”€β”€ list.service.ts
β”‚   β”‚       └── list.controller.ts
β”‚   β”œβ”€β”€ discord
β”‚   β”‚   β”œβ”€β”€ events
β”‚   β”‚   β”‚   β”œβ”€β”€ ready.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ messageCreate.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ guildMemberAdd.ts
β”‚   β”‚   β”‚   └── interactionCreate.ts
β”‚   β”‚   β”œβ”€β”€ commands
β”‚   β”‚   β”‚   β”œβ”€β”€ anime
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ recommend.ts
β”‚   β”‚   β”‚   β”‚   └── search.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ list
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ add.ts
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ remove.ts
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ show.ts
β”‚   β”‚   β”‚   β”‚   └── update.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ fun
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ trivia.ts
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ meme.ts
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ character.ts
β”‚   β”‚   β”‚   β”‚   └── random.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ mmorpg
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ create.ts
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ levelup.ts
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ quest.ts
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ battle.ts
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ inventory.ts
β”‚   β”‚   β”‚   β”‚   └── shop.ts
β”‚   β”‚   β”‚   └── help.ts
β”‚   β”‚   β”œβ”€β”€ utils
β”‚   β”‚   β”‚   β”œβ”€β”€ logger.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ commandHandler.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ errorHandler.ts
β”‚   β”‚   β”‚   └── discord.service.ts
β”‚   β”‚   └── bot.ts
β”‚   β”œβ”€β”€ modules
β”‚   β”‚   β”œβ”€β”€ database
β”‚   β”‚   β”‚   β”œβ”€β”€ database.module.ts
β”‚   β”‚   β”‚   └── database.provider.ts
β”‚   β”‚   β”œβ”€β”€ anime
β”‚   β”‚   β”‚   β”œβ”€β”€ anime.module.ts
β”‚   β”‚   β”‚   └── anime.service.ts
β”‚   β”‚   β”œβ”€β”€ user
β”‚   β”‚   β”‚   β”œβ”€β”€ user.module.ts
β”‚   β”‚   β”‚   └── user.service.ts
β”‚   β”‚   β”œβ”€β”€ auth
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.module.ts
β”‚   β”‚   β”‚   └── auth.service.ts
β”‚   β”‚   β”œβ”€β”€ list
β”‚   β”‚   β”‚   β”œβ”€β”€ list.module.ts
β”‚   β”‚   β”‚   └── list.service.ts
β”‚   β”‚   β”œβ”€β”€ mmorpg
β”‚   β”‚   β”‚   β”œβ”€β”€ mmorpg.module.ts
β”‚   β”‚   β”‚   └── mmorpg.service.ts
β”‚   β”‚   └── fun
β”‚   β”‚       β”œβ”€β”€ fun.module.ts
β”‚   β”‚       └── fun.service.ts
β”‚   β”œβ”€β”€ entities
β”‚   β”‚   β”œβ”€β”€ user.entity.ts
β”‚   β”‚   β”œβ”€β”€ list.entity.ts
β”‚   β”‚   β”œβ”€β”€ anime.entity.ts
β”‚   β”‚   └── mmorpg.entity.ts
β”‚   β”œβ”€β”€ interfaces
β”‚   β”‚   β”œβ”€β”€ anime.interface.ts
β”‚   β”‚   β”œβ”€β”€ user.interface.ts
β”‚   β”‚   β”œβ”€β”€ list.interface.ts
β”‚   β”‚   └── mmorpg.interface.ts
β”‚   β”œβ”€β”€ constants
β”‚   β”‚   β”œβ”€β”€ env.constants.ts
β”‚   β”‚   └── api.constants.ts
β”‚   └── main.ts
β”œβ”€β”€ .env
└── package.json

πŸ’» Installation

πŸ”§ Prerequisites

  • Node.js
  • npm
  • Docker
  • Redis
  • PostgreSQL

πŸš€ Setup Instructions

  1. Clone the repository:
    • git clone https://github.com/spectra-ai-codegen/anime-discord-bot-companion.git
  2. Navigate to the project directory:
    • cd anime-discord-bot-companion
  3. Install dependencies:
    • npm install
  4. Create a .env file in the root directory and add the following environment variables:
    • DISCORD_TOKEN: Your Discord bot token
    • POSTGRES_HOST: Your PostgreSQL database host
    • POSTGRES_USER: Your PostgreSQL database user
    • POSTGRES_PASSWORD: Your PostgreSQL database password
    • POSTGRES_DATABASE: Your PostgreSQL database name
    • REDIS_HOST: Your Redis server host
    • REDIS_PORT: Your Redis server port
    • OPENAI_API_KEY: Your OpenAI API key
  5. Create a database.sql file in the root directory and run the following SQL commands to create the necessary tables:
    CREATE TABLE users (
        id SERIAL PRIMARY KEY,
        username VARCHAR(255) NOT NULL,
        email VARCHAR(255) NOT NULL UNIQUE,
        password VARCHAR(255) NOT NULL,
        created_at TIMESTAMP WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP
    );
    
    CREATE TABLE lists (
        id SERIAL PRIMARY KEY,
        user_id INT REFERENCES users(id),
        name VARCHAR(255) NOT NULL,
        type VARCHAR(255) NOT NULL,
        anime_ids TEXT[] NOT NULL,
        created_at TIMESTAMP WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP
    );
    
    CREATE TABLE anime (
        id SERIAL PRIMARY KEY,
        title VARCHAR(255) NOT NULL,
        synopsis TEXT,
        genres TEXT[],
        studios TEXT[],
        rating NUMERIC,
        created_at TIMESTAMP WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP
    );
    
    CREATE TABLE mmorpg_characters (
        id SERIAL PRIMARY KEY,
        user_id INT REFERENCES users(id),
        name VARCHAR(255) NOT NULL,
        level INT NOT NULL DEFAULT 1,
        experience INT NOT NULL DEFAULT 0,
        inventory TEXT[] NOT NULL,
        created_at TIMESTAMP WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP
    );
  6. Run the following commands to start the bot:
    • npm run start:dev (for development mode)
    • npm run start:prod (for production mode)

πŸ—οΈ Usage

πŸƒβ€β™‚οΈ Running the Project

  1. Start the development server:
    • npm run start:dev
  2. Open your browser and navigate to http://localhost:3000.

βš™οΈ Configuration

Adjust configuration settings in .env.

πŸ“š Examples

  • πŸ“ Anime Recommendation:
    • /anime recommend - To get personalized anime recommendations.
    • /anime recommend genre:Action,Comedy - To get recommendations based on specific genres.
  • πŸ“ Anime List Management:
    • /list add <anime title> - To add an anime to your watchlist.
    • /list remove <anime title> - To remove an anime from your watchlist.
    • /list show - To view your anime watchlist.
  • πŸ“ Fun Interactions:
    • /fun trivia - To play a trivia game about anime.
    • /fun meme - To generate an anime meme.
    • /fun character - To generate a random anime character.
    • /fun random - To get a random anime fact.
  • πŸ“ MMORPG:
    • /mmorpg create <character name> - To create a new character.
    • /mmorpg levelup - To level up your character.
    • /mmorpg quest - To view and accept quests.
    • /mmorpg battle - To battle other players or monsters.
    • /mmorpg inventory - To view your inventory.
    • /mmorpg shop - To buy and sell items.

🌐 Hosting

πŸš€ Deployment Instructions

Heroku

  1. Install the Heroku CLI:
    • npm install -g heroku
  2. Login to Heroku:
    • heroku login
  3. Create a new Heroku app:
    • heroku create
  4. Deploy the code:
    • git push heroku main
  5. Configure the environment variables on Heroku:
    • DISCORD_TOKEN
    • POSTGRES_HOST
    • POSTGRES_USER
    • POSTGRES_PASSWORD
    • POSTGRES_DATABASE
    • REDIS_URL
    • OPENAI_API_KEY
  6. Add a Heroku addon for PostgreSQL and Redis:
    • heroku addons:create heroku-postgresql
    • heroku addons:create heroku-redis
  7. Configure the database connection details in your Heroku app settings.
  8. Run the following command to start the bot:
    • heroku ps:scale worker=1

πŸ“œ License

This project is licensed under the GNU AGPLv3.

πŸ‘₯ Authors

🌐 Spectra.Codes

Why only generate Code? When you can generate the whole Repository!