No description
  • TypeScript 89.6%
  • JavaScript 4.4%
  • PowerShell 3.3%
  • CSS 1.5%
  • Batchfile 0.8%
  • Other 0.4%
Find a file
andrei-iacobb 68af131783 Security hardening, issue fixes, and Windows deployment setup
- 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
2026-03-29 20:34:09 +01:00
.github/workflows ci: add ghcr build and push workflow for neatplan 2026-02-17 17:16:17 +00:00
cloudflared demo is live 2025-08-27 21:34:07 +01:00
prisma Security hardening, issue fixes, and Windows deployment setup 2026-03-29 20:34:09 +01:00
public end of day 2025-08-14 22:46:40 +01:00
scripts Security hardening, issue fixes, and Windows deployment setup 2026-03-29 20:34:09 +01:00
src Security hardening, issue fixes, and Windows deployment setup 2026-03-29 20:34:09 +01:00
.dockerignore Security audit fixes and infection prevention features 2026-03-13 20:04:46 +00:00
.eslintignore what are we doing again? 2025-06-21 12:49:30 +01:00
.gitignore Security hardening, issue fixes, and Windows deployment setup 2026-03-29 20:34:09 +01:00
create-cleantrack-db.sql end of day 2025-08-14 22:46:40 +01:00
create-neatplan-db.sql end of day 2025-08-14 22:46:40 +01:00
docker-compose.yml Security audit fixes and infection prevention features 2026-03-13 20:04:46 +00:00
Dockerfile fix(runtime): build and run next in production mode 2026-02-17 17:38:03 +00:00
ecosystem.config.js Security hardening, issue fixes, and Windows deployment setup 2026-03-29 20:34:09 +01:00
env.example Production configuration for neatplan.app deployment 2025-11-19 15:02:54 +00:00
eslint.config.mjs what are we doing again? 2025-06-21 12:49:30 +01:00
next.config.js Security audit fixes and infection prevention features 2026-03-13 20:04:46 +00:00
package-lock.json Security audit fixes - 18 critical, high, and medium severity issues resolved 2025-11-17 14:55:52 +00:00
package.json Security audit fixes and infection prevention features 2026-03-13 20:04:46 +00:00
postcss.config.mjs windows p1234567890 2025-06-25 11:42:29 +01:00
PRODUCTION_DEPLOYMENT.md Production configuration for neatplan.app deployment 2025-11-19 15:02:54 +00:00
QUICKSTART.md Add quick start reference guide for production deployment 2025-11-19 15:03:42 +00:00
README-Windows.md times up brb 2025-08-14 13:27:00 +01:00
README.md end of day 2025-08-14 22:46:40 +01:00
SECURITY_AUDIT_REPORT.md Security audit fixes - 18 critical, high, and medium severity issues resolved 2025-11-17 14:55:52 +00:00
SECURITY_FIXES.md Security audit fixes - 18 critical, high, and medium severity issues resolved 2025-11-17 14:55:52 +00:00
start.sh fix(runtime): build and run next in production mode 2026-02-17 17:38:03 +00:00
tailwind.config.js what 2025-06-24 15:56:25 +01:00
tsconfig.json windows p1 2025-06-18 16:12:48 +01:00
vercel.json i think we are almost done with alot idek i lost track 2025-05-23 16:18:00 +01:00

🧹 NeatPlan

NeatPlan Logo

A comprehensive cleaning management system with real-time tracking and mobile support

Next.js TypeScript Prisma PostgreSQL Tailwind CSS

🚀 Live Demo📖 Documentation🐛 Report Bug Request Feature


📋 Table of Contents


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

Admin Dashboard

Admin Dashboard

Cleaner Interface

Cleaner Interface

Mobile View

Mobile View


🚀 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 Email Password
Admin admin@neatplan.com admin123
Cleaner cleaner@neatplan.com cleaner123
User user@neatplan.com user123

Admin Workflow

  1. Dashboard Overview - View real-time statistics
  2. Manage Rooms - Add, edit, and organize cleaning spaces
  3. Equipment Management - Track maintenance schedules
  4. Schedule Assignment - Assign cleaning tasks to rooms/equipment
  5. Monitor Activity - Track user sessions and task completion

Cleaner Workflow

  1. Personal Dashboard - View assigned tasks
  2. Task Management - Complete room and equipment schedules
  3. Progress Tracking - Monitor completion status
  4. 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

Deploy with Vercel

  1. Connect your PostgreSQL database
  2. Set environment variables

🔐 Security & Ops

  • Use CORS_ALLOWED_ORIGIN to restrict browser access.
  • Do not expose services on 0.0.0.0 in production; terminate TLS and forward via a reverse proxy.
  • For Docker: store the DB password in .env as POSTGRES_PASSWORD and use it directly. Do not commit .env.
  1. Deploy!
Deploy to Railway

Deploy on Railway

  1. One-click deployment
  2. Automatic PostgreSQL provisioning
  3. Environment setup included
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

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Add tests if applicable
  5. Commit: git commit -m 'Add amazing feature'
  6. Push: git push origin feature/amazing-feature
  7. 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


Made with ❤️ for cleaning professionals

Star this repo🐛 Report issues💬 Discussions