This project is a starter template for building modern web applications using React together with Claude Code. It provides a quick and clean setup, so you can focus on writing features instead of boilerplate configuration.
Features
β‘ Quick start: minimal configuration to get your app running fast.
π Claude Code integration: ready-to-use setup for experimenting with Claude's coding capabilities.
π¨ React best practices: structured project with reusable components and clear organization.
π Extensible: easily adaptable for small prototypes or larger projects.
Use cases
Kickstarting new React projects without wasting time on setup.
Prototyping apps that leverage Claude Code for AI-assisted development.
Learning how to integrate Claude into a modern React environment.
Modern Next.js template with SOLID architecture, TypeScript, Tailwind CSS and Vertical Slice organization.
π English | PortuguΓͺs
# Clone and setup automatically
git clone <this-repo> my-app
cd my-app
npm run setup
# Start development (everything configured automatically)
npm run dev
- Next.js 14+ with App Router
- TypeScript + Tailwind CSS + shadcn/ui
- SOLID Architecture with Vertical Slice
- Supabase for auth & database (local)
- RBAC System with granular permissions
- Payment Integration (Stripe, Paddle, LemonSqueezy)
- Git hooks (Husky + lint-staged) for code quality
- Single Responsibility - One class/function = one responsibility
- Open/Closed - Open for extension, closed for modification
- Liskov Substitution - Subtypes must be substitutable
- Interface Segregation - Specific interfaces > general interfaces
- Dependency Inversion - Depend on abstractions, not concretes
- shadcn/ui MCP - Install/manage UI components
- Playwright MCP - Browser automation & testing
- Figma MCP - Design-to-code integration
- Apify MCP - Web scraping & data extraction
- Browser Automation MCP - Additional browser control
- Gemini MCP - Google AI model integration
- Context7 MCP - Real-time documentation search
- Stripe MCP - Payment processing integration
- Supabase MCP - Local Supabase database operations
- Filesystem MCP - File system operations
- Serena MCP - AI coding agent toolkit
Note: Git/GitHub operations use standard CLI tools (GitHub CLI + Git) for better performance.
Automatic code quality checks on Git operations:
- Pre-commit: Auto-format, lint, and type-check before commits
- Pre-push: Final validation before pushing to remote
- Commit-msg: Validates commit message format (optional)
- RBAC System - Role-based access control with Supabase RLS
- Multi-tenant - Organization-based permissions
- JWT Claims - Automatic role/permission injection
- VibeKit - AI agent sandbox isolation
- Payment Processing - Stripe, Paddle, LemonSqueezy support
- Subscription Management - Complete billing workflows
- Customer Portal - Self-service billing management
- Webhook Handling - Automated payment event processing
- GitHub Spec Kit - Specification-first development methodology
- Structured AI interactions with Claude Code
- Living documentation that evolves with code
npm run setup # Complete setup
npm run setup:spec-kit # Setup Spec-Driven Development
npm run dev # Development server
npm run build # Production build
npm run lint:fix # Fix linting issues
npm run format # Format code
npm run generate:feature # Generate new feature
src/
βββ app/ # Next.js App Router
βββ components/ # Global components
β βββ ui/ # shadcn/ui components
βββ features/ # Business domains (Vertical Slice)
β βββ [feature]/
β β βββ components/ # Domain-specific UI
β β βββ hooks/ # Domain hooks
β β βββ services/ # Business logic
β β βββ stores/ # Domain state
β β βββ types/ # Domain types
βββ shared/ # Cross-cutting concerns
β βββ components/ # Shared components
β βββ hooks/ # Global hooks
β βββ stores/ # Global state
β βββ services/ # Infrastructure services
β βββ utils/ # Utilities
βββ config/ # Configuration
βββ tests/ # E2E tests
βββ middleware.ts # Route middleware
specs/ # π Spec-Driven Development
βββ requirements.md # Product specifications
βββ plan.md # Technical implementation plan
βββ tasks/ # Actionable task breakdown
docs/ # π Documentation
βββ MCP-SERVERS.md # MCP configuration guide
βββ SPEC-DRIVEN-DEVELOPMENT.md # Spec Kit usage
βββ RBAC.md # Role-based access control guide
βββ HOOKS.md # Git hooks documentation
Features/ - Domain-specific business code:
- β
Components that only exist in one context (e.g.,
UserProfileCard
) - β
Specific business logic (e.g.,
calculateOrderTotal
) - β
Domain local state (e.g.,
useProductFilters
) - β
Domain types (e.g.,
interface Product
)
Shared/ - Reusable code across multiple domains:
- β
Generic components (e.g.,
Button
,Modal
,Toast
) - β
Utility hooks (e.g.,
useDebounce
,useLocalStorage
) - β
Global application state (e.g.,
authStore
,themeStore
) - β
Infrastructure services (e.g.,
apiClient
,logger
) - β
Pure utilities (e.g.,
formatCurrency
,validateEmail
)
Golden rule: If used by 2+ features β shared/
. If specific to one feature β features/[name]/
What they are: TypeScript interfaces and types that define data structures.
When to use:
- Define API data formats
- Create contracts between layers
- Ensure type safety
- Document data structures
Example:
// features/users/types/user.types.ts
export interface User {
id: string
email: string
name: string
}
Where to place:
features/[domain]/types/
- Domain-specific typesshared/types/
- Globally shared types
What they are: Functions that encapsulate state logic and React side effects.
When to use:
- Share logic between components
- Manage component local state
- Execute side effects (API calls, subscriptions)
- Abstract complex UI logic
Example:
// features/users/hooks/useUser.ts
export function useUser(userId: string) {
const [user, setUser] = useState<User>()
const [loading, setLoading] = useState(true)
useEffect(() => {
userService.getById(userId)
.then(setUser)
.finally(() => setLoading(false))
}, [userId])
return { user, loading }
}
Where to place:
features/[domain]/hooks/
- Domain-specific hooksshared/hooks/
- Global utility hooks
What they are: Shared state containers between components using Zustand.
When to use:
- State that needs to be accessed by multiple components
- Data that persists between page navigations
- User data cache
- Application state (theme, language, authentication)
Example:
// shared/stores/auth.store.ts
export const useAuthStore = create((set) => ({
user: null,
isAuthenticated: false,
login: (user) => set({ user, isAuthenticated: true }),
logout: () => set({ user: null, isAuthenticated: false })
}))
Where to place:
shared/stores/
- Global state (auth, theme, UI)features/[domain]/stores/
- Domain-specific state
I need to... | Use | Example |
---|---|---|
Define data format | Types | interface Product { id: string; name: string } |
Fetch data in a component | Hook | useProduct(id) returns product and loading |
Share state between pages | Store | Shopping cart, logged user |
Validate data structure | Types + Zod | Validation schema with types |
Temporary form state | Hook | useForm() with react-hook-form |
API data cache | Store or React Query | Already loaded products list |
Reusable UI logic | Hook | useModal() , useDebounce() |
Global settings | Store | Theme, language, preferences |
The src/middleware.ts
file manages:
- Route protection and authentication
- Request/response modifications
- Redirects and rewrites
- Access control for protected routes
Location: src/middleware.ts
(same level as src/app/
)
Local Supabase is automatically installed and configured.
To change keys: edit scripts/setup-all.js
lines 127-129.
- Database: http://127.0.0.1:54321
- Dashboard: http://127.0.0.1:54323
npm run test # Run tests
npm run test:watch # Watch mode
npm run test:coverage # Coverage report
npm run test:e2e # Run E2E tests
npm run test:e2e:ui # Visual interface
npm run generate:feature
# Follow prompts:
# - Feature name (e.g., products)
# - Include store? (y/n)
# - Include service? (y/n)
This will create complete structure:
features/products/
βββ components/
βββ hooks/
βββ services/
βββ stores/
βββ types/
βββ index.ts
# 1. Setup Spec Kit
npm run setup:spec-kit
# 2. Start specifying in Claude Code
/specify Build a user dashboard with analytics and settings
# 3. Plan implementation
/plan Use our SOLID providers (Auth, Database, Theme) + shadcn/ui
# 4. Break into tasks
/tasks
# 5. Implement
implement specs/plan.md
Benefits:
- π Structured development with clear specifications
- π€ Enhanced AI interactions with consistent context
- π Living documentation that evolves with code
- ποΈ SOLID integration - specs leverage existing architecture
See Spec-Driven Development Guide for detailed usage.
// 1. Wrap your app with RBAC provider
<RBACProvider>
<App />
</RBACProvider>
// 2. Protect components with permissions
<RBACGuard permissions={['users.create']}>
<CreateUserButton />
</RBACGuard>
// 3. Use hooks for conditional logic
const { hasPermission, hasRole } = useRBAC()
if (hasPermission('billing.read')) {
// Show billing section
}
// 4. Admin-only components
<AdminGuard fallback={<div>Access denied</div>}>
<AdminPanel />
</AdminGuard>
Features:
- π― Granular permissions - Resource-based access control
- π’ Multi-tenant - Organization-scoped permissions
- β‘ JWT integration - Permissions in token for performance
- π Supabase RLS - Database-level security
- π¨ React components - Guards, hooks, and providers
See RBAC Documentation for complete guide.
- Check if similar code already exists
- Confirm requirements with user
- Plan following SOLID principles
- One responsibility per class/function
- Use appropriate TypeScript types
- Reuse existing code
- Follow project patterns
- Run linter and type-check
- Add/update tests
- Request user approval
This template integrates and adapts code from the excellent Next.js SaaS Starter by Vercel:
- Repository: nextjs/saas-starter
- Features integrated: Stripe payments, RBAC system, activity logging
- Adapted with: SOLID architecture, MCP integration, Spec-Driven Development
Special thanks to the Vercel team for creating such a solid foundation for SaaS applications! π
We've enhanced their approach with:
- β SOLID principles implementation
- β 11+ MCP servers for enhanced development
- β Spec-Driven Development methodology
- β Provider abstractions for extensibility
MIT
Built with SOLID principles and software engineering best practices.