Skip to content

Calendar-based payment timeline with color coding: Green = Paid Yellow = Due Today Red = Overdue Gray = Pending, Automated monthly payment generation, Payment reminders (3 days before due date), Overdue payment detection, Document management for tenants, Expense tracking for repairs

Notifications You must be signed in to change notification settings

bugsnotallowed/RentalManagementApplication_MERN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Room Rental Management System

A comprehensive MERN stack application for managing room rentals, tenants, payments, and repairs.

Features

  • Dashboard: Overview of rooms, tenants, payments, and repairs
  • Room Management: Add, edit, and manage rental rooms
  • Tenant Management: Track tenant information, documents, and deposits
  • Payment Calendar: Visual timeline of rent payments with status indicators
  • Repairs & Expenses: Track maintenance costs and repairs
  • Automated Payments: Auto-generate monthly payment entries
  • Reminders: Automated cron jobs for payment reminders

Tech Stack

Backend

  • Node.js
  • Express.js
  • MongoDB with Mongoose
  • node-cron for scheduled tasks

Frontend

  • React 18
  • React Router
  • Tailwind CSS
  • Vite
  • react-calendar
  • date-fns

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB (local or MongoDB Atlas)
  • npm or yarn

Installation

Backend Setup

  1. Navigate to the backend directory:
cd backend
  1. Install dependencies:
npm install
  1. Create a .env file in the backend directory:
PORT=5000
MONGODB_URI=mongodb://localhost:27017/rental_management
NODE_ENV=development
  1. Start the backend server:
npm run dev

The backend will run on http://localhost:5000

Frontend Setup

  1. Navigate to the frontend directory:
cd frontend
  1. Install dependencies:
npm install
  1. Start the development server:
npm run dev

The frontend will run on http://localhost:3000

Project Structure

RentingApp/
├── backend/
│   ├── controllers/
│   │   ├── dashboardController.js
│   │   ├── paymentController.js
│   │   ├── repairController.js
│   │   ├── roomController.js
│   │   └── tenantController.js
│   ├── models/
│   │   ├── Payment.js
│   │   ├── Repair.js
│   │   ├── Room.js
│   │   └── Tenant.js
│   ├── routes/
│   │   ├── dashboard.js
│   │   ├── payments.js
│   │   ├── repairs.js
│   │   ├── rooms.js
│   │   └── tenants.js
│   ├── utils/
│   │   └── paymentScheduler.js
│   ├── server.js
│   └── package.json
├── frontend/
│   ├── src/
│   │   ├── components/
│   │   │   ├── Dashboard.jsx
│   │   │   ├── PaymentCalendar.jsx
│   │   │   ├── RepairsExpenses.jsx
│   │   │   ├── RoomManagement.jsx
│   │   │   └── TenantManagement.jsx
│   │   ├── services/
│   │   │   └── api.js
│   │   ├── App.jsx
│   │   ├── main.jsx
│   │   └── index.css
│   ├── index.html
│   └── package.json
└── README.md

API Endpoints

Rooms

  • GET /api/rooms - Get all rooms
  • GET /api/rooms/:id - Get room by ID
  • POST /api/rooms - Create new room
  • PUT /api/rooms/:id - Update room
  • DELETE /api/rooms/:id - Delete room

Tenants

  • GET /api/tenants - Get all tenants
  • GET /api/tenants/:id - Get tenant by ID
  • POST /api/tenants - Create new tenant
  • PUT /api/tenants/:id - Update tenant
  • DELETE /api/tenants/:id - Delete tenant
  • POST /api/tenants/:id/documents - Add document to tenant

Payments

  • GET /api/payments - Get all payments
  • GET /api/payments/calendar - Get payments for calendar view
  • GET /api/payments/:id - Get payment by ID
  • POST /api/payments - Create new payment
  • PUT /api/payments/:id - Update payment
  • PATCH /api/payments/:id/paid - Mark payment as paid
  • DELETE /api/payments/:id - Delete payment

Repairs

  • GET /api/repairs - Get all repairs
  • GET /api/repairs/room/:roomId - Get repairs by room
  • GET /api/repairs/:id - Get repair by ID
  • POST /api/repairs - Create new repair
  • PUT /api/repairs/:id - Update repair
  • DELETE /api/repairs/:id - Delete repair

Dashboard

  • GET /api/dashboard/stats - Get dashboard statistics

Automated Features

Payment Generation

  • Monthly payments are automatically generated on the 1st of each month
  • Payments are created for all active tenants based on their room rent amount

Payment Reminders

  • Daily cron job checks for payments due in the next 3 days
  • Sends reminders (currently logged to console, can be extended to email/SMS)

Overdue Payments

  • Daily cron job marks pending payments as LATE if past due date

Usage

  1. Add Rooms: Navigate to Rooms section and add rental rooms with details
  2. Add Tenants: Add tenants and assign them to rooms
  3. View Payments: Check the Payment Calendar to see all scheduled payments
  4. Mark Payments: Click on pending payments in the calendar to mark them as paid
  5. Track Repairs: Add repair entries with costs and descriptions

Calendar Color Coding

  • Green: Paid payments
  • Yellow: Payments due today
  • Red: Overdue payments
  • Gray: Pending payments

Notes

  • Ensure MongoDB is running before starting the backend
  • The application uses local MongoDB by default. Update .env for MongoDB Atlas connection
  • Document uploads currently accept URLs. For file uploads, integrate multer properly
  • Email/SMS reminders are logged to console. Integrate nodemailer or similar for actual notifications

License

MIT

About

Calendar-based payment timeline with color coding: Green = Paid Yellow = Due Today Red = Overdue Gray = Pending, Automated monthly payment generation, Payment reminders (3 days before due date), Overdue payment detection, Document management for tenants, Expense tracking for repairs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages