π± Screenshots β’ π οΈ Tech Stack β’ π Quick Start
A modern, production-ready real estate payment management system with iOS-inspired design
- β¨ Features
- π οΈ Tech Stack
- π Quick Start
- π Project Architecture
- π§ Configuration
- π‘ API Documentation
- π¨ Design System
- π Security
- π Deployment
- π§ͺ Testing
- π Performance
- π Troubleshooting
- π€ Contributing
- π License
- π Real-time Metrics: Portfolio value, brokerage totals, payment status
- π Interactive Analytics: Employee performance charts, payment distribution
- π° Payment Management: Advanced filtering, CRUD operations, status tracking
- ποΈ Project Management: Complete project lifecycle management
- π₯ Employee Management: Performance tracking, commission calculations
- π Secure Authentication: JWT-based login with encrypted passwords
- π iOS-Inspired Design: Clean, modern interface with Apple design language
- π± Responsive Layout: Mobile-first approach with seamless desktop experience
- π Dark/Light Mode: Automatic theme switching with user preferences
- β‘ Smooth Animations: Framer Motion powered transitions
- π― Accessibility: WCAG 2.1 AA compliant design
- π Advanced Filtering: Multi-dimensional data filtering and search
- π Real-time Calculations: Automatic metric updates across all modules
- π€ Data Export: CSV/Excel export functionality
- π Offline Support: Service worker enabled offline capabilities
- π‘ WebSocket Support: Real-time data synchronization
- π Advanced Search: Full-text search across all entities
- π Audit Trail: Complete activity logging and tracking
Ensure you have the following installed:
- Node.js 16+ (Download)
- MongoDB or MongoDB Atlas account (Sign Up)
- Git (Install Guide)
# Clone the repository
git clone https://github.com/your-username/your-project-name.git
cd your-project-name
# Install backend dependencies
cd backend
npm install
# Install frontend dependencies
cd ../frontend
npm install
# Setup environment variables
cp ../backend/.env.example ../backend/.env# Clone repository
git clone https://github.com/your-username/your-project-name.git
cd your-project-name
# Build and run with Docker
docker-compose up --build -d
# Access the application
open http://localhostCreate backend/.env from the template:
# Database Configuration
MONGODB_URI=mongodb://localhost:27017/your_database_name
DATABASE_NAME=your_database_name
# Authentication
JWT_SECRET=your-super-secure-jwt-secret-key-here-min-32-chars
JWT_EXPIRES_IN=24h
# Server Configuration
PORT=3002
NODE_ENV=development
# CORS Configuration
ALLOWED_ORIGINS=http://localhost:3000,https://your-production-domain.com
# Email Configuration (Optional)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-password# Terminal 1 - Backend
cd backend
npm run dev
# Terminal 2 - Frontend
cd frontend
npm start# Backend
cd backend
npm start
# Frontend
cd frontend
npm run build
# Serve build/ directory with nginx or your preferred serverUsers need to create their own accounts through the registration process. Refer to the API documentation for authentication endpoints.
bavadiya-realty-dashboard/
βββ π backend/ # Node.js Express API
β βββ π server.js # Main server file
β βββ π package.json # Dependencies
β βββ π .env.example # Environment template
β βββ π Dockerfile # Backend container
β βββ π employees.json # Sample employee data
β βββ π models/ # Database models
β βββ π User.js # User authentication model
β βββ π Payment.js # Payment records model
β βββ π Employee.js # Employee management model
β βββ π Project.js # Project management model
βββ π frontend/ # React application
β βββ π public/ # Static assets
β βββ π src/ # Source code
β β βββ π App.jsx # Main application component
β β βββ π index.js # Application entry point
β β βββ π components/ # Reusable components
β β β βββ π Dashboard.jsx # Main dashboard view
β β β βββ π Analytics.jsx # Analytics and charts
β β β βββ π DataTable.jsx # Payment records table
β β β βββ π Login.jsx # Authentication form
β β β βββ π UserSettings.jsx # User preferences
β β βββ π context/ # React context providers
β β β βββ π AuthContext.jsx # Authentication context
β β βββ π hooks/ # Custom React hooks
β β βββ π services/ # API service layer
β β βββ π utils/ # Utility functions
β βββ π package.json # Dependencies
β βββ π Dockerfile # Frontend container
β βββ π nginx.conf # Nginx configuration
βββ π docs/ # Documentation
β βββ π API.md # API documentation
β βββ π DEPLOYMENT.md # Deployment guide
β βββ π CONTRIBUTING.md # Contributing guidelines
βββ π docker-compose.yml # Multi-container setup
βββ π docker-compose.prod.yml # Production configuration
βββ π README.md # This file
User authentication endpoint
curl -X POST https://your-api-domain.com/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"username": "your_username",
"password": "your_password"
}'Response:
{
"success": true,
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": "your_user_id",
"username": "your_username",
"role": "admin"
}
}Retrieve all payment records (paginated)
curl -X GET "https://your-api-domain.com/api/payments?page=1&limit=10&status=received" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"Query Parameters:
page(number): Page number (default: 1)limit(number): Items per page (default: 10, max: 100)status(string): Filter by payment statusemployee(string): Filter by employeeproject(string): Filter by projectdateFrom(string): Start date filter (YYYY-MM-DD)dateTo(string): End date filter (YYYY-MM-DD)
Create new payment record
curl -X POST https://your-api-domain.com/api/payments \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"date": "2024-01-15",
"unitNo": "A-101",
"projectName": "Sunrise Apartments",
"ownerName": "John Doe",
"ownerNumber": "+1234567890",
"customerName": "Jane Smith",
"customerNumber": "+0987654321",
"basePrice": 500000,
"ownerBro": 25000,
"customerBro": 25000,
"employee": "EMP001",
"commission": 5
}'Retrieve all employees
curl -X GET https://your-api-domain.com/api/employees \
-H "Authorization: Bearer YOUR_JWT_TOKEN"Create new employee
curl -X POST https://your-api-domain.com/api/employees \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "John Employee",
"code": "EMP002",
"number": "+1234567890",
"email": "john@yourdomain.com"
}'Retrieve all projects
curl -X GET https://your-api-domain.com/api/projects \
-H "Authorization: Bearer YOUR_JWT_TOKEN"Create new project
curl -X POST https://your-api-domain.com/api/projects \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Sunset Villas",
"description": "Luxury villa project",
"location": "Your City, Your State",
"status": "active",
"startDate": "2024-01-01",
"expectedCompletion": "2024-12-31"
}'Retrieve dashboard analytics
curl -X GET https://your-api-domain.com/api/analytics/dashboard \
-H "Authorization: Bearer YOUR_JWT_TOKEN"Response:
{
"totalPortfolio": 50000000,
"totalBrokerage": 2500000,
"ownerBrokerage": 1250000,
"customerBrokerage": 1250000,
"paymentReceived": 1800000,
"outstandingAmount": 700000,
"employeePerformance": [
{
"employee": "EMP001",
"name": "John Employee",
"totalDeals": 25,
"totalRevenue": 1250000
}
],
"paymentStatusDistribution": {
"received": 45,
"partial": 12,
"pending": 8
}
}| Color | Hex | Usage |
|---|---|---|
| iOS Blue | #007AFF |
Primary buttons, links |
| Success | #34C759 |
Success states, positive metrics |
| Warning | #FF9500 |
Warning states, pending items |
| Error | #FF3B30 |
Error states, overdue payments |
| Color | Hex | Usage |
|---|---|---|
| Background | #F2F2F7 |
Page backgrounds |
| Surface | #FFFFFF |
Cards, modals |
| Text Primary | #1D1D1F |
Headings, important text |
| Text Secondary | #86868B |
Body text, descriptions |
| Border | #D1D1D6 |
Dividers, borders |
/* Headings */
.heading-xl {
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
font-size: 2.5rem;
font-weight: 700;
line-height: 1.2;
}
.heading-lg {
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
font-size: 2rem;
font-weight: 600;
line-height: 1.3;
}
/* Body Text */
.body-large {
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
font-size: 1.125rem;
font-weight: 400;
line-height: 1.6;
}
.body-regular {
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
font-size: 1rem;
font-weight: 400;
line-height: 1.6;
}/* Spacing Scale */
--space-1: 0.25rem; /* 4px */
--space-2: 0.5rem; /* 8px */
--space-3: 0.75rem; /* 12px */
--space-4: 1rem; /* 16px */
--space-5: 1.25rem; /* 20px */
--space-6: 1.5rem; /* 24px */
--space-8: 2rem; /* 32px */
--space-10: 2.5rem; /* 40px */
--space-12: 3rem; /* 48px */
/* Border Radius */
--radius-sm: 8px;
--radius-md: 12px;
--radius-lg: 16px;
--radius-xl: 20px;- π JWT Authentication: Secure token-based authentication
- π Password Encryption: bcryptjs with salt rounds 12
- π CORS Protection: Configured allowed origins
- π‘οΈ Input Validation: Joi schema validation for all inputs
- π« Rate Limiting: Express-rate-limit for API protection
- π Helmet.js: Security headers and XSS protection
- π Audit Logging: Complete activity logging
- π SQL Injection Prevention: Parameterized queries only
// Implemented security headers
app.use(helmet({
contentSecurityPolicy: {
directives: {
defaultSrc: ["'self'"],
styleSrc: ["'self'", "'unsafe-inline'"],
scriptSrc: ["'self'"],
imgSrc: ["'self'", "data:", "https:"],
},
},
}));- Never commit
.envfiles to version control - Use strong, unique secrets for JWT tokens (min 32 characters)
- Rotate secrets regularly in production
- Use different credentials for development and production
-
Connect to Vercel
npm i -g vercel vercel login cd frontend vercel --prod -
Environment Variables Add in Vercel dashboard:
REACT_APP_API_URL=https://your-backend-domain.com REACT_APP_ENVIRONMENT=production
-
Serverless Functions Setup
vercel --prod
-
Vercel Configuration (
vercel.json){ "version": 2, "builds": [ { "src": "server.js", "use": "@vercel/node" } ], "routes": [ { "src": "/(.*)", "dest": "/server.js" } ] }
docker-compose up --builddocker-compose -f docker-compose.prod.yml up --build -d# Backend
docker build -t bavadiya-backend ./backend
docker run -p 3002:3002 -d bavadiya-backend
# Frontend
docker build -t bavadiya-frontend ./frontend
docker run -p 80:80 -d bavadiya-frontend# Install PM2
npm install -g pm2
# Backend
cd backend
npm install --production
pm2 start ecosystem.config.js --env production
# Frontend
cd frontend
npm run build
# Serve with nginx or Apacheserver {
listen 80;
server_name bavadiyarealty.com;
# Frontend
location / {
root /var/www/bavadiya-frontend/build;
try_files $uri $uri/ /index.html;
}
# Backend API
location /api/ {
proxy_pass http://localhost:3002;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}# Frontend unit tests
cd frontend
npm test
# Backend unit tests
cd backend
npm test# Run all integration tests
npm run test:integration# Install Cypress
npm install cypress --save-dev
# Run E2E tests
npm run test:e2e# Generate coverage report
npm run test:coverage
# View coverage report
open coverage/lcov-report/index.html- π¦ Code Splitting: Automatic route-based code splitting
- ποΈ Database Indexing: Optimized MongoDB indexes
- π± Progressive Web App: Service worker enabled
- πΌοΈ Image Optimization: Lazy loading and WebP support
- β‘ Caching Strategy: Redis caching for frequently accessed data
- π Bundle Analysis: Webpack bundle analyzer integration
| Metric | Target | Current |
|---|---|---|
| First Contentful Paint | < 1.5s | 1.2s |
| Largest Contentful Paint | < 2.5s | 2.1s |
| Time to Interactive | < 3.5s | 2.8s |
| Cumulative Layout Shift | < 0.1 | 0.05 |
// Built-in performance monitoring
import { getCLS, getFID, getFCP, getLCP, getTTFB } from 'web-vitals';
getCLS(console.log);
getFID(console.log);
getFCP(console.log);
getLCP(console.log);
getTTFB(console.log);Problem: MongoDB connection failed
Solution:
# Check MongoDB status
sudo systemctl status mongod
# Test connection
mongo --host your-mongodb-host:27017
# Update environment variables
MONGODB_URI=mongodb://your-username:your-password@your-mongodb-host:27017/your-databaseProblem: EADDRINUSE: address already in use
Solution:
# Find process using port
lsof -ti:3000
# Kill process
kill -9 $(lsof -ti:3000)
# Or use different port
PORT=3001 npm startProblem: Frontend build fails
Solution:
# Clear node_modules and reinstall
rm -rf node_modules package-lock.json
npm install
# Clear npm cache
npm cache clean --force
# Clear React build cache
rm -rf build/
npm run buildProblem: JWT token invalid/expired
Solution:
// Check token expiration
const decoded = JSON.parse(atob(token.split('.')[1]));
console.log('Token expires:', new Date(decoded.exp * 1000));
// Refresh token manually
const newToken = await refreshAuthToken();Problem: Container won't start
Solution:
# Check container logs
docker-compose logs frontend
docker-compose logs backend
# Rebuild containers
docker-compose down
docker-compose up --build
# Check docker system
docker system prune# Backend debug
DEBUG=app:* npm run dev
# Frontend debug
REACT_APP_DEBUG=true npm start
# MongoDB debug
DEBUG=mongodb:* npm start- Open DevTools: F12 or Cmd+Option+I
- Check Console: Look for error messages
- Network Tab: Verify API requests
- Application Tab: Check localStorage, cookies, service worker
We welcome contributions! Please follow these guidelines:
# Fork the repository
git clone https://github.com/your-username/bavadiya-realty-dashboard.git
cd bavadiya-realty-dashboard
# Add upstream remote
git remote add upstream https://github.com/original-username/original-project-name.git
# Install dependencies
npm install# Create feature branch
git checkout -b feature/amazing-new-feature
# Make changes and commit
git add .
git commit -m "feat: add amazing new feature"
# Push and create PR
git push origin feature/amazing-new-feature- ESLint: Follow the configured linting rules
- Prettier: Code formatting is automatic
- Conventional Commits: Use conventional commit messages
- Tests: Add tests for new features
- Documentation: Update docs for API changes
type(scope): description
feat(auth): add OAuth2 authentication
fix(dashboard): resolve chart rendering issue
docs(api): update payment endpoint documentation
style(ui): improve mobile responsiveness
refactor(models): simplify payment calculation logic
- Fork & Branch: Create feature branch from
main - Code: Follow style guidelines and add tests
- Test: Run all tests locally before pushing
- Document: Update README and API docs if needed
- PR: Create pull request with clear description
- π Bug Fixes: Fix existing issues
- β¨ New Features: Add new functionality
- π Documentation: Improve docs and examples
- π¨ UI/UX: Enhance user interface
- β‘ Performance: Optimize performance
- π Security: Improve security measures
- π§ͺ Tests: Add more test coverage
π bug- Something isn't workingβ¨ feature- New feature requestπ documentation- Documentation improvementsπ¨ ui/ux- UI/UX design changesβ‘ performance- Performance optimizationsπ security- Security improvementsgood first issue- Good for newcomers
MIT License - Feel free to use this project for commercial or personal purposes.
Copyright (c) 2024 Bavadiya Realty LLP
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Jenil Rupapara
- π LinkedIn: Jenil Rupapara
- π± GitHub: Jenil Rupapara
- π§ Email: jenilrupapara340@gmail.com
- π Portfolio: jenilrupapara.netlify.app
Special thanks to:
- π Apple Design Team - For the beautiful iOS design language.
- βοΈ React Team - For the amazing React framework
- π Material-UI - For the comprehensive component library
- π Vercel - For seamless deployment platform
- π MongoDB - For the flexible database solution
- π’ Bavadiya Realty LLP - For the opportunity to build this amazing dashboard
β Star this repository if you find it helpful! β
Built with β€οΈ by Jenil Rupapara for Bavadiya Realty LLP