Skip to content

krzjablonski/cyberpunk-red-npc-generator

Repository files navigation

Cyberpunk RED NPC Generator 1.0.0

Table of Contents

Project Description

Cyberpunk RED NPC Generator is an MVP application designed to simplify the creation of engaging non-player characters (NPCs) for Cyberpunk RED role-playing games. The application allows users to input notes describing a character, which are then processed by AI to generate a comprehensive and detailed NPC profile. The profile includes information such as background, secret background, motivation, distinctive traits, and typical catchphrases. Additionally, the system supports user registration, authentication, and profile editing, along with tag management for efficient NPC filtering.

Tech Stack

Backend

  • Python 3.12
  • FastAPI
  • SQLAlchemy
  • python-jose (cryptography)
  • passlib (bcrypt)
  • python-multipart
  • pydantic
  • openai
  • python-dotenv
  • astapi-mail for asynchronous email notifications

Frontend

  • Vue 3
  • Vite
  • Tailwind CSS
  • Pinia
  • Vitest

Additional

  • JWT authentication for secure communication between frontend and backend
  • SQLite as the database
  • AI integration via OpenRouter.ai for dynamic NPC profile generation

Getting Started Locally

Prerequisites

  • Python 3.12
  • Node.js (refer to the .nvmrc file for the recommended version)

Backend Setup

  1. Navigate to the backend directory:
    cd backend
  2. Install the Python dependencies:
    pip install -r requirements.txt
  3. Run the FastAPI server (adjust the command if your entry point differs):
    uvicorn main:app --reload

Frontend Setup

  1. Navigate to the frontend directory:
    cd frontend
  2. Install the Node.js dependencies:
    npm install
  3. Start the development server:
    npm run dev

Available Scripts

Frontend (package.json)

  • npm run dev: Starts the development server.
  • npm run build: Builds the application for production.
  • npm run preview: Previews the production build.
  • npm run test: Runs the tests using Vitest.

Backend

  • Run the FastAPI server using Uvicorn, for example:
    uvicorn main:app --reload

Project Scope

  • User Authentication: Registration using email and password, including email verification.
  • NPC Profile Generation: Process user-provided notes (300 to 10,000 characters) to generate detailed NPC profiles via AI, including background, secret background, motivation, distinctive traits, and typical catchphrases.
  • Profile Editing: Allow users to edit accepted NPC profiles to better suit their requirements.
  • Tag Management: Enable users to add, edit, and delete tags for efficient filtering of NPCs.

Project Status

This project is currently in the MVP stage with core functionalities implemented. Future improvements and additional features are planned to enhance the user experience and system capabilities.

API Endpoints

POST /npc-generations

URL: /npc-generations Method: POST Headers:

  • Authorization: Bearer <token> Request Body:
{ "note": "User input text for NPC generation." }

Success Response (201 Created):

{
  "generation_id": 10,
  "background": "Generated background text",
  "hidden_background": "Additional hidden details",
  "motivation": "Generated motivation",
  "characteristic_features": "Generated features",
  "sayings": "Generated sayings",
  "generation_duration": 5,
  "is_accepted": false
}

Error Responses:

  • 400 Bad Request: validation error
  • 401 Unauthorized: missing/invalid token
  • 503 Service Unavailable: AI service error
  • 500 Internal Server Error: database or server error

License

This project is licensed under the MIT License.

About

Project made for 10xDev online course

Resources

Stars

Watchers

Forks

Packages

No packages published