Skip to content

Commit 158e238

Browse files
Merge pull request #657 from aXenDeveloper/dynamic-options-select
feat: Add combobox async
2 parents 02d315f + f1b5a7c commit 158e238

File tree

32 files changed

+1254
-261
lines changed

32 files changed

+1254
-261
lines changed

.github/copilot-instructions.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
11
# VitNode Development Guidelines
22

3-
VitNode is a comprehensive framework designed to simplify and accelerate application development with Next.js and Hono.js. Built as a monorepo solution managed by Turborepo, VitNode provides a structured environment that makes development faster and less complex. The framework includes an integrated AdminCP and plugin system to extend its core functionality.
3+
VitNode is a comprehensive framework designed to simplify and accelerate application development with Next.js and Hono.js. Built as a monorepo solution managed by Turborepo, VitNode provides a structured environment that makes development faster and less complex. The framework includes an integrated AdminCP, plugin system, authentication, role management, and comprehensive developer tools.
44

55
## Global Rules
66

77
- Write ESModule only
88
- Always use snake_case for file names
99
- Use pnpm as package manager
10-
- Use Zod 3 for schema validation
10+
- Use Zod 3 for schema validation and runtime validation
1111
- Use react-hook-form 7 for forms
1212
- Use Shadcn UI & Tailwind CSS 4 for UI
1313
- Respect Prettier configuration in `packages/eslint/prettierrc.mjs` and ESLint configuration in `packages/eslint/eslint.config.mjs`
14-
- Use TypeScript 5, React 19 & Hono.js 4
14+
- Use TypeScript 5 with strict configuration, React 19 & Hono.js 4
15+
- Follow WCAG 2.1 AA compliance for accessibility
16+
- Aim for Lighthouse scores of 95+ and Core Web Vitals optimization
17+
- Implement proper error handling and validation at all levels
1518

1619
## Frontend Development (Next.js & React)
1720

18-
- Use Next.js 15
19-
- Use App Router and Server Components
21+
- Use Next.js 15 with App Router and Server Components
2022
- Use server actions for form handling and data mutations from Server Components
2123
- Leverage Next.js Image component with proper sizing for core web vitals optimization
2224
- Navigation API is in `vitnode/lib/navigation` file. Avoid using `next/navigation` directly
2325
- Alert Dialog & Dialog content should always have title and description with React lazy loading content
26+
- Implement dark/light mode support with system preference detection
27+
- Ensure keyboard navigation support and screen reader compatibility
28+
- Use proper semantic HTML and ARIA attributes
29+
- Use XSS protection with content security policy
2430

2531
### Internationalization (i18n)
2632

@@ -30,10 +36,16 @@ VitNode is a comprehensive framework designed to simplify and accelerate applica
3036

3137
## Backend Development (Hono.js)
3238

33-
- Use @hono/zod-openapi or Zod 3 for schema validation
34-
- Use PostgreSQL with Drizzle ORM
39+
- Use @hono/zod-openapi or Zod 3 for schema validation and OpenAPI documentation
40+
- Use PostgreSQL with Drizzle ORM for database operations
3541
- Use `t.serial().primaryKey()` for all database IDs
3642
- To get access to database, use `c.get('database')` by Hono.js context
43+
- Implement rate limiting on API endpoints, especially authentication
44+
- Use secure session management with configurable duration
45+
- Implement proper error handling and logging
46+
- Follow RESTful API design principles
47+
- Support API versioning with backward compatibility
48+
- Include comprehensive OpenAPI 3.0 specifications
3749

3850
## Documentation (\*.mdx files)
3951

.github/docs/prd.md

Lines changed: 209 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -24,119 +24,261 @@ VitNode is designed for individual developers and small teams who need a structu
2424

2525
### Structure and Configuration
2626

