No description
- TypeScript 89.6%
- JavaScript 4.4%
- PowerShell 3.3%
- CSS 1.5%
- Batchfile 0.8%
- Other 0.4%
- Remove committed Prisma client, import from @prisma/client - Fix false pending status on rooms page (compute from nextDue date) - Implement task completion on cleaning page with PATCH API - Persist settings via API with new User.settings JSON field - Fix framer-motion easing type error in sidebar Security: - Enforce password policy (uppercase, lowercase, number, special char) - Add magic byte validation for file uploads (PDF, DOCX, images) - Restrict email notification API to admin role - Add admin role checks on rooms/schedules create/update/delete - Fix open redirect in login form (validate returnTo) - Remove full cookie forwarding in process-document route - Make health/readyz endpoints public (bypass auth middleware) API & Reliability: - Add /api/readyz readiness probe endpoint - Improve /api/health with DB latency and uptime - Add OpenAI client timeouts (30s/60s) and retries (2x backoff) - Update OpenAI model from gpt-4 to gpt-4o - Add maxDuration to AI schedule route - Consolidate Prisma singleton in all environments Deployment: - Update PM2 ecosystem config for Windows (port 4040, cron job) - Add cron-check-schedules.js script for PM2 cron - Update deploy.ps1 for port 4040 - Add migration for User.settings field and indexes Cleanup: - Delete 18 stale .bak/.fix files - Add .bak, .fix, logs/ to .gitignore |
||
|---|---|---|
| .github/workflows | ||
| cloudflared | ||
| prisma | ||
| public | ||
| scripts | ||
| src | ||
| .dockerignore | ||
| .eslintignore | ||
| .gitignore | ||
| create-cleantrack-db.sql | ||
| create-neatplan-db.sql | ||
| docker-compose.yml | ||
| Dockerfile | ||
| ecosystem.config.js | ||
| env.example | ||
| eslint.config.mjs | ||
| next.config.js | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.mjs | ||
| PRODUCTION_DEPLOYMENT.md | ||
| QUICKSTART.md | ||
| README-Windows.md | ||
| README.md | ||
| SECURITY_AUDIT_REPORT.md | ||
| SECURITY_FIXES.md | ||
| start.sh | ||
| tailwind.config.js | ||
| tsconfig.json | ||
| vercel.json | ||
🧹 NeatPlan
A comprehensive cleaning management system with real-time tracking and mobile support
🚀 Live Demo • 📖 Documentation • 🐛 Report Bug • ✨ Request Feature
📋 Table of Contents
- ✨ Features
- 🎯 Demo
- 🚀 Quick Start
- 🔧 Installation
- 📱 Usage
- 🌐 Deployment
- 🛠️ Tech Stack
- 📊 Database Schema
- 🤝 Contributing
- 📄 License
✨ Features
🎛️ Admin Dashboard
- 📊 Real-time statistics and analytics
- 🏢 Room and equipment management
- 📅 Schedule assignment and monitoring
- 👥 User session tracking
- 📈 Live activity monitoring with 30-second updates
- 🔄 Equipment maintenance scheduling
🧹 Cleaner Interface
- 📱 Mobile-responsive personal dashboard
- 📋 Assigned room and equipment schedules
- ✅ Task completion tracking
- 🎯 Priority-based task organization
- 📍 Location-based room filtering
🔄 Real-Time Features
- 🟢 Live session tracking and monitoring
- 📡 Activity updates every 30 seconds
- 👁️ User presence indicators
- 🚪 Automatic logout detection
- 📊 Real-time dashboard statistics
🛡️ Security & Authentication
- 🔐 NextAuth.js integration
- 👤 Role-based access control (Admin/Cleaner)
- 🔑 Secure session management
- 🛡️ CSRF protection
- 🔒 Environment-based configuration
📱 Mobile Support
- 📲 Fully responsive design
- 👆 Touch-friendly interface
- 📱 Mobile-optimized navigation
- 🔄 Offline-capable PWA features
🎯 Demo
🚀 Quick Start
Prerequisites
- Node.js 18.0 or higher
- PostgreSQL 15.0 or higher
- npm or yarn
1-Minute Setup
# Clone the repository
git clone https://github.com/yourusername/neatplan.git
cd neatplan
# Install dependencies
npm install
# Setup environment
cp .env.example .env
# Edit .env with your database credentials
# Setup database
npx prisma generate
npx prisma db push
npx prisma db seed
# Start development server
npm run dev
🎉 That's it! Open http://localhost:3000 and start cleaning!
🔧 Installation
📦 Detailed Installation Guide
1. Clone Repository
git clone https://github.com/yourusername/neatplan.git
cd neatplan
2. Install Dependencies
npm install
# or
yarn install
3. Database Setup
# Create PostgreSQL database
createdb neatplan
# Generate Prisma client
npx prisma generate
# Push database schema
npx prisma db push
# Seed with sample data
npx prisma db seed
4. Environment Configuration
# Copy environment template
cp .env.example .env
Edit .env file:
DATABASE_URL="postgresql://username:password@localhost:5432/neatplan"
NEXTAUTH_SECRET="your-secret-key-here"
NEXTAUTH_URL="http://localhost:3000"
5. Build & Start
# Development
npm run dev
# Production
npm run build
npm start
📱 Usage
Default Login Credentials
| Role | Password | |
|---|---|---|
| Admin | admin@neatplan.com |
admin123 |
| Cleaner | cleaner@neatplan.com |
cleaner123 |
| User | user@neatplan.com |
user123 |
Admin Workflow
- Dashboard Overview - View real-time statistics
- Manage Rooms - Add, edit, and organize cleaning spaces
- Equipment Management - Track maintenance schedules
- Schedule Assignment - Assign cleaning tasks to rooms/equipment
- Monitor Activity - Track user sessions and task completion
Cleaner Workflow
- Personal Dashboard - View assigned tasks
- Task Management - Complete room and equipment schedules
- Progress Tracking - Monitor completion status
- Mobile Access - Use on any device
🌐 Deployment
🪟 Windows Self-Hosting
Perfect for small to medium businesses:
# Use provided Windows scripts
scripts\windows\install.bat
scripts\windows\start.bat
📖 Full Windows Guide: README-Windows.md
☁️ Cloud Deployment
Deploy to Vercel
- Connect your PostgreSQL database
- Set environment variables
🔐 Security & Ops
- Use
CORS_ALLOWED_ORIGINto restrict browser access. - Do not expose services on
0.0.0.0in production; terminate TLS and forward via a reverse proxy. - For Docker: store the DB password in
.envasPOSTGRES_PASSWORDand use it directly. Do not commit.env.
- Deploy!
Deploy with Docker
# Build image
docker build -t neatplan .
# Run container
docker run -p 3000:3000 --env-file .env neatplan
🛠️ Tech Stack
Frontend
- Framework: Next.js 15.3.2
- Language: TypeScript
- Styling: Tailwind CSS
- Components: Radix UI
- Animations: Framer Motion
- Icons: Lucide React
Backend
- Runtime: Node.js
- Framework: Next.js API Routes
- Database: PostgreSQL
- ORM: Prisma
- Authentication: NextAuth.js
- Session Management: Custom implementation
Development
- Package Manager: npm
- Linting: ESLint
- Formatting: Prettier
- Type Checking: TypeScript
- Database Management: Prisma Studio
📊 Database Schema
📋 View Database Structure
erDiagram
User ||--o{ UserSession : has
User ||--o{ Task : creates
Room ||--o{ RoomSchedule : has
Equipment ||--o{ EquipmentSchedule : has
Schedule ||--o{ RoomSchedule : assigned_to
Schedule ||--o{ EquipmentSchedule : assigned_to
Schedule ||--o{ ScheduleTask : contains
RoomSchedule ||--o{ RoomScheduleCompletionLog : completed
EquipmentSchedule ||--o{ EquipmentScheduleCompletionLog : completed
User {
string id PK
string email UK
string name
boolean isAdmin
enum role
datetime createdAt
datetime updatedAt
}
Room {
string id PK
string name UK
string description
string floor
enum type
datetime createdAt
datetime updatedAt
}
Equipment {
string id PK
string name UK
string description
string type
datetime createdAt
datetime updatedAt
}
🤝 Contributing
We welcome contributions! Here's how you can help:
🐛 Bug Reports
- Use the issue tracker
- Include steps to reproduce
- Provide system information
✨ Feature Requests
- Check existing issues first
- Describe the feature and use case
- Consider implementation approach
🔧 Pull Requests
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Add tests if applicable
- Commit:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - Open a Pull Request
📋 Development Setup
# Clone your fork
git clone https://github.com/yourusername/neatplan.git
# Install dependencies
npm install
# Setup development database
npm run db:setup
# Start development server
npm run dev
# Run tests
npm test
📈 Roadmap
- 📧 Email notifications for overdue tasks
- 📊 Advanced analytics and reporting
- 🔔 Push notifications
- 📱 Native mobile app
- 🌍 Multi-language support
- 🔗 API for third-party integrations
- 📦 Inventory management
- 🎨 Custom themes and branding
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Next.js - The React framework for production
- Prisma - Next-generation ORM
- Tailwind CSS - Utility-first CSS framework
- NextAuth.js - Authentication for Next.js
- Framer Motion - Animation library
Made with ❤️ for cleaning professionals