A comprehensive business management dashboard for hemp companies, built with Next.js 14 and modern web technologies. This application provides customer management, email marketing, analytics, and data visualization tools specifically designed for the hemp industry.
- Real-time Metrics: Customer count, loyalty rates, average age, and popular products
- Demographic Charts: Age groups, gender distribution, income levels, and education breakdowns
- Product Analytics: Most popular hemp products and customer preferences
- Interactive Visualizations: Built with Recharts for responsive data display
- Customer Profiles: Comprehensive customer data collection and management
- Demographic Tracking: Age, gender, income, education, and location data
- Product Preferences: Track customer interest in different hemp products
- Loyalty Program: Member status and engagement tracking
- Automated Email Generation: Welcome, follow-up, and promotional emails
- Email Templates: Personalized content based on customer preferences
- Status Tracking: Monitor email delivery and engagement
- Bulk Operations: Send emails to multiple customers efficiently
- Customer Insights: Detailed analytics on customer behavior and preferences
- Market Analysis: Understanding of hemp product popularity and trends
- Engagement Metrics: Track customer loyalty and retention rates
- Data Export: Generate reports for business analysis
- Next.js 14 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- Heroicons - Beautiful SVG icons
- Headless UI - Accessible UI components
- Recharts - Data visualization library
- Next.js API Routes - Serverless API endpoints
- Prisma - Type-safe database ORM
- SQLite - Lightweight database (development)
- Faker.js - Mock data generation
- Node.js - Runtime environment
- npm - Package management
- Git - Version control
- Node.js 18+
- npm or yarn
- Git
-
Clone the repository
git clone https://github.com/yourusername/hemp-dashboard.git cd hemp-dashboard -
Install dependencies
npm install # or yarn install -
Set up the database
npx prisma generate npx prisma db push
-
Start the development server
npm run dev # or yarn dev -
Open your browser Navigate to http://localhost:3000
hemp-dashboard/
├── app/ # Next.js App Router
│ ├── api/ # API routes
│ │ ├── customers/ # Customer management endpoints
│ │ ├── emails/ # Email system endpoints
│ │ ├── stats/ # Analytics endpoints
│ │ └── mock-data/ # Mock data generation
│ ├── components/ # Reusable UI components
│ │ ├── AddCustomerModal.tsx
│ │ ├── DashboardCard.tsx
│ │ ├── DemographicCharts.tsx
│ │ ├── EmailPreview.tsx
│ │ ├── EmailStatus.tsx
│ │ ├── GenerateMockDataModal.tsx
│ │ └── Navbar.tsx
│ ├── customers/ # Customer management page
│ ├── dashboard/ # Main dashboard
│ ├── emails/ # Email management page
│ ├── landing/ # Landing page
│ └── globals.css # Global styles
├── prisma/
│ └── schema.prisma # Database schema
├── public/
│ └── images/ # Static assets
├── tailwind.config.ts # Tailwind configuration
└── package.json # Dependencies and scripts
- Metrics Cards: Display key business metrics
- Demographic Charts: Visualize customer data
- Mock Data Generator: Create test data for development
- Customer List: View and manage all customers
- Add Customer Form: Comprehensive customer data collection
- Customer Details: View individual customer profiles
- Email List: View all sent emails
- Email Preview: Preview email content
- Status Tracking: Monitor email delivery status
- Bulk Operations: Send emails to multiple customers
model Customer {
id String @id @default(cuid())
firstName String
lastName String
zipCode String
phoneNumber String
email String @unique
age Int
gender String
preferredProducts String
primaryReason String
frequencyOfUse String
preferredShoppingMethod String
discoveryMethod String
incomeRange String
occupation String
educationLevel String
preferredCommunication String
interestsHobbies String
loyaltyProgramMember Boolean
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
emails Email[]
}model Email {
id String @id @default(cuid())
customerId String
customer Customer @relation(fields: [customerId], references: [id])
emailType String
subject String
body String
status String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}# Development
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
# Database
npx prisma generate # Generate Prisma client
npx prisma db push # Push schema to database
npx prisma studio # Open Prisma StudioGET /api/customers- Get all customersPOST /api/customers- Create new customer
GET /api/emails- Get all emails with paginationPOST /api/emails/generate- Generate emails for customersPOST /api/emails/send- Send emails
GET /api/stats- Get dashboard statistics and demographics
POST /api/mock-data- Generate mock customer and email data
const customerData = {
firstName: "John",
lastName: "Doe",
email: "[email protected]",
zipCode: "12345",
// ... other fields
};
const response = await fetch('/api/customers', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(customerData)
});const response = await fetch('/api/mock-data', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ count: 50 })
});- Push your code to GitHub
- Connect your repository to Vercel
- Deploy with zero configuration
- Netlify: Compatible with Next.js
- Railway: Easy deployment with database
- DigitalOcean: VPS deployment option
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Use Tailwind CSS for styling
- Write meaningful commit messages
- Add tests for new features
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js for the amazing framework
- Prisma for the excellent ORM
- Tailwind CSS for the utility-first CSS
- Recharts for beautiful charts
- Heroicons for the icon library
If you have any questions or need help:
- 📧 Email: [email protected]
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
Built with ❤️ for the hemp industry