27-
- Monorepo structure using Turborepo with `apps` and `plugins` directories
28-
- Simple CLI tool for creating new projects (`create-vitnode-app`)
29-
- Script to set up PostgreSQL database with initial data (roles, languages, etc.)
30-
- Internationalization (i18n) support using next-intl (RTL not required for MVP)
31-
- Dark/Light mode support
27+
- Monorepo structure using Turborepo with `apps`, `packages`, and `plugins` directories
28+
- CLI tool for creating new projects (`create-vitnode-app`)
29+
- Database migration system using Drizzle ORM with PostgreSQL
30+
- Internationalization (i18n) support using next-intl
31+
- Dark/Light mode support with system preference detection
32+
- Environment-based configuration management
3233

3334
### Plugin System
3435

35-
- Monorepo-based plugin architecture created using `npx create-vitnode-app@canary --plugin`
36+
- Monorepo-based plugin architecture with standardized structure
3637
- Plugins can extend functionality by creating:
37-
- New pages and routes
38-
- API endpoints
39-
- AdminCP pages
40-
- SSO providers
41-
- Email providers (SMTP, Resend)
38+
- New pages and routes with automatic navigation integration
39+
- API endpoints with OpenAPI documentation
40+
- AdminCP pages with role-based access control
41+
- Database schema extensions with automatic migrations
42+
- Custom UI components and layouts
43+
- Email providers (SMTP, Resend, custom)
44+
- Plugin hooks and events system for inter-plugin communication
4245

4346
### CI/CD
4447

4548
- Automated workflows using GitHub Actions:
46-
- Code quality checks (linting, formatting)
47-
- Test suite execution on pull requests and main branch
48-
- Dependency security scanning
49-
- Automated builds and deployments to staging/production environments
50-
- Version tagging and changelog generation
51-
- Docker image building and publishing
49+
- Code quality checks (ESLint, Prettier, TypeScript)
50+
- Test suite execution with Vitest and Playwright
51+
- Dependency security scanning with npm audit
52+
- Automated builds and deployments to Vercel
5253
- Database schema validation and migration checks
54+
- Automated changelog generation and release notes
5355

5456
### Authentication & Authorization
5557

56-
- Authentication via credentials and SSO (Facebook, Google, GitHub)
57-
- User registration and login functionality
58-
- Password reset and email verification
59-
- Session management in cookies and database:
60-
- 3 months for users
61-
- 24 hours for admins
62-
- No session storage for guests
63-
- Security features including password hashing, secure cookies, and protection against CSRF and XSS
58+
- Multi-provider authentication system:
59+
- Credentials (email/password) with hashing
60+
- OAuth providers (Google, GitHub, Facebook, Discord)
61+
- User registration with email verification
62+
- Password reset with secure token generation
63+
- Two-factor authentication (TOTP)
64+
- Session management with secure cookies:
65+
- Configurable session duration per user group
66+
- Automatic session cleanup
67+
- Cross-device session management
68+
- Security features:
69+
- CSRF protection with double-submit cookies
70+
- XSS protection with content security policy
71+
- Rate limiting on authentication endpoints
72+
- Account lockout after failed attempts
6473

6574
### Role Management
6675

67-
- AdminCP interface for role CRUD operations
68-
- Role assignment to users
69-
- Role-based permission system with capabilities defined in the database
70-
- Permissions enforced through middleware in API and AdminCP
76+
- Hierarchical role system with inheritance
77+
- AdminCP interface for comprehensive role management:
78+
- Role CRUD operations with validation
79+
- Permission matrix with granular controls
80+
- Bulk role assignment and management
81+
- Dynamic permission system:
82+
- Resource-based permissions (read, write, delete, admin)
83+
- Context-aware permissions (own content vs. all content)
84+
- Plugin-defined custom permissions
85+
- Role-based middleware for API and page protection
7186

7287
### User Management
7388

74-
- AdminCP interface for user CRUD operations
75-
- Search and filter functionality for users
76-
- User profile editing (password, email, avatar, role assignment)
89+
- Comprehensive user administration:
90+
- Advanced search and filtering (by role, status, registration date)
91+
- Bulk operations (role assignment, status changes, deletion)
92+
- User activity tracking and audit logs
93+
- Profile management with avatar uploads
94+
- User groups and organization support
95+
- Flexible user profile fields with custom validation
7796

