A comprehensive MERN stack application for managing room rentals, tenants, payments, and repairs.
- 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
- Node.js
- Express.js
- MongoDB with Mongoose
- node-cron for scheduled tasks
- React 18
- React Router
- Tailwind CSS
- Vite
- react-calendar
- date-fns
- Node.js (v14 or higher)
- MongoDB (local or MongoDB Atlas)
- npm or yarn
- Navigate to the backend directory:
cd backend- Install dependencies:
npm install- Create a
.envfile in the backend directory:
PORT=5000
MONGODB_URI=mongodb://localhost:27017/rental_management
NODE_ENV=development- Start the backend server:
npm run devThe backend will run on http://localhost:5000
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm run devThe frontend will run on http://localhost:3000
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
GET /api/rooms- Get all roomsGET /api/rooms/:id- Get room by IDPOST /api/rooms- Create new roomPUT /api/rooms/:id- Update roomDELETE /api/rooms/:id- Delete room
GET /api/tenants- Get all tenantsGET /api/tenants/:id- Get tenant by IDPOST /api/tenants- Create new tenantPUT /api/tenants/:id- Update tenantDELETE /api/tenants/:id- Delete tenantPOST /api/tenants/:id/documents- Add document to tenant
GET /api/payments- Get all paymentsGET /api/payments/calendar- Get payments for calendar viewGET /api/payments/:id- Get payment by IDPOST /api/payments- Create new paymentPUT /api/payments/:id- Update paymentPATCH /api/payments/:id/paid- Mark payment as paidDELETE /api/payments/:id- Delete payment
GET /api/repairs- Get all repairsGET /api/repairs/room/:roomId- Get repairs by roomGET /api/repairs/:id- Get repair by IDPOST /api/repairs- Create new repairPUT /api/repairs/:id- Update repairDELETE /api/repairs/:id- Delete repair
GET /api/dashboard/stats- Get dashboard statistics
- Monthly payments are automatically generated on the 1st of each month
- Payments are created for all active tenants based on their room rent amount
- Daily cron job checks for payments due in the next 3 days
- Sends reminders (currently logged to console, can be extended to email/SMS)
- Daily cron job marks pending payments as LATE if past due date
- Add Rooms: Navigate to Rooms section and add rental rooms with details
- Add Tenants: Add tenants and assign them to rooms
- View Payments: Check the Payment Calendar to see all scheduled payments
- Mark Payments: Click on pending payments in the calendar to mark them as paid
- Track Repairs: Add repair entries with costs and descriptions
- Green: Paid payments
- Yellow: Payments due today
- Red: Overdue payments
- Gray: Pending payments
- Ensure MongoDB is running before starting the backend
- The application uses local MongoDB by default. Update
.envfor 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
MIT