Skip to content

Latest commit

Β 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Modern Web Application Starter Template

πŸš€ Production-ready Next.js 14+ starter with authentication, database, email, error tracking, and comprehensive testing.

Build your next SaaS, dashboard, or web application in minutes, not weeks.

TypeScript Next.js Tailwind CSS

Application Screenshot

Live Demo β€’ Documentation β€’ Report Bug


✨ What's Included

This template comes with everything you need to build a modern web application:

πŸ” Authentication

  • Stack Auth integration with Google & GitHub OAuth
  • Protected routes with middleware
  • User profile management
  • Session handling

πŸ—„οΈ Database

  • PocketBase integration with type-safe queries
  • Real-time subscriptions
  • File upload/storage
  • Example schema included

πŸ“§ Email Service

  • Resend integration
  • React Email templates
  • Welcome email included

πŸ› Error Tracking

  • Sentry integration (client & server)
  • Error boundaries
  • Session replay
  • Performance monitoring

πŸ§ͺ Testing & CI/CD

  • Jest for unit tests
  • Playwright for E2E tests
  • GitHub Actions CI/CD pipeline
  • Pre-commit hooks with Husky

🎨 UI/UX

  • 40+ shadcn/ui components
  • Dark/light mode toggle
  • Fully responsive design
  • Loading states & animations

⚑ Developer Experience

  • TypeScript strict mode
  • ESLint + Prettier configured
  • Hot reload
  • Conventional commits
  • VS Code settings included

πŸš€ Quick Start

Get up and running in 5 minutes:

1. Clone & Install

# Fork the repository on GitHub first, then clone your fork
git clone https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git my-app
cd my-app
pnpm install

2. Setup Environment Variables

# Copy the example environment file
cp .env.local.example .env.local

Edit .env.local with your credentials (all services have free tiers):

# Stack Auth - Get from https://app.stack-auth.com/
NEXT_PUBLIC_STACK_PROJECT_ID=your_project_id
NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY=your_publishable_key
STACK_SECRET_SERVER_KEY=your_secret_key

# PocketBase - Download from https://pocketbase.io/docs/
NEXT_PUBLIC_POCKETBASE_URL=http://localhost:8090

# Sentry - Get from https://sentry.io/
NEXT_PUBLIC_SENTRY_DSN=your_sentry_dsn

# Resend - Get from https://resend.com/
RESEND_API_KEY=your_resend_api_key

Need help? See the detailed setup guide with step-by-step instructions for each service.

3. Setup PocketBase (Local Development)

# Download PocketBase from https://pocketbase.io/docs/
# Then run it:
./pocketbase serve

# Access admin UI at http://localhost:8090/_/
# Import schema from POCKETBASE_SETUP.md

4. Start Development Server

pnpm dev

Visit http://localhost:3000 - you should see the homepage!

5. Verify Everything Works

# Run type checking
pnpm type-check

# Run linting
pnpm lint

# Run tests
pnpm test

# Build for production
pnpm build

All green? You're ready to start building!


πŸŽ“ Next Steps

Now that you're set up, here's what to do next:

  1. Explore the App

    • Try logging in with Google/GitHub OAuth
    • Check out the dashboard at /dashboard
    • View your profile at /dashboard/profile
    • Toggle dark/light mode
  2. Customize Your App

  3. Add Your First Feature

    • Create a new page in app/(dashboard)/your-page/
    • Add a new component in components/
    • Update the sidebar navigation
  4. Learn the Stack

  5. Deploy to Production


πŸ“ Project Structure

my-app/
β”œβ”€β”€ app/                    # Next.js App Router
β”‚   β”œβ”€β”€ (auth)/            # Auth pages (login, register)
β”‚   β”œβ”€β”€ (dashboard)/       # Protected dashboard pages
β”‚   β”œβ”€β”€ api/               # API routes
β”‚   └── ...                # Root pages & layouts
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ ui/                # shadcn/ui components (40+)
β”‚   β”œβ”€β”€ layout/            # Layout components (Sidebar, Topbar)
β”‚   └── ...               # Custom components
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ auth/              # Stack Auth setup
β”‚   β”œβ”€β”€ db/                # PocketBase client & types
β”‚   β”œβ”€β”€ email/             # Resend & email templates
β”‚   └── utils.ts           # Shared utilities
β”œβ”€β”€ hooks/                 # Custom React hooks
β”œβ”€β”€ __tests__/             # Unit tests (Jest)
β”œβ”€β”€ tests/e2e/             # E2E tests (Playwright)
└── ...                    # Config files

