Skip to content

Latest commit

Β 

History

61 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Building Management System (BMS) 🏒

A comprehensive full-stack web application for managing residential societies and apartment complexes. Built with modern technologies and best practices.

Backend Frontend Copyright


πŸ“‹ Table of Contents


🎯 Overview

The Building Management System (BMS) is a modern, scalable solution for managing residential societies. It provides role-based access control for Admins, Owners, and Tenants, enabling efficient management of buildings, payments, maintenance requests, events, visitors, and staff.

Key Highlights

  • πŸ” Secure Authentication with JWT
  • πŸ‘₯ Role-Based Access Control (Admin, Owner, Tenant)
  • πŸ’° Payment Management with invoice generation
  • πŸ”§ Maintenance Tracking with staff assignment
  • πŸ“… Event Management for society activities
  • πŸ‘· Staff Management with shift scheduling
  • πŸšͺ Visitor Management with approval workflow
  • πŸ“Š Analytics Dashboard with real-time insights

✨ Features

For Admins

  • Manage buildings, towers, and flats
  • Register and verify owners/tenants
  • Assign maintenance requests to staff
  • Create and manage events
  • Approve visitor entries
  • Generate payment reports

For Owners

  • View owned properties
  • Make payments (maintenance, amenities)
  • Create maintenance requests
  • View payment history
  • Manage tenant information

For Tenants

  • View lease details
  • Make payments
  • Create maintenance requests
  • Register visitors
  • View society events

πŸ› οΈ Tech Stack

Backend

  • Runtime: Node.js with TypeScript
  • Framework: Express.js
  • Database: MongoDB with Mongoose ODM
  • Authentication: JWT + bcrypt
  • Validation: Zod
  • API Documentation: Swagger/OpenAPI
  • Testing: Jest + Supertest
  • Email: Resend

Frontend

  • Framework: React 19
  • Build Tool: Vite
  • UI Library: Material-UI (MUI)
  • State Management: Zustand + React Query
  • Routing: React Router v7
  • Forms: React Hook Form + Zod
  • Styling: Emotion (CSS-in-JS)
  • Charts: Recharts
  • Testing: Vitest + React Testing Library

DevOps

  • Backend Hosting: Render
  • Frontend Hosting: Vercel
  • Database: MongoDB Atlas
  • Version Control: Git

πŸ“ Project Structure

BMS/
β”œβ”€β”€ backend/                 # Express.js backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/         # Database, Swagger config
β”‚   β”‚   β”œβ”€β”€ controllers/    # Route controllers
β”‚   β”‚   β”œβ”€β”€ middleware/     # Auth, validation, error handling
β”‚   β”‚   β”œβ”€β”€ models/         # Mongoose schemas
β”‚   β”‚   β”œβ”€β”€ routes/         # API routes
β”‚   β”‚   β”œβ”€β”€ services/       # Business logic
β”‚   β”‚   β”œβ”€β”€ utils/          # Helper functions
β”‚   β”‚   β”œβ”€β”€ validators/     # Zod schemas
β”‚   β”‚   β”œβ”€β”€ docs/           # OpenAPI specs
β”‚   β”‚   β”œβ”€β”€ __tests__/      # Unit & integration tests
β”‚   β”‚   └── server.ts       # Entry point
β”‚   β”œβ”€β”€ package.json
β”‚   └── tsconfig.json
β”‚
β”œβ”€β”€ frontend/                # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/     # Reusable components
β”‚   β”‚   β”œβ”€β”€ pages/          # Page components
β”‚   β”‚   β”œβ”€β”€ services/       # API services
β”‚   β”‚   β”œβ”€β”€ store/          # Zustand stores
β”‚   β”‚   β”œβ”€β”€ types/          # TypeScript types
β”‚   β”‚   β”œβ”€β”€ utils/          # Helper functions
β”‚   β”‚   β”œβ”€β”€ App.tsx         # Root component
β”‚   β”‚   └── main.tsx        # Entry point
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ vite.config.ts
β”‚   └── vercel.json         # Vercel deployment config
β”‚
└── README.md               # This file

πŸš€ Quick Start

Prerequisites

  • Node.js >= 18.x
  • npm >= 9.x
  • MongoDB (local or Atlas)
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/AnoopG7/BMS.git
    cd BMS
  2. Install backend dependencies

    cd backend
    npm install
  3. Install frontend dependencies

    cd ../frontend
    npm install
  4. Set up environment variables

    Backend (backend/.env):

    NODE_ENV=development
    PORT=3000
    MONGODB_URI=mongodb://localhost:27017/bms
    JWT_SECRET=your_jwt_secret_key_here
    JWT_EXPIRE=7d
    FRONTEND_URL=http://localhost:5173
    RESEND_API_KEY=your_resend_api_key

    Frontend (frontend/.env):

    VITE_API_BASE_URL=http://localhost:3000
  5. Seed the database (optional)

    cd backend
    npm run seed
  6. Start development servers

    Backend:

    cd backend
    npm run dev

    Frontend:

    cd frontend
    npm run dev
  7. Access the application


πŸ’» Development

Backend Development

cd backend

# Run in development mode
npm run dev

# Run tests
npm run test

# Run tests with coverage
npm run test:coverage

# Build for production
npm run build

# Start production server
npm start

Frontend Development

cd frontend

# Run in development mode
npm run dev

# Run tests
npm run test

# Build for production
npm run build

# Preview production build
npm run preview

Code Quality

# Lint backend
cd backend && npm run lint

# Lint frontend
cd frontend && npm run lint

# Type check
npm run type-check

πŸ“š Documentation


πŸ§ͺ Testing

Backend Tests

cd backend

# Run all tests
npm run test

# Run unit tests only
npm run test:unit

# Run integration tests only
npm run test:integration

# Watch mode
npm run test:watch

# Coverage report
npm run test:coverage

Test Coverage: 227 tests passing across unit and integration suites.

Frontend Tests

cd frontend

# Run tests
npm run test

# Run with UI
npm run test:ui

# Coverage report
npm run test:coverage

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Coding Standards

  • Follow TypeScript best practices
  • Write tests for new features
  • Maintain consistent code formatting
  • Update documentation as needed

πŸ“„ Copyright & License

Copyright Β© 2025 Anoop Gupta. All Rights Reserved.

This source code is the exclusive property of Anoop Gupta. Unauthorized copying, modification, distribution, or use of this software, via any medium, is strictly prohibited without explicit written permission from the author.


πŸ‘¨β€πŸ’» Author

Anoop Gupta


πŸ™ Acknowledgments

  • Built with modern web technologies
  • Inspired by real-world building management needs
  • Designed for scalability and maintainability

Happy Coding! πŸš€

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages