# โฒ / next-forge
**Production-grade Turborepo template for Next.js apps.**
<div>
<img src="https://img.shields.io/npm/dy/next-forge" alt="" />
<img src="https://img.shields.io/npm/v/next-forge" alt="" />
<img src="https://img.shields.io/github/license/vercel/next-forge" alt="" />
</div>
## Overview
[next-forge](https://github.com/vercel/next-forge) is a production-grade [Turborepo](https://turborepo.com) template for [Next.js](https://nextjs.org/) apps. It's designed to be a comprehensive starting point for building SaaS applications, providing a solid, opinionated foundation with minimal configuration required.
Built on a decade of experience building web applications, next-forge balances speed and quality to help you ship thoroughly-built products faster.
### Philosophy
next-forge is built around five core principles:
- **Fast** โ Quick to build, run, deploy, and iterate on
- **Cheap** โ Free to start with services that scale with you
- **Opinionated** โ Integrated tooling designed to work together
- **Modern** โ Latest stable features with healthy community support
- **Safe** โ End-to-end type safety and robust security posture
## Demo
Experience next-forge in action:
- [Web](https://demo.next-forge.com) โ Marketing website
- [App](https://app.demo.next-forge.com) โ Main application
- [Storybook](https://storybook.demo.next-forge.com) โ Component library
- [API](https://api.demo.next-forge.com/health) โ API health check
## Features
next-forge comes with batteries included:
### Apps
- **Web** โ Marketing site built with Tailwind CSS and TWBlocks
- **App** โ Main application with authentication and database integration
- **API** โ RESTful API with health checks and monitoring
- **Docs** โ Documentation site powered by Mintlify
- **Email** โ Email templates with React Email
- **Storybook** โ Component development environment
### Packages
- **Authentication** โ Powered by [Clerk](https://clerk.com)
- **Database** โ Type-safe ORM with migrations
- **Design System** โ Comprehensive component library with dark mode
- **Payments** โ Subscription management via [Stripe](https://stripe.com)
- **Email** โ Transactional emails via [Resend](https://resend.com)
- **Analytics** โ Web ([Google Analytics](https://developers.google.com/analytics)) and product ([Posthog](https://posthog.com))
- **Observability** โ Error tracking ([Sentry](https://sentry.io)), logging, and uptime monitoring ([BetterStack](https://betterstack.com))
- **Security** โ Application security ([Arcjet](https://arcjet.com)), rate limiting, and secure headers
- **CMS** โ Type-safe content management for blogs and documentation
- **SEO** โ Metadata management, sitemaps, and JSON-LD
- **AI** โ AI integration utilities
- **Webhooks** โ Inbound and outbound webhook handling
- **Collaboration** โ Real-time features with avatars and live cursors
- **Feature Flags** โ Feature flag management
- **Cron** โ Scheduled job management
- **Storage** โ File upload and management
- **Internationalization** โ Multi-language support
- **Notifications** โ In-app notification system
## Getting Started
### Prerequisites
- Node.js 20+
- [Bun](https://bun.sh) (or npm/yarn/pnpm)
- [Stripe CLI](https://docs.stripe.com/stripe-cli) for local webhook testing
### Installation
Create a new next-forge project:
```sh
npx next-forge@latest init
```
### Setup
1. Configure your environment variables
2. Set up required service accounts (Clerk, Stripe, Resend, etc.)
3. Run the development server
For detailed setup instructions, read the [documentation](https://www.next-forge.com/docs).
## Structure
next-forge uses a monorepo structure managed by Turborepo:
```
next-forge/
โโโ apps/ # Deployable applications
โ โโโ web/ # Marketing website (port 3001)
โ โโโ app/ # Main application (port 3000)
โ โโโ api/ # API server
โ โโโ docs/ # Documentation
โ โโโ email/ # Email templates
โ โโโ storybook/ # Component library
โโโ packages/ # Shared packages
โโโ design-system/
โโโ database/
โโโ auth/
โโโ ...
```
Each app is self-contained and independently deployable. Packages are shared across apps for consistency and maintainability.
## Documentation
Full documentation is available at [next-forge.com/docs](https://www.next-forge.com/docs), including:
- Detailed setup guides
- Package documentation
- Migration guides for swapping providers
- Deployment instructions
- Examples and recipes
## Contributing
We welcome contributions! See the [contributing guide](https://github.com/vercel/next-forge/blob/main/.github/CONTRIBUTING.md) for details.
## Contributors
<a href="https://github.com/vercel/next-forge/graphs/contributors">
<img src="https://contrib.rocks/image?repo=vercel/next-forge" />
</a>
Made with [contrib.rocks](https://contrib.rocks).
## License
MIT
Read the source README