7897
### API and Documentation
7998

80-
- OpenAPI documentation for all API endpoints
81-
- API versioning support (core functionality handled by framework, plugins can implement multiple versions)
82-
- Comprehensive documentation using Fumadocs
83-
- Documentation structured by feature with examples and best practices
99+
- Full OpenAPI 3.0 specification with Swagger UI
100+
- API versioning with backward compatibility
101+
- Comprehensive documentation using Fumadocs:
102+
- Interactive examples with code snippets
103+
- Plugin development guides
104+
- Deployment instructions
105+
- Best practices and patterns
106+
- Type-safe API client generation
84107

85108
### Developer Tools
86109

87-
- Integration with Next.js and Hono.js debugging tools
88-
- Support for react-scan for component debugging
89-
- Helper functions for form handling, API calls, and routing
90-
- Clear error messages and debugging guidance
110+
- Integrated development environment:
111+
- Hot reload for both frontend and backend
112+
- Database query logging and profiling
113+
- API request/response logging
114+
- Performance monitoring with Core Web Vitals
115+
- Debugging tools:
116+
- React Developer Tools integration
117+
- Database query inspector
118+
- Authentication flow debugger
119+
- Code generation tools:
120+
- Component scaffolding
121+
- API endpoint generation
122+
- Database schema generation from models
123+
124+
### File Management
125+
126+
- Configurable file upload system:
127+
- Local filesystem storage
128+
- Cloud storage providers (AWS S3, Google Cloud, Azure)
129+
- Image processing and optimization
130+
- File type validation and security scanning
131+
- Media library with organization features
132+
- CDN integration for optimal performance
133+
134+
### Content Management
135+
136+
- Flexible content types with custom fields
137+
- WYSIWYG editor with plugin support
138+
- Content versioning and revision history
139+
- Workflow management (draft, review, published)
140+
- SEO optimization tools
141+
142+
## Technical Architecture
143+
144+
### Frontend Stack
145+
146+
- Next.js 15 with App Router
147+
- React 19 with Server Components
148+
- TypeScript 5 with strict configuration
149+
- Tailwind CSS 4 with Shadcn UI components
150+
- Zod 3 for runtime validation
151+
- React Hook Form 7 for form management
152+
- Next-intl for internationalization
153+
154+
### Backend Stack
155+
156+
- Hono.js 4 for API development
157+
- Drizzle ORM with PostgreSQL
158+
- Zod OpenAPI for API documentation
159+
160+
### Development Tools
161+
162+
- Turborepo for monorepo management
163+
- Vitest for unit testing
164+
- Playwright for end-to-end testing
165+
- ESLint and Prettier for code quality
166+
- Docker for containerization
91167

92168
## Features Planned for Future Releases
93169

94-
The following features are not included in the MVP but will be available in future iterations:
170+
The following features are planned for upcoming releases:
95171

96-
- File uploads
97-
- WYSIWYG editor
98-
- WebSockets
99-
- Caching
100-
- Rate limiting
101-
- Additional analytics features
172+
- WebSocket support for real-time features
173+
- Advanced caching strategies (Redis, Memcached)
174+
- Enhanced rate limiting with Redis backend
175+
- Advanced analytics and reporting
176+
- Marketplace for community plugins
177+
- Multi-tenant architecture support
178+
- Advanced workflow automation
179+
- AI-powered features (content generation, smart suggestions)
102180

103181
## Success Criteria
104182

105183
### Developer Experience
106184

107-
- Developers should be able to easily create and manage applications using the VitNode framework
108-
- Measured by user feedback and time taken to create CRUD operations, forms, and plugins
109-
- Positive user feedback regarding ease of use and framework utility
185+
- Developers should create a basic CRUD application within 30 minutes
186+
- Plugin development should take less than 2 hours for basic functionality
187+
- Framework adoption measured by:
188+
- GitHub stars and community engagement
189+
- Plugin ecosystem growth
190+
- Developer feedback scores (target: 4.5/5)
110191

