A modern, full-featured Enterprise Resource Planning (ERP) system built with the latest web technologies. This open-source project provides a comprehensive solution for managing customers, products, invoices, and business operations.
- Next.js 14 - App Router with TypeScript for full-stack development
- Drizzle ORM - Type-safe database operations with PostgreSQL
- Better Auth - Modern authentication with email/password support
- shadcn/ui - Beautiful and accessible UI components
- React Hook Form - Performant forms with validation
- Zod - TypeScript-first schema validation
- ✅ Email/password authentication
- ✅ Secure session management
- ✅ Protected routes and layouts
- ✅ User onboarding flow
- ✅ Company registration and setup
- ✅ Multi-tenant architecture ready
- ✅ Company profile management
- ✅ Complete customer CRUD operations
- ✅ Customer search and filtering
- ✅ Address management
- ✅ Product catalog with categories
- ✅ SKU and inventory tracking
- ✅ Product search and filtering
- ✅ Invoice creation and management
- ✅ Multiple invoice statuses (paid, unpaid, overdue)
- ✅ Invoice line items with products
- ✅ PDF generation ready
- ✅ Real-time business metrics
- ✅ Revenue and customer analytics
- ✅ Recent activity tracking
- Node.js 18+ and npm
- PostgreSQL database
- Git
- Clone the repository
git clone https://github.com/ceedadev/next-erp.git
cd next-erp
npm install- Set up environment variables
cp .env.example .envAdd your PostgreSQL connection URL to the .env file:
DATABASE_URL="postgresql://username:password@localhost:5432/next_erp"- Initialize the database
npm run db:push- Start the development server
npm run dev- Open your browser Navigate to http://localhost:3000 to access the application.
- Visit the homepage → Click "Get Started"
- Create account with email/password → Sign up
- Complete company registration → Provide business details
- Access dashboard → Start managing your business
- Visit the homepage → Click "Sign In"
- Enter credentials → Access dashboard immediately
src/
├── app/ # Next.js app directory
│ ├── (auth)/ # Authentication routes
│ │ ├── signin/ # Sign in page
│ │ ├── signup/ # Sign up page
│ │ └── register-company/ # Company registration
│ ├── (dashboard)/ # Protected dashboard routes
│ │ ├── customers/ # Customer management
│ │ ├── products/ # Product management
│ │ ├── invoices/ # Invoice management
│ │ └── company/ # Company settings
│ └── _actions/ # Server actions
├── components/ # Reusable UI components
│ ├── forms/ # Form components
│ └── ui/ # shadcn/ui components
├── db/ # Database configuration
│ └── schema.ts # Drizzle schema definitions
└── lib/ # Utility functions
├── auth.ts # Better Auth configuration
├── auth-client.ts # Client-side auth functions
└── validations/ # Zod schemas
We welcome contributions from the community! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes: Follow the existing code style and patterns
- Test your changes: Ensure all features work as expected
- Commit your changes:
git commit -m 'Add some amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request: Describe your changes and their benefits
- Follow TypeScript best practices
- Use existing UI components from shadcn/ui
- Implement proper error handling
- Add proper validation with Zod schemas
- Write clean, self-documenting code
This project is open source and available under the MIT License. Feel free to fork, modify, and use it for your own purposes.
If you find this project helpful, please consider giving it a star on GitHub! Your support helps us continue improving the project.
Built with ❤️ by the open source community