Contributing
Development Setup
Prerequisites
- Node.js 18+
- pnpm
- PostgreSQL 14+
- Redis 6+
Getting Started
git clone https://github.com/airlinklabs/panel.git
cd panel
cp example.env .env # configure database
pnpm install
pnpm run dev
The dev command runs:
- Prisma generate + db push
- Tailwind CSS in watch mode
- Nodemon for auto-restart on code changes
Project Structure
panel/
├── src/
│ ├── modules/ # Feature modules (routes)
│ │ ├── admin/ # Admin panel routes
│ │ ├── api/ # API routes
│ │ │ └── v2/ # V2 REST API
│ │ ├── auth/ # Authentication
│ │ ├── core/ # Core middleware
│ │ ├── realtime/ # WebSocket
│ │ └── user/ # User-facing routes
│ ├── services/ # Business logic
│ ├── handlers/ # Middleware and utilities
│ ├── utils/ # Helper functions
│ └── db.ts # Prisma client
├── views/ # EJS templates
│ ├── admin/ # Admin pages
│ ├── user/ # User pages
│ ├── auth/ # Auth pages
│ └── components/ # Shared components
├── public/ # Static assets
├── storage/
│ └── prisma/
│ └── schema.prisma # Database schema
└── tests/ # Test files
See project-structure.md for the full breakdown.
Running Tests
pnpm run test # Run once
pnpm run test:watch # Watch mode
Linting and Formatting
pnpm run lint # ESLint with auto-fix
pnpm run format # Prettier
Type Checking
pnpm run typecheck
Code Style
- TypeScript strict mode
- ESM modules
- Express routers for routes
- Zod for validation
- Prisma for database access
- EJS for templates.
Adding a Feature
- Create a module file in
src/modules/ - Export a
Moduleobject withinfoandrouter - Register in
src/modules/registry.ts - Add any new Prisma models to
schema.prisma - Run
pnpm run migrate:dev
Pull Requests
- Fork the repository
- Create a feature branch
- Make changes
- Run tests and type check
- Submit a PR with a clear description.
License
MIT. Same as the main project.