This project was heavily generated by Windsurf AI. I was wondering how far I can go with just AI prompts and trying not to write anything by myself. I started with the prompt - something like "I want to create a monorepo with Nx.dev, I want to use NextJS for FE and BFF, I want to use Vitest and Playwrite for testing, storybook with shadcn/ui, I want to use bun instead of npm or pnpm" - maybe not exact prompt, but close.
Then I realised that new AIs and VS Code forks appears every day or two, and I need a way to share my ideas and vision with other AIs or humans who might be interested in the project or who might be able to help. So I throw into AI some architecture ideas / patterns / tools and best practices and asked to put them into /docs section in .md files - so other AIs or humans might read, understand and follow them. I also asked AI to update docs when I make changes and vice versa - when I manually update .md files - this means we need to update the codebase. So far this strategy works pretty well, and highly effective.
This repository contains the source code for the ACME project. It's a blueprint / playground for a common projects.
It suppose to have some core features, pretty much any project should have:
- auth
- roles:user / customer / admin
- admin dashboard
- user dashboard
- some basic CRUD operations (basic API patterns, search, filtering, sorting, pagination, etc)
- some UI components
- send emails / push notifications
- upload files / images
- messanger (text chat, voice chat, video chat, AI chat, group chat, file sharing, etc)
Might be extended to have more specific features like:
- blog
- forum
- knowledge base / FAQ / support
- social media / networking
- e-commerce / app store / online store / marketplace
- AI / chatbot
- job board / recruiting / freelance
- dating app
- events / calendar
- media (news aggregator, music, radio, podcasts, video, games, etc.)
- web scraping / crawling / scraping
- analytics / monitoring
- SaaS / CRM / ORM
- crowdfunding / venture capital / startup
- internal tools for business operations and automation
- etc.
/acme
βββ .windsurfrules # AI guidelines and instructions for Windsurf
βββ .cursorrules # Symlink to .windsurfrules for Cursor
βββ .github
β βββ workflows # GitHub Actions workflows
β βββ PULL_REQUEST_TEMPLATE
β βββ copilot-instructions.md # Symlink to .windsurfrules for GitHub Copilot
β
βββ /apps # Application-specific code
β βββ /web # Next.js web application (including admin)
β βββ /mobile # Expo mobile application
β βββ /desktop # Nextron desktop application
β βββ /services # Backend services (Hono/Elysia)
β βββ /chatbots # Various chatbot implementations
β
βββ /packages # Shared packages
β βββ /ui # UI components and design system
β βββ /config # Shared configuration
β βββ /types # Shared TypeScript types
β
βββ /libs # Feature libraries
β βββ /auth # Authentication and authorization
β βββ /user # User management
β βββ /blog # Blog functionality
β βββ /chat # Messaging system
β βββ /media # Media handling
β
βββ /docs # Project documentation
β βββ /architecture # Architecture diagrams and decisions
β βββ /development # Development guidelines
β βββ /deployment # Deployment procedures
β βββ /security # Security guidelines
β βββ /testing # Testing strategies
β
βββ /templates # Project templates
β βββ /ui # UI component templates
β β βββ /component # Basic component template
β β βββ [name].tsx
β β βββ [name].stories.tsx
β β βββ [name].spec.tsx
β β βββ README.md
β β βββ index.ts
β β
β βββ /feature # Feature implementation templates
β βββ /[name] # Feature template structure
β βββ /docs # Feature documentation
β β βββ REQUIREMENTS.md
β β βββ TECHNICAL.md
β β βββ TESTING.md
β βββ /design # Design assets
β β βββ /wireframes
β β βββ /mockups
β β βββ /user-flows
β βββ /src # Implementation
β βββ README.md
β
βββ /tools # Internal tooling
β βββ /scripts # Utility scripts
β βββ /generators # Code generators
β βββ /helpers # Helper utilities
β
βββ /.husky # Git hooks for code quality and security
β βββ /pre-commit # Pre-commit validation and checks
β βββ /commit-msg # Commit message validation
β βββ /post-checkout # Environment and dependency management
β
βββ /specs # Detailed specifications
β βββ /requirements # Feature requirements
β βββ /ui-ux # UI/UX specifications
β βββ /technical # Technical specifications
β βββ /testing # Test specifications
β
βββ /ideas # Project ideas and proposals
β βββ /features # Feature ideas
β βββ /improvements # Improvement proposals
β βββ /experiments # Experimental concepts
β
βββ /tmp # Temporary files and drafts
This project implements comprehensive security measures:
- Dependabot: Automated dependency updates and security patches
- CodeQL Analysis: Continuous code scanning for vulnerabilities
- Security Headers: Robust HTTP security headers implementation
- Rate Limiting: API protection against abuse
For detailed security information and vulnerability reporting guidelines, see our Security Documentation.
The UI component template provides a standardized structure for creating new components:
/templates/ui/component
βββ [name].tsx # Component implementation
βββ [name].stories.tsx # Storybook stories
βββ [name].spec.tsx # Component tests
βββ README.md # Component documentation
βββ index.ts # Public exports
The feature template includes everything needed for full feature implementation:
/templates/feature/[name]
βββ /docs
β βββ REQUIREMENTS.md # Customer requirements
β βββ TECHNICAL.md # Technical specifications
β βββ TESTING.md # Testing strategy
βββ /design
β βββ /wireframes # Low-fidelity designs
β βββ /mockups # High-fidelity designs
β βββ /user-flows # User flow diagrams
βββ /src # Implementation
βββ README.md # Feature overview
The ideas directory is organized to capture various types of proposals:
/ideas
βββ /features # New feature proposals
β βββ FEATURE_1.md
β βββ FEATURE_2.md
βββ /improvements # Improvement suggestions
β βββ IMPROVEMENT_1.md
β βββ IMPROVEMENT_2.md
βββ /experiments # Experimental concepts
βββ EXPERIMENT_1.md
βββ EXPERIMENT_2.md
We provide CLI tools to scaffold new components and features:
# Create a new UI component
bun run create:component Button
# Create a new feature
bun run create:feature UserAuthentication
# Generate implementation from idea
bun run implement:idea features/FEATURE_1.mdThese commands will:
- Copy the appropriate template
- Replace placeholders with actual names
- Prompt for additional information
- Use AI to help generate initial content
- Set up the required file structure
-
Authentication & Authorization
- Multi-factor authentication
- Role-based access control
- OAuth2 integration
- JWT implementation
-
User Management
- User profiles
- Role management (user/customer/admin)
- Account settings
- Preferences management
-
Dashboard Systems
- Admin dashboard
- User dashboard
- Analytics and reporting
- Activity monitoring
-
API Features
- RESTful and GraphQL endpoints
- Advanced CRUD operations
- Search functionality
- Filtering and sorting
- Pagination
- Rate limiting
- Caching
-
UI Components
- shadcn/ui integration
- Responsive design
- Theme customization
- Accessibility compliance
-
Communication
- Email notifications
- Push notifications
- Real-time updates
- Webhook integrations
-
File Management
- File upload/download
- Image processing
- Document handling
- Cloud storage integration
-
Messaging System
- Text chat
- Voice chat
- Video chat
- AI chat integration
- Group chat
- File sharing
- Message encryption
-
Security Infrastructure
- Automated security scanning with Trivy
- Secret detection with Gitleaks
- Dependency vulnerability scanning
- Pre-commit security hooks
- Environment variable protection
- See Security Documentation for details
-
Content Management
- Blog system
- Forum functionality
- Knowledge base
- FAQ management
- Support ticketing
-
Social Features
- User profiles
- Social connections
- Activity feeds
- Content sharing
-
E-commerce
- Product management
- Shopping cart
- Payment processing
- Order management
- Inventory tracking
-
AI Integration
- Chatbots
- Content generation
- Recommendation systems
- Automated moderation
-
Business Tools
- Job board
- Recruiting system
- Freelance marketplace
- Project management
-
Media Features
- News aggregation
- Podcast system
- Video streaming
- Music playback
- Gaming integration
-
Data & Analytics
- Web scraping
- Data visualization
- Performance monitoring
- User analytics
-
Business Operations
- CRM functionality
- SaaS features
- Automation tools
- Workflow management
This project uses a shared set of AI guidelines stored in .windsurfrules. To ensure consistent AI assistance across different tools, we maintain symlinks to this file:
.cursorrules- Symlink for Cursor AI.github/copilot-instructions.md- Symlink for GitHub Copilot
These files contain shared instructions, best practices, and conventions that all AI assistants should follow when helping with this project. This ensures consistency in code generation, suggestions, and automated tasks across different AI tools.
For detailed documentation, please refer to:
The project uses Bun as the package manager. Here are the key commands:
# Install dependencies in all packages
bun run install:all
# Clean up dependencies and artifacts
bun run clean:all # Clean with confirmation
bun run clean:all --force # Clean without confirmation
bun run clean:all --dry-run # Show what would be cleanedWe use a custom docs-manager tool to maintain documentation:
# Format documentation
bun run docs:format # Format with preview
bun run docs:format:check # Check formatting
bun run docs:format:fix # Fix formatting issues
bun run docs:maintain # Run all documentation maintenance tasksThese tools are located in the /tools directory:
cleanup- Manages project cleanup (dependencies, artifacts, etc.)docs-manager- Handles documentation formatting and maintenancedocs-fetcher- Fetches and processes documentation
All build outputs, test results, and generated files are organized under the artifacts directory in the root:
artifacts/
βββ apps/
β βββ web/
β β βββ dist/ # Production build
β β βββ dev/ # Development build
β β βββ coverage/ # Test coverage
β β βββ storybook/ # Storybook static build
β β βββ lint/ # ESLint output
β βββ web-e2e/
β βββ playwright/ # Playwright test results
β β βββ html-report/
β β βββ results.xml
β βββ lint/ # ESLint output
β βββ types/ # TypeScript checking output
βββ packages/ # (for future package outputs)
This structure ensures:
- All generated files are in one centralized location
- Clear separation between different types of outputs
- Easy cleanup of all generated files
- Prevention of source directory clutter
- Consistent structure across all projects
- Better CI/CD integration with predictable paths
The project includes a cleanup script to manage generated files and caches:
# Basic cleanup
bun run cleanup
# Cleanup and reinstall dependencies
bun run cleanup --reinstallThe cleanup script handles:
- Build outputs (
artifactsdirectory) - Build caches (
.next,dist, etc.) - Test coverage directories
- Node modules and package manager files
- Nx cache
- Any stray output directories
- Runtime & Package Management: Bun
- Frontend: Next.js, TypeScript, Tailwind CSS, shadcn/ui
- Testing: Vitest, Playwright
- UI Development: Storybook
- Monorepo Management: Nx.dev
- Version Control: Git
- CI/CD: GitHub Actions
- Node.js >= 20.0.0
- Bun >= 1.0.0
- Git
# Clone the repository
git clone https://github.com/yourusername/acme.git
cd acme
# Install dependencies
bun install
# Set up security tools
bun run security:setup
# Start development server
bun run dev- Nx Console for VS Code
- ESLint + Prettier
- Husky for Git hooks
- Security scanning tools (Trivy, Gitleaks)
Describe how to use the project here.
For information about contributing to this project, please see our contributing guide.
This project is licensed under the MIT License - see the LICENSE file for details.