Repository files navigation # ZenBusiness Suite
A complete, production-ready, multi-tenant SaaS Business Management System built with the MERN stack.
## 🚀 Features
### Core Modules
- **Authentication**: JWT with refresh tokens, email verification, password reset
- **Multi-Tenancy**: Complete data isolation with tenant-based access control
- **Inventory Management**: Track products, stock levels, and suppliers
- **Point of Sale (POS)**: Touch-friendly interface for sales transactions
- **Accounting**: Double-entry bookkeeping system
- **Staff Management**: Employee records, roles, and permissions
- **Reporting**: Comprehensive analytics and insights
- **Subscriptions**: Stripe integration for billing
- **Notifications**: Real-time alerts and updates
- **Audit Logs**: Complete activity tracking
### Technical Features
- Redis caching for performance
- BullMQ for background job processing
- Soft delete functionality
- Event-driven architecture
- Docker containerization
- Rate limiting and security hardening
- Input validation and sanitization
### UI/UX Features
- Dark/Light mode with seamless transitions
- Fully responsive design (mobile, tablet, desktop)
- Smooth animations with Framer Motion
- Interactive charts with Recharts
- Skeleton loaders for better UX
- Touch-optimized POS interface
## 📁 Project Structure
```
zenbusiness-suite/
├── backend/
│ ├── config/
│ ├── controllers/
│ ├── models/
│ ├── services/
│ ├── middlewares/
│ ├── utils/
│ ├── jobs/
│ ├── routes/
│ └── server.js
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── hooks/
│ │ ├── context/
│ │ ├── services/
│ │ ├── utils/
│ │ └── App.jsx
│ └── package.json
├── docker-compose.yml
└── README.md
```
## 🛠️ Tech Stack
### Backend
- Node.js & Express.js
- MongoDB with Mongoose
- Redis for caching
- BullMQ for job queues
- JWT for authentication
- Stripe for payments
- Nodemailer for emails
### Frontend
- React.js 18+
- Tailwind CSS
- Framer Motion
- Recharts
- Headless UI / Radix UI
- Axios
- React Router
### DevOps
- Docker & Docker Compose
- PM2 for process management
## 🚦 Getting Started
### Prerequisites
- Node.js 18+ and npm
- MongoDB 6+
- Redis 7+
- Docker (optional)
### Environment Variables
#### Backend (.env)
```env
# Server
NODE_ENV=development
PORT=5000
API_URL=http://localhost:5000
# Database
MONGODB_URI=mongodb://localhost:27017/zenbusiness
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
# JWT
JWT_SECRET=your-super-secret-jwt-key-change-in-production
JWT_REFRESH_SECRET=your-super-secret-refresh-key-change-in-production
JWT_EXPIRE=15m
JWT_REFRESH_EXPIRE=7d
# Email
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASSWORD=your-app-password
EMAIL_FROM=noreply@zenbusiness.com
# Stripe
STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret
# Frontend URL
FRONTEND_URL=http://localhost:3000
# Rate Limiting
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100
```
#### Frontend (.env)
```env
VITE_API_URL=http://localhost:5000/api
VITE_STRIPE_PUBLIC_KEY=pk_test_your_stripe_public_key
```
### Installation
#### Using Docker (Recommended)
```bash
# Clone the repository
git clone
cd zenbusiness-suite
# Start all services
docker-compose up -d
# The application will be available at:
# Frontend: http://localhost:3000
# Backend: http://localhost:5000
```
#### Manual Installation
**Backend:**
```bash
cd backend
npm install
npm run dev
```
**Frontend:**
```bash
cd frontend
npm install
npm run dev
```
### Database Setup
The application will automatically create indexes and initial data on first run. For manual setup:
```bash
cd backend
npm run seed # Seeds initial data (super admin, sample tenant)
```
## 📖 API Documentation
### Authentication Endpoints
- `POST /api/auth/register` - Register new tenant
- `POST /api/auth/login` - Login
- `POST /api/auth/refresh` - Refresh access token
- `POST /api/auth/verify-email` - Verify email
- `POST /api/auth/forgot-password` - Request password reset
- `POST /api/auth/reset-password` - Reset password
- `POST /api/auth/logout` - Logout
### Inventory Endpoints
- `GET /api/inventory/products` - List products
- `POST /api/inventory/products` - Create product
- `PUT /api/inventory/products/:id` - Update product
- `DELETE /api/inventory/products/:id` - Soft delete product
- `GET /api/inventory/stock-alerts` - Low stock alerts
### Default Login Credentials
After running the seed script, you can use these accounts:
| Role | Email | Password |
|------|-------|----------|
| **Admin** | `admin@mogadishu.com` | `Admin@123` |
| **Manager** | `manager@mogadishu.com` | `Manager@123` |
| **Cashier** | `cashier@mogadishu.com` | `Cashier@123` |
### POS Endpoints
- `POST /api/pos/transactions` - Create transaction
- `GET /api/pos/transactions` - List transactions
- `GET /api/pos/transactions/:id` - Get transaction details
### Accounting Endpoints
- `POST /api/accounting/entries` - Create journal entry
- `GET /api/accounting/entries` - List entries
- `GET /api/accounting/trial-balance` - Get trial balance
- `GET /api/accounting/balance-sheet` - Get balance sheet
- `GET /api/accounting/income-statement` - Get income statement
### Staff Management Endpoints
- `GET /api/staff/employees` - List employees
- `POST /api/staff/employees` - Create employee
- `PUT /api/staff/employees/:id` - Update employee
- `DELETE /api/staff/employees/:id` - Soft delete employee
### Reporting Endpoints
- `GET /api/reports/sales` - Sales reports
- `GET /api/reports/inventory` - Inventory reports
- `GET /api/reports/financial` - Financial reports
- `GET /api/reports/dashboard` - Dashboard metrics
### Subscription Endpoints
- `GET /api/subscriptions/plans` - List plans
- `POST /api/subscriptions/subscribe` - Subscribe to plan
- `POST /api/subscriptions/cancel` - Cancel subscription
- `GET /api/subscriptions/current` - Get current subscription
## 🎨 Design System
### Colors
The application uses a carefully crafted color palette that works in both light and dark modes:
- **Primary**: Indigo (600-500)
- **Success**: Emerald (600-500)
- **Warning**: Amber (600-500)
- **Error**: Red (600-500)
- **Neutral**: Slate (50-950)
### Typography
- **Font Family**: Inter (Google Fonts)
- **Headings**: 600-700 weight
- **Body**: 400-500 weight
### Spacing
Follows Tailwind's spacing scale (4px base unit)
## 🔒 Security Features
- Helmet.js for HTTP headers
- CORS configuration
- Rate limiting
- Input validation with Joi
- SQL injection prevention
- XSS protection
- CSRF tokens
- Password hashing with bcrypt
- JWT token rotation
- Secure cookie handling
## 🧪 Testing
```bash
# Backend tests
cd backend
npm test
# Frontend tests
cd frontend
npm test
```
## 📦 Deployment
### Production Build
**Frontend:**
```bash
cd frontend
npm run build
```
**Backend:**
```bash
cd backend
npm run build # If using TypeScript
```
### Deployment Checklist
- [ ] Update environment variables for production
- [ ] Enable HTTPS
- [ ] Configure MongoDB Atlas or production database
- [ ] Set up Redis instance
- [ ] Configure Stripe webhooks
- [ ] Set up email service
- [ ] Configure CDN for static assets
- [ ] Enable monitoring and logging
- [ ] Set up backup strategy
- [ ] Configure auto-scaling
### Recommended Platforms
- **Frontend**: Vercel, Netlify
- **Backend**: Railway, Render, DigitalOcean
- **Database**: MongoDB Atlas
- **Redis**: Redis Cloud, Upstash
- **Email**: SendGrid, AWS SES
## 🤝 Contributing
1. Fork the repository
2. Create a feature branch
3. Commit your changes
4. Push to the branch
5. Open a Pull Request
## 📄 License
MIT License - see LICENSE file for details
## 🆘 Support
For issues and questions:
- GitHub Issues: [repository-url]/issues
- Email: support@zenbusiness.com
- Documentation: [docs-url]
## 🙏 Acknowledgments
Built with modern best practices and inspired by:
- Notion
- Linear
- Vercel Dashboard
- Stripe Dashboard
---
**ZenBusiness Suite** - Empowering businesses with elegant management tools.
# tijaabo
# tijaabo
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
You can’t perform that action at this time.