πŸ’» Available Scripts

# Development
pnpm dev          # Start dev server
pnpm build        # Build for production
pnpm start        # Start production server

# Code Quality
pnpm lint         # Run ESLint
pnpm lint:fix     # Fix ESLint issues
pnpm format       # Format with Prettier
pnpm type-check   # TypeScript type checking

# Testing
pnpm test              # Run unit tests
pnpm test:watch        # Run tests in watch mode
pnpm test:coverage     # Generate coverage report
pnpm test:e2e          # Run E2E tests
pnpm test:e2e:ui       # Run E2E with Playwright UI

🎨 Tech Stack

Frontend

Backend & Services

Development Tools

Testing

Deployment

  • Hosting: Vercel (recommended)
  • Compatible with: Netlify, AWS Amplify, Railway, self-hosted

πŸ“š Documentation


🎯 Use Cases

Perfect for building:

  • βœ… SaaS applications
  • βœ… Admin dashboards
  • βœ… Internal tools
  • βœ… MVPs and prototypes
  • βœ… Client projects
  • βœ… Side projects

πŸš€ What Makes This Different?

🎁 Truly Production-Ready

Not just a boilerplate - includes authentication, database, email, error tracking, testing, and CI/CD out of the box.

πŸ“– Comprehensive Documentation

Over 5 detailed guides covering every aspect from setup to deployment.

πŸ”’ Security First

  • XSS protection
  • CSRF tokens
  • Security headers configured
  • Environment variable validation
  • No exposed secrets

⚑ Performance Optimized

  • SWC minification
  • Image optimization
  • Code splitting
  • Tree shaking
  • Lazy loading

πŸ§ͺ Testing Built-In

  • 9 unit tests included
  • E2E test examples
  • GitHub Actions CI/CD
  • Pre-commit hooks

🎨 Best Practices

  • TypeScript strict mode
  • Conventional commits
  • Code quality tools
  • Consistent structure
  • Clean, maintainable code

πŸ› οΈ Customization

This template is designed to be easily customizable:

Change Branding

  • Update app name in app/layout.tsx
  • Modify colors in app/globals.css
  • Replace logo in public/ and components/layout/sidebar.tsx

Add New Pages

  • Create route in app/(dashboard)/your-page/
  • Add to sidebar in components/layout/sidebar.tsx

Modify Database

  • Update schema in PocketBase admin
  • Add types in lib/db/types.ts
  • Create helper functions in lib/db/

Add Components

npx shadcn@latest add [component-name]

More details: See START.md


πŸ› Known Issues & Solutions

Build Warnings

  • OpenTelemetry warnings from Sentry are expected and don't affect functionality

Environment Variables

  • Client-side variables must be prefixed with NEXT_PUBLIC_
  • Restart dev server after changing .env.local

More troubleshooting: See START.md


🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit using conventional commits (feat:, fix:, docs:, etc.)
  4. Push to your branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Commit Convention

This project follows Conventional Commits:

feat: add new feature
fix: resolve bug
docs: update documentation
style: code formatting
refactor: code refactoring
test: add/update tests
chore: maintenance tasks

πŸ“ˆ Roadmap

  • Add tRPC integration example
  • Add Stripe payment integration
  • Add more email templates
  • Add mobile responsive improvements
  • Add Docker setup
  • Add Prisma as database alternative
  • Add Supabase as alternative backend
  • Add more authentication providers
  • Add i18n (internationalization) support
  • Add PWA support

Have a suggestion? Open an issue


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

You're free to use this template for personal or commercial projects.


πŸ™ Acknowledgments

Built with amazing open-source technologies:


πŸ’¬ Support


⭐ Show Your Support

If this template helped you build something awesome, please ⭐ star this repository!

It helps others discover the project and motivates continued development.


Built with ❀️ using Next.js and TypeScript

Get Started β€’ View Demo β€’ Report Bug

About

I use this base template to build ai apps

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages