Version 1.0 - Production Ready π
WARNING
β οΈ - The tests pass, but only with full environment variable setup. So the tests on the repository will fail. Same with the build.
A modern, open-source chat platform inspired by Discord, built with Next.js 15, Appwrite, and TypeScript. Features real-time messaging, server organization, role-based permissions, and comprehensive moderation tools.
- Server support - support for servers like on discord
- Server Invite System - Create, manage, and use invite links with expiration and usage limits
- Channel support - support for channels like on discord
- User profiles and status support - missing external integration, but support for in app statuses and profiles
- Emoji support - Standard and custom emoji support with upload capabilities
- Moderation - Instance wide moderation and administration
- Individual server moderation - not currently supported, but will come in a later update with roles
- Real-time Chat - WebSocket-based messaging with typing indicators
- Message Replies - Reply to specific messages to maintain conversation context
- Server & Channels - Discord-like server organization with multiple channels
- Server Invites - Shareable invite links with expiration dates, usage limits, and revocation
- Direct Messages - Private conversations between users
- User Status - Online/offline presence with custom status messages
- Emoji Support - Standard emoji picker and custom emoji upload (up to 10MB)
- Moderation Tools - Soft delete, restore, and hard delete messages with full audit trails
- Role-Based Access - Admin, moderator, and user roles with granular permissions
- User Profiles - Customizable profiles with avatar support
- TypeScript - Full type safety across the entire codebase
- Next.js 15 - App Router with React Server Components
- TailwindCSS - Modern, responsive UI design
- shadcn/ui - High-quality, accessible UI components
- PWA Ready - Progressive Web App support for mobile installation
- Comprehensive Tests - 1645 passing tests with extensive coverage
- Production Ready - Error boundaries, rate limiting, and security hardening
Before you begin, ensure you have:
- Node.js 18+ or Bun 1.2+ installed
- An Appwrite instance (cloud or self-hosted):
- Cloud: appwrite.io (free tier available)
- Self-hosted: Installation Guide
- Git for cloning the repository
# 1. Clone the repository
git clone https://github.com/your-org/firepit.git
cd firepit
# 2. Install dependencies
bun install
# 3. Set up environment variables
cp .env.local.example .env.local
nano .env.local # Edit with your Appwrite credentials
# 4. Validate your configuration
bun run validate-env
# 5. Initialize the database
bun run setup
# 6. Start the development server
bun dev # Uses Turbopack (~700x faster than Webpack)Open http://localhost:3000 in your browser to see the application.
Development Commands:
bun dev- Start with Turbopack (recommended, ~1.5s cold start)bun dev:webpack- Start with Webpack (fallback, ~12s cold start)bun build- Production build with Turbopackbun build:webpack- Production build with Webpack (fallback)
See the /docs folder for detailed guides:
- Deployment Guide - Production deployment instructions
- Performance Guide - Performance optimization details
- Performance Optimizations - NEW! First load time improvements
- Performance Summary - NEW! Quick reference guide
- Turbopack Configuration - Build tool configuration
- Admin Guide - Moderation and administration
- Roles & Permissions - Permission system
- New Relic Integration - APM and monitoring setup
- Typing Indicators - Real-time presence
- Roadmap - Planned features and timeline
- Changelog - Version history and release notes
Firepit is production-ready with:
β Security Hardening
- Global error boundaries
- Rate limiting on uploads and API endpoints
- Secure session management
- Input validation and sanitization
β Performance Optimization
- 90%+ improvement in first load times (from 30+ seconds to 2-3 seconds)
- 85% faster First Contentful Paint (8s β 0.8-1.2s)
- 50% smaller bundle size (2.5MB β 800KB-1.2MB)
- Response compression (60-70% bandwidth reduction)
- Virtual scrolling for large lists
- Optimized bundle size with code splitting
- Partial Prerendering (PPR) for instant page loads
- Aggressive caching for repeat visits (~100ms)
β Monitoring & Observability
- New Relic APM integration
- Comprehensive error tracking
- Performance metrics
- Audit logging
β Testing & Quality
- 1644 passing tests
- Comprehensive test coverage
- Automated CI/CD pipeline
- Strict ESLint configuration
See DEPLOYMENT.md for detailed production deployment instructions.
Version 1.1 does not include:
- Message threading (planned for v1.3)
- Message pinning (planned for v1.3)
- Voice/video calls (not currently planned)
- Native mobile apps (PWA supported)
See ROADMAP.md for the complete feature roadmap.
We welcome contributions! See CONTRIBUTING.md for:
- Development workflow
- Code style guidelines
- Testing requirements
- Pull request process
- Issue reporting templates
firepit/
βββ src/
β βββ app/ # Next.js app router pages
β βββ components/ # React components
β βββ lib/ # Utility functions and Appwrite integration
β βββ __tests__/ # Vitest test suites
βββ scripts/
β βββ setup-appwrite.ts # Database initialization script
β βββ validate-env.ts # Environment validation script
βββ public/ # Static assets
βββ DEPLOYMENT.md # Deployment documentation
βββ .env.local.example # Environment variable template
| Command | Description |
|---|---|
bun dev |
Start development server (with Turbopack) |
bun build |
Build for production |
bun start |
Start production server |
bun run test |
Run all tests with Vitest |
bun run test:coverage |
Run tests with coverage report |
bun lint |
Check code with ESLint |
bun lint:fix |
Fix auto-fixable linting issues |
bun validate-env |
Validate environment configuration |
bun setup |
Initialize Appwrite database and collections |
The application requires several environment variables. Copy .env.local.example to .env.local and configure:
APPWRITE_ENDPOINT- Your Appwrite API endpointAPPWRITE_PROJECT_ID- Your Appwrite project IDAPPWRITE_API_KEY- Server-side API key with full permissions
For a complete list and detailed explanations, see DEPLOYMENT.md.
- Create an Appwrite account and project at appwrite.io
- Generate an API key with required scopes (see DEPLOYMENT.md)
- Configure environment variables in
.env.local - Run validation:
bun run validate-env - Initialize database:
bun run setup - Start the app:
bun dev - Create your account in the UI
- Make yourself admin by setting
APPWRITE_ADMIN_USER_IDSin.env.local
For detailed instructions, see DEPLOYMENT.md.
- "Appwrite endpoint not configured" - Check your
.env.localfile exists and has the correct values - "Project not found" - Verify your
APPWRITE_PROJECT_IDmatches your Appwrite Console - "Missing scope" errors - Regenerate your API key with all required permissions
- Setup script fails - Ensure your API key has databases, collections, attributes, and indexes permissions
For more solutions, see DEPLOYMENT.md - Troubleshooting.
This project maintains a comprehensive test suite with 100% pass rate:
# Run all tests
bun run test
# Run tests with coverage report
bun run test:coverage
# Run tests in watch mode (during development)
bun run test --watchCurrent test coverage: 40.18% statements (growing)
- 1645 tests passing across 115 test suites
- Comprehensive API route testing (44 new tests for invite system)
- Focus on security-critical modules (auth, roles, moderation), and modules critical for function (API routes, hooks, utility files, etc.)
- Push your code to GitHub
- Import project in Vercel
- Add environment variables from
.env.local - Deploy!
# Build the application
bun build
# Start production server
bun startFor production deployment with Nginx, Docker, or other platforms, see DEPLOYMENT.md - Production Deployment.
We welcome contributions! Please see CONTRIBUTING.md for:
- Development workflow
- Code style guidelines
- Testing requirements
- Pull request process
- Issue reporting templates
Licensed under the GNU General Public License (GPL) v3. You can find the License here: License
Built with:
- Documentation: DEPLOYMENT.md
- Issues: GitHub Issues
- Discussions: GitHub Discussions