### Explanation _No response_ ### Issue Closes #11 ### Attestations - [ ] I have read and agree to the [Code of Conduct](https://docs.nhcarrigan.com/community/coc/) - [ ] I have read and agree to the [Community Guidelines](https://docs.nhcarrigan.com/community/guide/). - [ ] My contribution complies with the [Contributor Covenant](https://docs.nhcarrigan.com/dev/covenant/). ### Dependencies - [ ] I have pinned the dependencies to a specific patch version. ### Style - [ ] I have run the linter and resolved any errors. - [ ] My pull request uses an appropriate title, matching the conventional commit standards. - [ ] My scope of feat/fix/chore/etc. correctly matches the nature of changes in my pull request. ### Tests - [ ] My contribution adds new code, and I have added tests to cover it. - [ ] My contribution modifies existing code, and I have updated the tests to reflect these changes. - [ ] All new and existing tests pass locally with my changes. - [ ] Code coverage remains at or above the configured threshold. ### Documentation _No response_ ### Versioning _No response_ Reviewed-on: #13 Co-authored-by: Naomi Carrigan <commits@nhcarrigan.com> Co-committed-by: Naomi Carrigan <commits@nhcarrigan.com>
7.5 KiB
title
| title |
|---|
| Hikari |
Hikari (hereinafter the "Application") is a centralised platform for managing NHCarrigan's products and services. It consists of three main components: a Discord bot with AI capabilities, an Angular web client for dashboard management, and a Fastify server backend. The platform enables users to manage their accounts, subscriptions, licenses, product configurations, and provides an AI-powered support agent for assistance with NHCarrigan's ecosystem of products.
1. User Documentation
Discord Bot Features
The Hikari Discord bot provides the following functionality:
- AI Support Agent: Chat with Hikari through direct messages to get help with NHCarrigan's products
- Product Information: Ask questions about any of the available products and services
- Command Interface: Use slash commands for quick actions
/about- Get information about Hikari and available features/dm- Trigger a DM response to easily find your direct message channel
Web Dashboard Features
The web dashboard provides a user-friendly interface for:
- Product Browsing: View all available products categorised by type (Community Tools, Websites/APIs, Apps/Games)
- Announcements: Stay updated with the latest product updates and community news
- Account Management: Manage your subscriptions, licenses, and configurations
- Product Filtering: Filter products by category or view all products at once
Product Categories
- Community Tooling and Integrations: Discord bots, translation services, and community management tools
- Websites and APIs: Web applications, documentation sites, and API services
- Apps and Games: Desktop applications, games, and interactive experiences
Getting Started
- Discord Bot: Install Hikari from the Discord app directory or invite to your server
- Web Dashboard: Visit hikari.nhcarrigan.com to access the dashboard
- Support: Join the Discord community for additional help
2. Technical Documentation
Architecture Overview
Hikari follows a microservices architecture with three main components:
Bot Service (/bot)
- Framework: Discord.js v14.21.0
- AI Integration: Anthropic Claude API for intelligent responses
- Language: TypeScript with Node.js
- Key Features:
- Slash command handling
- Direct message AI conversations
- Web search integration
- Error handling and logging
Client Service (/client)
- Framework: Angular v20.0.4
- Language: TypeScript
- Key Features:
- Responsive web interface
- Product catalogue with filtering
- Announcements system
- Routing and navigation
Server Service (/server)
- Framework: Fastify v5.4.0
- Database: MongoDB with Prisma ORM
- Key Features:
- RESTful API endpoints
- Announcement management
- Database operations
- Discord integration
Development Setup
Prerequisites
- Node.js (latest LTS)
- pnpm package manager
- MongoDB instance
- Discord bot token
- Anthropic API key
Installation
# Clone the repository
git clone https://git.nhcarrigan.com/NHCarrigan/hikari
# Install dependencies
pnpm install
# Build all services
pnpm build
Environment Configuration
Bot Service (bot/prod.env):
DISCORD_TOKEN=your_discord_token
ANTHROPIC_API_KEY=your_anthropic_key
Server Service:
MONGO_URI=your_mongodb_connection_string
Running Services
# Start bot service
cd bot && pnpm start
# Start client development server
cd client && ng serve
# Start server service
cd server && pnpm start
Database Schema
The application uses MongoDB with the following models:
model Announcements {
id String @id @default(auto()) @map("_id") @db.ObjectId
title String
content String
type String // "products" or "community"
createdAt DateTime @default(now()) @unique
}
API Endpoints
POST /announcement- Create new announcementsGET /announcements- Retrieve announcements- Health check and monitoring endpoints
Key Configuration Files
client/src/app/config/products.ts- Product catalogue configurationbot/src/config/prompt.ts- AI agent personality and instructionsclient/src/app/app.routes.ts- Client-side routingbot/commandJson.js- Discord slash command definitions
Build and Deployment
The project uses Turbo for monorepo management:
# Build all projects
turbo build
# Run linting
turbo lint
# Run tests
turbo test
3. Legal Documentation
License
This software is licensed under Naomi's Public Licence.
Privacy Policy
User data handling is governed by the NHCarrigan Privacy Policy.
Terms of Service
Usage of Hikari is subject to the NHCarrigan Terms of Service.
Security Policy
Security vulnerabilities should be reported according to the NHCarrigan Security Policy.
Data Collection
- Discord user IDs for bot functionality
- Message content for AI processing (not stored permanently)
- Usage analytics for service improvement
- Subscription and account information
Third-Party Services
- Discord: Bot hosting and user interaction
- Anthropic Claude: AI conversation processing
- MongoDB: Data storage
- Gitea: Source code hosting
4. Contributing Documentation
Code of Conduct
All contributors must follow the NHCarrigan Code of Conduct.
Contributing Guidelines
Please review the Contributing Guidelines before submitting contributions.
Development Workflow
- Issue Creation: Post in the appropriate Discord forum channel (#bug-reports or #feature-requests) on our Discord community
- Pull Requests: Follow the template in
.gitea/pull_request_template.yml - Code Standards:
- ESLint configuration enforced
- TypeScript strict mode
- Comprehensive error handling
- Logging for debugging
Project Structure
hikari/
├── bot/ # Discord bot service
│ ├── src/ # TypeScript source
│ └── prod/ # Compiled JavaScript
├── client/ # Angular web application
│ └── src/ # Angular source files
├── server/ # Fastify API server
│ ├── src/ # Server source
│ └── prisma/ # Database schema
└── docs/ # Documentation
Testing Requirements
- Unit tests for new functionality
- Integration tests for API endpoints
- End-to-end tests for critical user flows
- Code coverage maintenance above threshold
Style Guidelines
- Use TypeScript for all new code
- Follow existing naming conventions
- Include JSDoc comments for public methods
- Maintain consistent indentation (2 spaces)
- Use meaningful variable and function names
Submission Checklist
- Code follows project style guidelines
- Tests added for new functionality
- Documentation updated as needed
- No breaking changes without discussion
- All checks pass in CI/CD pipeline
Getting Help
- Discord Community: chat.nhcarrigan.com
- Email: contact@nhcarrigan.com