Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏗️ BuildCost — Construction Cost Estimator

A full-stack MERN application for estimating residential construction costs in India. Enter plot details, choose materials, and get instant cost breakdowns with professional Bill of Quantities (BOQ) and downloadable reports.

✨ Features

  • Two Estimation Modes
    • Quick Approximation: Thumb-rule based estimation using per-sqft multipliers
    • Detailed Precision: Mix-design based calculation with per-category material selection
  • Material Rate Database: 56+ rate entries across 11 categories × 3 quality tiers
  • Professional BOQ: Sortable, item-wise Bill of Quantities table
  • Cost Breakdown Charts: Interactive pie and bar charts (Recharts)
  • PDF & Excel Export: Professionally formatted downloadable reports
  • JWT Authentication: Secure signup/login with bcrypt password hashing
  • Project History: Save, view, and manage past estimates
  • Responsive Design: Mobile-friendly with Tailwind CSS

🛠️ Tech Stack

Layer Technology
Frontend React (Vite), React Router, Axios, Tailwind CSS v4, Recharts, Lucide Icons
Backend Node.js, Express.js, REST API
Database MongoDB (Mongoose ODM)
Auth JWT + bcrypt
Export PDFKit (PDF), ExcelJS (Excel)

📁 Project Structure

construction-estimator/
├── backend/
│   ├── server.js              # Express entry point
│   ├── config/db.js           # MongoDB connection
│   ├── models/                # Mongoose schemas (User, Project, Rates)
│   ├── routes/                # API route definitions
│   ├── controllers/           # Route handlers
│   ├── services/
│   │   └── estimationEngine.js # Core calculation logic (heavily commented)
│   ├── middleware/            # JWT auth middleware
│   ├── data/defaultRates.json # Seed data for material rates
│   └── seeds/seedRates.js     # Database seeder script
└── frontend/
    └── src/
        ├── pages/             # 10 page components
        ├── components/        # 5 reusable components
        ├── context/           # Auth context provider
        ├── api/               # Axios client config
        └── index.css          # Tailwind design system

🚀 Getting Started

Prerequisites

  • Node.js 18+
  • MongoDB (local or Atlas)

1. Clone & Install

# Backend
cd construction-estimator/backend
cp .env.example .env    # Edit with your MongoDB URI and JWT secret
npm install

# Frontend
cd ../frontend
npm install

2. Configure Environment

Edit backend/.env:

PORT=5000
MONGO_URI=mongodb://localhost:27017/construction-estimator
JWT_SECRET=your_strong_secret_key
JWT_EXPIRES_IN=7d

3. Seed the Database

cd backend
npm run seed

4. Run Development Servers

# Terminal 1 — Backend
cd backend
npm run dev

# Terminal 2 — Frontend
cd frontend
npm run dev

Frontend: http://localhost:5173
Backend API: http://localhost:5000

📡 API Endpoints

Method Endpoint Auth Description
POST /api/auth/signup Register new user
POST /api/auth/login Authenticate user
GET /api/auth/me Get current user
POST /api/estimate/approx Quick thumb-rule estimate
POST /api/estimate/precision Detailed precision estimate
GET /api/estimate/rates Get material rates
POST /api/projects Save project
GET /api/projects List user's projects
GET /api/projects/:id Get single project
DELETE /api/projects/:id Delete project
GET /api/reports/:id/pdf Download PDF report
GET /api/reports/:id/excel Download Excel report

📊 Estimation Engine

The calculation engine (services/estimationEngine.js) implements two levels:

Level 1 — Approximation (Thumb Rules)

Per sqft of built-up area:

  • Cement: 0.4 bags | Steel: 4 kg | Sand: 1.8 cft
  • Aggregate: 1.35 cft | Bricks: 8 nos | Paint: 0.18 L

Level 2 — Precision (Mix Design)

  • Concrete (M20, 1:1.5:3): Dry volume × ratio-based calculation
  • Brickwork: Wall volume × 500 bricks/m³
  • Steel: 60-120 kg/m³ by member type
  • Labour: CPWD norm-based day estimation

All formulas are extensively commented with engineering basis references.

🎨 Design

  • Color Palette: Navy blue (#1a365d) + Concrete grey + Amber accent
  • Typography: Inter (body) + Outfit (headings)
  • Effects: Glassmorphism, smooth animations, card-based layout
  • Responsive: Mobile-first with breakpoints at 640px, 768px, 1024px

📝 License

MIT — Built for the Indian construction industry.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages