Developer Documentation

Welcome to the NPC Forge developer documentation. Here you'll find technical guides, API references, and contribution guidelines for developers who want to work with, extend, or contribute to NPC Forge.

Getting Started

Development Setup

Local environment setup, prerequisites, and project configuration for development.

Architecture Overview

System structure, chat system architecture, component organization, and data flow.

API & Integration

API Reference

Complete API documentation including chat endpoints, generation, and OpenAI integration.

Security Documentation

Input validation, data privacy practices, and security considerations for chat and storage.

Contributing

Contributing Guidelines

How to contribute code, documentation, and report issues for the project.

Testing Guide

Manual testing procedures, chat testing workflows, and quality assurance practices.

Quick Start for Developers

New to NPC Forge development? Follow these steps to get started:

  1. Set up your development environment with Node.js, dependencies, and environment variables
  2. Review the system architecture to understand how components interact
  3. Explore the API endpoints for character generation, chat, and management
  4. Read the contribution guidelines before making changes or submitting PRs
  5. Learn the testing procedures to ensure quality and reliability

Technical Overview

NPC Forge is built with modern web technologies and follows best practices for scalability, maintainability, and performance. The application uses:

  • Next.js 14 with App Router for server-side rendering and routing
  • TypeScript for type safety and better developer experience
  • Tailwind CSS for utility-first styling and responsive design
  • IndexedDB for client-side data persistence and chat storage
  • OpenAI API for character generation, chat, and portrait editing
  • React Context for state management across components

The application is designed to be modular, with clear separation of concerns between UI components, data management, and API interactions. This makes it easy to extend functionality, add new features, and maintain code quality.