Package Exports
- starkon
- starkon/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (starkon) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
π Starkon - Next.js Starter Generator
π Create production-ready Next.js applications in seconds, not hours
Starkon is an opinionated Next.js starter generator. It scaffolds complete applications through an interactive CLI and ships multiple production-ready starting points for SaaS, corporate, landing page, dashboard, and minimal setups.
What Starkon Is
- A CLI-first project generator for bootstrapping full Next.js applications
- A curated set of starter templates with shared conventions and ready-to-run app structure
- A faster alternative to assembling auth, i18n, UI primitives, and project structure by hand
What Starkon Is Not
- Not a general-purpose UI component library to install as a runtime dependency in an existing app
- Not a lightweight single-component package similar to a design system primitive export
- Not a drop-in replacement for an already-established application architecture
The reusable components inside this repository exist to power the generated starter projects. The main product is the scaffolding workflow invoked by npx starkon.
β¨ Interactive Template Selection
npx starkon my-appThe interactive menu shows 3 primary templates. You can access 3 additional specialized templates via the --template flag:
- ποΈ Full App Starter - Full-stack with auth & i18n
- π― Landing Page - Marketing-optimized single page
- π’ Corporate - Business website with CMS
- π Dashboard - Admin panel optimized (manual:
--template dashboard) - β‘ Basic - Essential setup (manual:
--template basic) - π― Minimal - Bare-bones (manual:
--template minimal)
β‘ Quick Start
π― Interactive CLI Menu
Simply run the command and choose your template:
npx starkon my-appYou'll see an interactive menu with 3 primary options:
- β― Full App Starter - Full-featured with auth & i18n
- Landing Starter - Single-page marketing site
- Corporate Starter - Business website with CMS
Use ββ arrow keys to navigate and Enter to select.
π Complete Setup
npx starkon my-awesome-app
# β Interactive menu appears
# β Select template with arrow keys
# β Press Enter to confirm
cd my-awesome-app
npm install
npm run devYour Next.js app will be running at http://localhost:3000 π
πββοΈ Skip Interactive Menu
Use --template when you want direct access to all 6 available templates without going through the interactive selector.
You can also specify template directly:
npx starkon my-app --template corporate # Business website
npx starkon my-app --template landing # Marketing page
npx starkon my-app --template standard # Full-stack appπ― Template Library
Choose the perfect starting point for your specific use case:
π’ Corporate Template β
Complete business website with content management system.
npx starkon company-website --template corporatePerfect for:
- Corporate websites
- Agency portfolios
- Business landing pages
- Service companies
Includes:
- π Pages: Home, About, Services, Blog, Gallery, Contact
- π§© Components: ServiceCard, TeamMember, BlogCard, GalleryItem
- π Content System: Built-in content management with TypeScript interfaces
- π¨ Professional Design: Clean, modern business aesthetic
- π± Responsive: Mobile-optimized layouts
Excludes: Authentication system, i18n complexity for cleaner corporate focus
π― Landing Template β Popular
Single-page marketing websites optimized for conversions.
npx starkon product-launch --template landingPerfect for:
- Product launches
- SaaS marketing sites
- Portfolio websites
- Event pages
Includes:
- π¨ Sections: Hero, Features, Testimonials, CTA, Contact
- β‘ Animations: Smooth scroll-triggered animations with Framer Motion
- π Forms: Contact forms with validation
- π― CTA Optimized: Conversion-focused design patterns
Excludes: Authentication, i18n, dashboard components for faster loading
ποΈ Full App Starter (Full-Featured)
Complete full-stack setup with all enterprise features.
npx starkon enterprise-app --template standardPerfect for:
- SaaS applications
- Admin dashboards
- Enterprise tools
- Multi-user platforms
Includes:
- π Authentication: JWT-based auth with session management
- π i18n: English/Turkish with easy language addition
- π Dashboard: Admin panels and user management
- π‘οΈ Security: Protected routes, XSS protection
- π¨ Complete UI Kit: 46 production-ready components
β‘ Basic Template
Essential Next.js setup without complexity.
npx starkon simple-app --template basicPerfect for:
- Small projects
- Prototypes
- Learning Next.js
- Quick experiments
Includes: Next.js 16, TypeScript, Tailwind CSS, ESLint Excludes: Authentication, i18n, complex UI components
π Dashboard Template
Admin dashboard optimized for data-heavy applications.
npx starkon admin-panel --template dashboardPerfect for:
- Admin dashboards
- Analytics tools
- Data management
- Internal tools
Includes: Dashboard layout, data tables, charts integration, auth system Excludes: Public marketing pages
π― Minimal Template
Bare-bones Next.js setup for maximum control.
npx starkon minimal-app --template minimalPerfect for:
- Custom implementations
- Learning projects
- Starting from scratch
Includes: Next.js 16, TypeScript only Excludes: Everything else - build your own way
ποΈ Generated Project Overview
Project Structure
generated-app/
βββ src/
β βββ app/ # Next.js App Router
β β βββ (auth)/ # π Protected route group
β β βββ (authentication)/ # π Auth flows (Login, register, etc.)
β β βββ corporate/ # π’ Corporate pages
β β βββ public/ # π― Marketing pages
β β βββ page.tsx # Entry point
β β βββ layout.tsx # Root layout
β βββ features/ # ποΈ Feature-Sliced modules
β β βββ auth/ # Complete Auth feature
β β βββ context/ # AuthProvider
β β βββ hooks/ # useAuth
β β βββ services/ # API communication
β β βββ types/ # Auth definitions
β β βββ lib/ # Feature utilities
β βββ components/ # Shared UI components
β β βββ core/ # π§© Base UI Kit primitives
β β βββ forms/ # Form abstractions
β β βββ layout/ # Navigation & Footer
β βββ lib/ # π‘οΈ Enterprise utilities
β β βββ api.ts # Monitored Axios client
β β βββ auth-middleware.ts # Edge-compatible security
β β βββ monitoring/ # Client-side telemetry
β β βββ i18n/ # Transport error handling
β βββ constant/ # βοΈ Global configurations
β βββ i18n/ # i18next initialization
β βββ messages/ # π Consolidated translations
β βββ hooks/ # Shared React hooks
β βββ providers/ # Global Context providers
β βββ store/ # Client state (Zustand)
β βββ styles/ # Global CSS (HSL system)
β βββ types/ # Shared TypeScript types
βββ public/ # Static assets
βββ tailwind.config.mjs # Premium HSL design system
βββ next.config.mjs # Next.js configurationTechnology Stack In The Generated App
Core Framework:
- Next.js 16 - App Router, Server Components, optimized performance
- React 19 - Latest React features and improvements
- TypeScript 5.7 - Full type safety and developer experience
UI & Design:
- Premium HSL Design System - Dynamic tokens for
void-black,obsidian, andarcly-blue - Radix UI - Accessible, unstyled component primitives
- Tailwind CSS 3.4 - Utility-first styling with custom glassmorphism effects
- class-variance-authority - Type-safe component variants
- Framer Motion - Smooth animations and transitions
- Lucide React - Beautiful, consistent icon library
- Advanced CSS Variables - System-wide theming with semantic tokens
State & Data:
- React Query (@tanstack/react-query) - Server state management and caching
- Zustand 5.0 - Lightweight client state management
- Redux + Redux Persist - Optional complex state with persistence
- React Hook Form - Performant forms with validation
API & HTTP:
- Monitored Axios Client - HTTP client with TTFB and duration telemetry
- Edge-Compatible Auth - Web Crypto based JWT verification
- Request/response queuing - Token refresh handling
- FormData support - File upload integration
- Advanced Interceptors - Auto token attachment and telemetry collection
Forms & Validation:
- React Hook Form - Form state management
- Zod - TypeScript-first schema validation
- @hookform/resolvers - Form validation integration
Internationalization:
- i18next - Complete i18n solution
- react-i18next - React integration
- Browser language detection - Automatic locale detection
- localStorage + cookie persistence - Language preference storage
Advanced Features:
- cmdk - Command menu (Cmd+K)
- react-dropzone - File upload interface
- @tanstack/react-table - Headless table library
- date-fns - Date manipulation utilities
- crypto-js - Encryption utilities
- react-error-boundary - Error handling
Development:
- ESLint - Code linting with Next.js rules
- Prettier - Code formatting with Tailwind plugin
- Jest - Unit testing framework
- React Testing Library - Component testing utilities
- Husky - Git hooks
- Commitizen - Conventional commits
π Authentication System
Features
- JWT Tokens - Secure access and refresh token system
- Auto-refresh - Automatic token renewal with 5-minute buffer
- Session Management - Persistent login with "Remember Me"
- Protected Routes - Middleware-based route protection
- Mock Development - Built-in test users for development
- 4 Auth Flows - Login, Register, Forgot Password, Reset Password, Verify Email
Development Users
// Available test accounts
admin@example.com / admin123 // Full admin access
user@example.com / user123 // Standard user
demo@example.com / demo123 // Demo accountAuth Usage
import { useAuth } from '@/hooks/useAuth'
function Dashboard() {
const { user, logout, isAuthenticated } = useAuth()
if (!isAuthenticated) return <LoginForm />
return <h1>Welcome {user.name}!</h1>
}Authentication Architecture
5-Layer System:
- Token Management (
features/auth/services/sessionTokenManager.ts) - sessionStorage with 5-minute refresh buffer - API Service (
features/auth/services/authApiService.ts) - Environment-based mock/real API switching - Auth Provider (
features/auth/context/AuthProvider.tsx) - React Context with periodic validation - Middleware (
lib/auth-middleware.ts) - Edge-compatible security routing - Axios Interceptors (
lib/api.ts) - Auto token attachment and telemetry collection
π Internationalization
Built-in Language Support
- English (en) - Complete translations
- Turkish (tr) - Native language support
- Browser Detection - Automatic language detection
- URL Persistence - Language state in URL parameters (
?lang=en) - localStorage & Cookie - Persistent language preference
Detection Priority
- localStorage - Key:
language(permanent) - Cookie - Key:
language(365-day expiry) - URL Parameter -
?lang=tr - Browser Navigator -
navigator.language - Default - Turkish (
tr)
Adding New Languages
# 1. Create translation file
src/locales/es/translation.json
# 2. Add to supported locales
src/lib/i18n.tsi18n Usage
import { useTranslation } from 'react-i18next'
function Component() {
const { t, i18n } = useTranslation()
// Change language
i18n.changeLanguage('en')
return <h1>{t('welcome.title')}</h1>
}π¨ UI Component System
Core Components (46)
Basic Components:
// Form Components
<Button variant="default | outline | ghost | destructive | link" size="sm | md | lg | icon" />
<Input type="text | email | password" />
<PasswordInput showStrength={true} />
<NumberInput min={0} max={100} />
<Textarea placeholder="Enter text..." />
<Checkbox checked={true} />
<Switch enabled={true} />
<Select options={options} />Layout Components:
<Card>
<CardHeader>
<CardTitle>Title</CardTitle>
</CardHeader>
<CardContent>Content</CardContent>
</Card>
<Separator orientation="horizontal | vertical" />
<Accordion type="single | multiple" />
<Tabs defaultValue="tab1">
<TabsList>
<TabsTrigger value="tab1">Tab 1</TabsTrigger>
</TabsList>
</Tabs>
<Collapsible>
<CollapsibleTrigger>Toggle</CollapsibleTrigger>
<CollapsibleContent>Hidden content</CollapsibleContent>
</Collapsible>Data Display:
// Tables with @tanstack/react-table
<DataTable data={data} columns={columns} />
<EnhancedDataTable data={data} columns={columns} searchable sortable />
<DataGrid data={data} />
<Table>
<TableHeader>
<TableRow>
<TableHead>Column</TableHead>
</TableRow>
</TableHeader>
</Table>
<Badge variant="default | secondary | outline | destructive" />
<Avatar src="/avatar.jpg" fallback="JD" />Date & Time:
<Calendar selected={date} onSelect={setDate} />
<DatePicker value={date} onChange={setDate} />
<MonthYearPicker value={date} onChange={setDate} />
<ModernDatePicker value={date} onChange={setDate} />Navigation:
<CommandMenu>
<CommandInput placeholder="Search..." />
<CommandList>
<CommandGroup heading="Suggestions">
<CommandItem>Calendar</CommandItem>
</CommandGroup>
</CommandList>
</CommandMenu>
<DynamicBreadcrumb items={items} />
<EnhancedPaginationControls page={1} totalPages={10} />
<Stepper steps={steps} currentStep={0} />
<ModernDrawer open={isOpen} onClose={close}>
<DrawerContent>Content</DrawerContent>
</ModernDrawer>Feedback:
<Alert variant="default | destructive | warning | info">
<AlertTitle>Alert Title</AlertTitle>
<AlertDescription>Description</AlertDescription>
</Alert>
<AlertDialog>
<AlertDialogTrigger>Open</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogTitle>Are you sure?</AlertDialogTitle>
</AlertDialogContent>
</AlertDialog>
<Skeleton className="w-full h-20" />
<LoadingSpinner size="sm | md | lg" />
<Progress value={50} />
<Toast title="Success" description="Action completed" />Advanced Components:
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogContent>
<DialogHeader>
<DialogTitle>Dialog Title</DialogTitle>
</DialogHeader>
</DialogContent>
</Dialog>
<Dropdown>
<DropdownTrigger>Menu</DropdownTrigger>
<DropdownContent>
<DropdownItem>Item 1</DropdownItem>
</DropdownContent>
</Dropdown>
<Popover>
<PopoverTrigger>Open</PopoverTrigger>
<PopoverContent>Content</PopoverContent>
</Popover>
<Tooltip content="Tooltip text">
<button>Hover me</button>
</Tooltip>
<ScrollArea className="h-96">
<div>Scrollable content</div>
</ScrollArea>
<Slider value={[50]} onValueChange={setValue} />Enterprise Components:
// File Upload with react-dropzone
<FileUpload
accept={{ 'image/*': ['.png', '.jpg'] }}
maxSize={5242880}
onDrop={handleDrop}
/>
// Rich Text Editor
<RichTextEditor
value={content}
onChange={setContent}
placeholder="Start typing..."
/>
// Advanced Search with Filters
<EnhancedSearchFilters
filters={filters}
onFilterChange={handleFilterChange}
/>
// Accessibility Enhancer
<AccessibilityEnhancer skipToContentId="main">
<YourContent />
</AccessibilityEnhancer>
// Enterprise Error Boundary
<EnterpriseErrorBoundary
fallback={<ErrorFallback />}
onError={logError}
>
<YourApp />
</EnterpriseErrorBoundary>Corporate Components
// Service showcase
<ServiceCard
title="Web Development"
description="Custom web solutions"
features={["React", "Next.js", "TypeScript"]}
icon={Code}
href="/services/web"
/>
// Team member display
<TeamMember
name="John Doe"
role="Lead Developer"
bio="10+ years experience"
image="/team/john.jpg"
social={{ linkedin: "...", github: "..." }}
skills={["React", "Node.js", "AWS"]}
/>
// Blog post cards
<BlogCard
title="Getting Started with Next.js"
excerpt="Learn the fundamentals..."
author={{ name: "Jane Smith", avatar: "/authors/jane.jpg" }}
category="Tutorial"
readingTime="5 min read"
publishedAt="2024-01-15"
/>
// Gallery items
<GalleryItem
image="/projects/project1.jpg"
title="Project Name"
category="Web Design"
description="Project description"
/>Landing Page Sections
// Hero section with CTA
<Hero
title="Build Amazing Apps"
subtitle="Next.js starter for rapid development"
primaryAction="Get Started"
secondaryAction="View Demo"
/>
// Feature showcase
<Features
title="Everything You Need"
features={[
{ title: "Fast Setup", icon: Zap, description: "..." },
{ title: "TypeScript", icon: Shield, description: "..." }
]}
/>
// Social proof
<Testimonials
title="What Developers Say"
testimonials={[
{ name: "Developer", role: "CTO", content: "Amazing tool!" }
]}
/>
// Call to action
<CTA
title="Ready to Build?"
description="Start your next project today"
primaryAction="Get Started"
secondaryAction="View Pricing"
/>πͺ Custom Hooks
Authentication
import { useAuth } from '@/hooks/useAuth'
const { user, login, logout, isAuthenticated, loading } = useAuth()Theme Management
import { useTheme } from '@/hooks/useTheme'
const { theme, setTheme, systemTheme } = useTheme()
setTheme('dark' | 'light' | 'system')Toast Notifications
import { useToast } from '@/hooks/useToast'
const { toast } = useToast()
toast.success('Success message')
toast.error('Error message')
toast.warning('Warning message')
toast.info('Info message')
toast.promise(asyncFn, {
loading: 'Loading...',
success: 'Done!',
error: 'Failed',
})Locale Management
import { useLocale } from '@/hooks/useLocale'
const { locale, setLocale, availableLocales } = useLocale()
setLocale('en' | 'tr')Clipboard Utilities
import { useClipboard } from '@/hooks/useClipboard'
const { copy, copied, error } = useClipboard()
copy('Text to copy')Password Strength
import { usePasswordStrength } from '@/hooks/usePasswordStrength'
const { strength, score, feedback } = usePasswordStrength(password)
// Returns: weak | fair | good | strongForm Utilities
import { useForm } from '@/hooks/useForm'
const { values, errors, handleChange, handleSubmit } = useForm({
initialValues: { email: '', password: '' },
onSubmit: async (values) => {
/* ... */
},
})π Providers
Auth Provider
Manages authentication state across the application.
// Wrap your app
import { AuthProvider } from '@/providers/AuthProvider'
;<AuthProvider>
<YourApp />
</AuthProvider>
// Access auth state
const { user, isAuthenticated, login, logout } = useAuth()i18n Provider
Provides internationalization support.
import { I18nProvider } from '@/providers/I18nProvider'
;<I18nProvider>
<YourApp />
</I18nProvider>React Query Provider
Configures React Query for data fetching and caching.
import { ReactQueryProvider } from '@/providers/ReactQueryProvider'
;<ReactQueryProvider>
<YourApp />
</ReactQueryProvider>Theme Provider
Manages dark/light theme with system preference detection.
import { ThemeProvider } from '@/providers/theme-provider'
;<ThemeProvider defaultTheme='system' storageKey='theme'>
<YourApp />
</ThemeProvider>Toast Provider
Displays toast notifications throughout the app.
import { ToastProvider } from '@/providers/toast-provider'
;<ToastProvider>
<YourApp />
</ToastProvider>π οΈ Development Workflow
Getting Started
# 1. Create project with interactive menu
npx starkon my-project
# β Choose template from menu
# 2. Setup development
cd my-project
npm install
# 3. Start development server
npm run dev
# 4. Open browser
open http://localhost:3000Code Quality
# Linting and formatting
npm run lint # ESLint check
npm run lint:fix # Auto-fix ESLint errors
npm run prettier # Format code
npm run prettier:check # Check formatting
# Type checking
npm run type-check # TypeScript validation
# Testing
npm test # Run test suite
npm run test:watch # Watch mode testing
npm run test:coverage # Coverage reportBuild and Deploy
# Production build
npm run build
# Analyze bundle size
npm run analyze # Opens webpack-bundle-analyzer
# Start production server
npm run startπ CLI Reference
Basic Usage
# Interactive template selection (3 main templates)
npx starkon <project-name>
# Or specify any of 6 templates directly
npx starkon <project-name> --template <template-type>Options
| Option | Description | Example |
|---|---|---|
--template <type> |
Choose template type | --template corporate |
--skip-git |
Skip git repository initialization | - |
--skip-update-check |
Skip version update check | - |
--verbose |
Show detailed output | - |
--config-set <key=value> |
Set user configuration | --config-set locale=en |
--config-get <key> |
Get configuration value | --config-get defaultTemplate |
--clear-cache |
Clear template cache | - |
Template Types
Interactive Menu (3 templates):
| Template | Use Case | Interactive Selection |
|---|---|---|
standard |
Full-stack apps with auth + i18n | Full App Starter |
landing |
Marketing/product pages | Landing Starter |
corporate |
Business websites | Corporate Starter |
Manual Selection Only (3 templates):
| Template | Use Case | Command |
|---|---|---|
dashboard |
Admin panels | npx starkon admin --template dashboard |
basic |
Simple projects | npx starkon simple --template basic |
minimal |
Bare-bones setup | npx starkon minimal --template minimal |
Advanced Examples
# Interactive template selection (recommended)
npx starkon my-awesome-project
# Skip interactive menu with specific template
npx starkon acme-corp --template corporate --skip-git
# Landing page with verbose output
npx starkon product-launch --template landing --verbose
# Configuration management
npx starkon --config-set locale=en
npx starkon --config-get locale
npx starkon --clear-cacheπ Feature Comparison
| Feature | Standard | Corporate | Landing | Dashboard | Basic | Minimal |
|---|---|---|---|---|---|---|
| Core | ||||||
| Next.js 16 | β | β | β | β | β | β |
| TypeScript 5.7 | β | β | β | β | β | β |
| Tailwind CSS | β | β | β | β | β | β |
| React 19 | β | β | β | β | β | β |
| Authentication | ||||||
| JWT Auth System | β | β | β | β | β | β |
| Protected Routes | β | β | β | β | β | β |
| User Management | β | β | β | β | β | β |
| Password Recovery | β | β | β | β | β | β |
| Internationalization | ||||||
| i18n Support | β | β | β | β | β | β |
| Multi-language | β | β | β | β | β | β |
| URL Language Params | β | β | β | β | β | β |
| UI Components | ||||||
| Core UI Kit (46) | β | β | β | β | β | β |
| Corporate Components | β | β | β | β | β | β |
| Landing Sections | β | β | β | β | β | β |
| Dashboard Components | β | β | β | β | β | β |
| Advanced Features | ||||||
| Command Menu (Cmd+K) | β | β | β | β | β | β |
| File Upload | β | β | β | β | β | β |
| Rich Text Editor | β | β | β | β | β | β |
| Data Tables | β | β | β | β | β | β |
| Error Boundaries | β | β | β | β | β | β |
| State Management | ||||||
| React Query | β | β | β | β | β | β |
| Zustand | β | β | β | β | β | β |
| Redux (Optional) | β | β | β | β | β | β |
| Pages & Routing | ||||||
| Public Pages | β | β | β | β | β | β |
| Corporate Pages | β | β | β | β | β | β |
| Auth Pages | β | β | β | β | β | β |
| Dashboard | β | β | β | β | β | β |
| Custom Hooks | ||||||
| useAuth | β | β | β | β | β | β |
| useTheme | β | β | β | β | β | β |
| useToast | β | β | β | β | β | β |
| useLocale | β | β | β | β | β | β |
| useClipboard | β | β | β | β | β | β |
| usePasswordStrength | β | β | β | β | β | β |
| Performance | ||||||
| Bundle Size | Large | Medium | Small | Medium | Small | Tiny |
| Setup Time | 2-3 min | 1-2 min | 1 min | 2 min | 30 sec | 15 sec |
π Deployment Guide
π’ Vercel (Recommended)
Zero-configuration deployment for Next.js apps:
# Install Vercel CLI
npm install -g vercel
# Deploy
vercel
# Production deployment
vercel --prodFeatures:
- Automatic builds on git push
- Edge functions support
- Built-in analytics
- Custom domains
π Netlify
Great for static and hybrid apps:
# Build for deployment
npm run build
# Deploy to Netlify
netlify deploy --prod --dir=.nextπ΅ Docker
For containerized deployment, add a Dockerfile to your scaffolded project:
# Example Dockerfile (add to your project after scaffolding)
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]# Build and run
docker build -t my-starkon-app .
docker run -p 3000:3000 my-starkon-appNote: Dockerfile is not included in the Starkon CLI package itself. Add it to your scaffolded project as needed.
βοΈ Other Platforms
- Railway:
railway deploy - Render: Connect GitHub repository
- AWS Amplify: Push to connected git branch
- Google Cloud:
gcloud app deploy
βοΈ Configuration
Environment Variables
Create .env.local in your project root:
# API Configuration
NEXT_PUBLIC_API_URL=http://localhost:3001/api
NODE_ENV=development
# Authentication (Standard & Dashboard templates)
NEXTAUTH_SECRET=your-secret-key-here-change-in-production
NEXTAUTH_URL=http://localhost:3000
# Database (if using)
DATABASE_URL=postgresql://user:pass@localhost:5432/db
# Analytics (optional)
NEXT_PUBLIC_GA_ID=G-XXXXXXXXXX
# App Configuration
NEXT_PUBLIC_APP_NAME=My Starkon App
NEXT_PUBLIC_APP_URL=http://localhost:3000User Configuration
CLI configuration stored in ~/.starkon/config.json:
{
"defaultTemplate": "corporate",
"preferredPackageManager": "pnpm",
"locale": "en",
"skipGit": false,
"skipUpdateCheck": false,
"telemetryEnabled": true
}By default, Starkon detects your system locale and falls back to English when it cannot determine a supported language.
π§ͺ Testing
Running Tests
npm test # Run all tests
npm run test:watch # Watch mode
npm run test:coverage # Coverage reportWriting Tests
import { render, screen } from '@testing-library/react'
import { Button } from '@/components/core/button'
test('Button renders correctly', () => {
render(<Button>Click me</Button>)
expect(screen.getByRole('button')).toHaveTextContent('Click me')
})π¨ Customization
Theme System
Customize your brand colors in tailwind.config.mjs:
// tailwind.config.mjs
export default {
theme: {
extend: {
colors: {
primary: {
50: 'hsl(210 40% 98%)',
100: 'hsl(210 40% 96%)',
// ... your brand colors
},
},
animation: {
'fade-in': 'fadeIn 0.5s ease-in-out',
'slide-in': 'slideIn 0.3s ease-out',
// ... custom animations
},
},
},
}Component Variants
Using class-variance-authority for type-safe variants:
// Custom component with variants
import { cva } from 'class-variance-authority'
import { cn } from '@/lib/utils'
const buttonVariants = cva('base-styles', {
variants: {
variant: {
default: 'bg-primary text-white',
outline: 'border border-primary text-primary',
ghost: 'hover:bg-accent',
},
size: {
sm: 'px-3 py-1.5 text-sm',
lg: 'px-6 py-3 text-lg',
},
},
defaultVariants: {
variant: 'default',
size: 'default',
},
})
export function CustomButton({ variant, size, className, ...props }) {
return <button className={cn(buttonVariants({ variant, size }), className)} {...props} />
}Dark Mode
Theme switching with system preference detection:
import { useTheme } from '@/hooks/useTheme'
function ThemeToggle() {
const { theme, setTheme } = useTheme()
return <button onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}>Toggle Theme</button>
}π Available Scripts
Development
npm run dev # Next.js development server (Turbo mode)
npm run build # Production build
npm run start # Production server
npm run analyze # Bundle analyzer (set ANALYZE=true)Code Quality
npm run lint # ESLint check
npm run type-check # TypeScript validation
npm run prettier # Code formatting
npm run prettier:check # Check formatting onlyTesting
npm test # Jest test runner
npm run test:watch # Watch mode testing
npm run test:coverage # Generate coverage reportPackage Management (for contributors)
npm run pack:check # Verify tarball size before release
npm run commit # Commitizen conventional commits
npm run release # Release management with release-it
npm run prepare # Husky git hooks setupRelease Checklist
npm run lint
npm run test:smoke -- --template standard
npm run pack:checkπ Migration Guide
From Create Next App
# 1. Create Starkon project
npx starkon my-app --template basic
# 2. Copy your existing code
cp -r old-project/src/app/* new-project/src/app/
cp -r old-project/components/* new-project/src/components/
# 3. Update imports
# Change: import { Button } from '../components/Button'
# To: import { Button } from '@/components/core/button'
# 4. Install your additional dependencies
cd new-project
npm install your-packagesFrom Other Starters
- Extract your custom components to
src/components/ - Move API logic to
src/lib/services/ - Update styling to use Tailwind classes
- Add TypeScript types in
src/lib/types/ - Integrate with providers in
src/providers/
Migrating Authentication
If you have existing auth:
- Review Starkon's JWT flow in
src/lib/services/authApiService.ts - Replace mock service with your API endpoints
- Update token structure in
sessionTokenManager.ts - Modify
AuthProvider.tsxfor your auth logic
π€ Contributing
We welcome contributions to make Starkon even better!
Development Setup
# Clone repository
git clone https://github.com/zzafergok/starkon.git
cd starkon
# Install dependencies
npm install
# Start development
npm run dev
# Run tests
npm test
# Verify publish artifact
npm run pack:checkCreating New Templates
# 1. Add template metadata in cli/templates.js
# 2. Create templates/<name> and reuse shared or shared-full where appropriate
# 3. Test template generation
npx starkon test-app --template your-template
# 4. Update README.md with template documentation
# 5. Submit PRGuidelines
- Code Quality: Follow ESLint and Prettier rules
- Testing: Add tests for new features
- Documentation: Update README for new features
- TypeScript: Maintain full type safety
- Conventional Commits: Use
npm run commitfor commits
π Performance
Bundle Analysis
# Analyze the repository app build
npm run analyzeOptimization Features
- Automatic Code Splitting - Route-based splitting
- Image Optimization - Next.js Image component
- Font Optimization - Google Fonts optimization
- Static Generation - ISG and SSG support
- Edge Runtime - Faster cold starts
- React Server Components - Reduced client bundle
π οΈ Troubleshooting
Common Issues
Build Errors:
# Clear Next.js cache
rm -rf .next
# Clear npm cache
npm cache clean --force
# Reinstall dependencies
rm -rf node_modules package-lock.json
npm installTypeScript Errors:
# Check types without building
npm run type-check
# Clear TypeScript cache
rm -rf node_modules/.cacheAuthentication Issues:
# Check token in browser storage
# DevTools -> Application -> Session Storage -> tokens
# Clear all auth data
localStorage.clear()
sessionStorage.clear()i18n Not Working:
# Check language detection priority:
# 1. localStorage 'language' key
# 2. Cookie 'language' key
# 3. URL parameter ?lang=en
# 4. Browser navigator.language
# 5. Default: 'tr'
# Force language
localStorage.setItem('language', 'en')Component Not Found:
# Check import path uses @ alias
import { Button } from '@/components/core/button' # β
Correct
import { Button } from '../components/core/button' # β Wrong
# Verify tsconfig.json has paths configured:
# "@/*": ["./src/*"]Getting Help
- π Bug Reports: GitHub Issues
- π¬ Questions: Discussions
- π§ Contact: zafer@starkon.website
- π Documentation: CLAUDE.md (for development)
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
Core Technologies:
- Next.js - The React framework for production
- Radix UI - Low-level accessible UI primitives
- Tailwind CSS - Utility-first CSS framework
- React Query - Powerful data synchronization
- Zustand - Lightweight state management
Inspiration:
- shadcn/ui - Component design patterns
- T3 Stack - TypeScript-first development
- Vercel Templates - Deployment optimization
π Ready to Build Something Amazing?
Get Started β’ View Examples β’ Read Docs
Made with β€οΈ by Zafer GΓΆk
β If Starkon helped you ship faster, please give us a star on GitHub!
π Stats
- π¨ 46 UI Components ready to use
- π Complete Auth System with JWT tokens & 5 auth flows
- π 2 Languages supported (English, Turkish) with easy expansion
- π± 6 Templates (3 interactive + 3 manual selection)
- πͺ 7 Custom Hooks for common patterns
- π 5 Providers for app-wide state management
- β‘ Interactive CLI generator with arrow key navigation
- π < 30 seconds from CLI to running app
- π οΈ Production Ready - no additional setup needed
- π¦ React 19 & Next.js 16 - Latest versions