111192
### Performance
112193

113-
- Complex pages should have a score of 90+ in Lighthouse
114-
- Achieved through code splitting, lazy loading, image optimization, and static page generation with suspense
194+
- Lighthouse scores of 95+ for all generated pages
195+
- Time to First Byte (TTFB) under 200ms
196+
- Largest Contentful Paint (LCP) under 1.5 seconds
197+
- Cumulative Layout Shift (CLS) under 0.1
115198

116199
### Accessibility
117200

118-
- UI should be accessible and follow WCAG 2.1 guidelines
119-
- Components should be properly labeled and compatible with screen readers
201+
- WCAG 2.1 AA compliance for all UI components
202+
- Screen reader compatibility testing
203+
- Keyboard navigation support
204+
- Color contrast ratios meeting accessibility standards
120205

121206
### Deployment
122207

123-
- VitNode should deploy applications with minimal configuration to:
124-
- Vercel (serverless) with Supabase (PostgreSQL)
125-
- Docker (self-hosted)
208+
- One-click deployment to major platforms:
209+
- Vercel with Supabase/PlanetScale
210+
- AWS with RDS
211+
- Google Cloud Platform
212+
- Self-hosted with Docker Compose
213+
- Deployment time under 5 minutes for basic applications
126214

127215
### Documentation
128216

129-
- Complete and up-to-date documentation for all framework features
130-
- Positive user feedback on documentation quality and usefulness
131-
- Effective examples and best practices to facilitate framework usage
217+
- Complete API documentation with interactive examples
218+
- Step-by-step tutorials for common use cases
219+
- Video tutorials for complex features
220+
- Community-contributed examples and patterns
221+
- Documentation satisfaction score of 4.7/5
132222

133223
## Developer Workflow
134224

135-
The ideal developer workflow includes:
225+
The recommended developer workflow:
136226

137-
1. `npx create-vitnode-app` to create a new project
138-
2. `npm install` to install dependencies
139-
3. `npm run docker:dev` to start database in Docker
140-
4. `npm run dev` to start the development server
141-
5. `npm run build` to build the application for production
142-
6. `npm run start` to start the production server
227+
1. **Project Creation**
228+
229+
```bash
230+
npx create-vitnode-app@latest my-app
231+
cd my-app
232+
```
233+
234+
2. **Development Setup**
235+
236+
```bash
237+
pnpm install
238+
pnpm db:push # Set up database schema
239+
pnpm db:seed # Populate with initial data
240+
```
241+
242+
3. **Development**
243+
244+
```bash
245+
pnpm dev # Start development servers
246+
pnpm dev:docs # Start documentation server
247+
```
248+
249+
4. **Plugin Development**
250+
251+
```bash
252+
pnpm create:plugin my-plugin
253+
cd plugins/my-plugin
254+
pnpm dev
255+
```
256+
257+
5. **Testing**
258+
259+
```bash
260+
pnpm test # Run unit tests
261+
pnpm test:e2e # Run end-to-end tests
262+
pnpm test:coverage # Generate coverage report
263+
```
264+
265+
6. **Production Build**
266+
267+
```bash
268+
pnpm build # Build all applications
269+
pnpm start # Start production server
270+
```
271+
272+
7. **Deployment**
273+
```bash
274+
pnpm deploy # Deploy to configured platform
275+
```
276+
277+
## Quality Assurance
278+
279+
- Automated testing pipeline with 90%+ code coverage
280+
- Performance monitoring with automated alerts
281+
- Security scanning with dependency vulnerability checks
282+
- Accessibility testing with automated tools
283+
- Cross-browser compatibility testing
284+
- Load testing for high-traffic scenarios

0 commit comments

Comments
 (0)