A comprehensive Property Management Platform built with modern web technologies. Features a complete React frontend with TypeScript, Node.js/Express backend with layered architecture, PostgreSQL database, Google OAuth authentication, and comprehensive API documentation for managing rental properties, tenants, leases, and rent payments.
Deploy your Asset Management Platform using GitHubβs free services!
https://yourusername.github.io/repository-namehttps://yourusername.github.io/repository-namehttps://your-app.onrender.comhttps://your-app.onrender.com/api-docsFor detailed instructions, see DEPLOYMENT.md.
βββββββββββββββββββ
β Controllers β β HTTP Layer (Express routes)
βββββββββββββββββββ€
β Services β β Business Logic Layer
βββββββββββββββββββ€
β Repositories β β Data Access Layer
βββββββββββββββββββ€
β Database β β PostgreSQL with pg library
βββββββββββββββββββ
β
βββββββββββββββββββ
β Dependency β
β Container β β Singleton DI container
β (Interfaces) β
βββββββββββββββββββ
βββββββββββββββββββ
β Components β β UI Layer (Reusable components)
βββββββββββββββββββ€
β Pages β β Route-level components
βββββββββββββββββββ€
β Hooks β β Business Logic Layer
βββββββββββββββββββ€
β Services β β API Communication Layer
βββββββββββββββββββ€
β Contexts β β Global State Management
β β
β Types & Utils β β Supporting Infrastructure
βββββββββββββββββββ
pg library and connection poolingPropertyManagementPlatform/
βββ frontend/ # React application with industrial-grade architecture
β βββ src/
β β βββ components/ # Reusable UI components
β β β βββ auth/ # Authentication components
β β β β βββ ProtectedRoute.tsx
β β β β βββ PublicRoute.tsx
β β β β βββ index.ts
β β β βββ common/ # Generic components (Button, Input, Card, GoogleOAuthButton)
β β β βββ forms/ # Form components (LoginForm, RegisterForm, etc.)
β β β βββ ui/ # UI-specific components
β β βββ pages/ # Route-level page components
β β β βββ Dashboard.tsx # Main dashboard with property overview
β β βββ hooks/ # Custom React hooks
β β β βββ useApi.ts # API communication hook
β β β βββ useProperties.ts # Property management hook
β β β βββ useUsers.ts # User management hook
β β β βββ useGoogleOAuth.ts # Google OAuth integration hook
β β βββ services/ # API service functions
β β β βββ apiClient.ts # Centralized API client
β β β βββ propertyService.ts # Property API operations
β β β βββ authService.ts # Authentication API operations
β β β βββ userService.ts # User API operations
β β βββ contexts/ # React contexts for global state
β β β βββ AuthContext.tsx # Authentication state management
β β β βββ ThemeContext.tsx # Theme management
β β β βββ NotificationContext.tsx # Notification system
β β β βββ index.ts # Context exports
β β βββ types/ # TypeScript type definitions
β β β βββ property.ts # Property-related types
β β β βββ user.ts # User-related types
β β β βββ api.ts # API response types
β β β βββ common.ts # Common/shared types
β β β βββ index.ts # Type exports
β β βββ constants/ # Configuration constants
β β βββ utils/ # Utility functions
β β βββ App.tsx # Main app component with context providers
β β βββ main.tsx # Application entry point
β βββ public/ # Static assets
β βββ package.json
βββ backend/ # Express API server with layered architecture
β βββ src/
β β βββ controllers/ # HTTP request handlers
β β β βββ propertyController.ts
β β β βββ tenantController.ts
β β β βββ unitController.ts
β β β βββ leaseController.ts
β β β βββ rentPaymentController.ts
β β β βββ unitTenantController.ts
β β β βββ userController.ts
β β β βββ authController.ts
β β βββ services/ # Business logic layer
β β β βββ PropertyService.ts
β β β βββ TenantService.ts
β β β βββ UnitService.ts
β β β βββ LeaseService.ts
β β β βββ RentPaymentService.ts
β β β βββ UnitTenantService.ts
β β β βββ UserService.ts
β β β βββ AuthService.ts
β β β βββ PasswordResetService.ts
β β βββ repositories/ # Data access layer
β β β βββ PropertyRepository.ts
β β β βββ TenantRepository.ts
β β β βββ UnitRepository.ts
β β β βββ LeaseRepository.ts
β β β βββ RentPaymentRepository.ts
β β β βββ UnitTenantRepository.ts
β β β βββ UserRepository.ts
β β β βββ PasswordResetMethodRepository.ts
β β β βββ RecoveryCodeRepository.ts
β β β βββ SecurityQuestionRepository.ts
β β βββ interfaces/ # TypeScript interfaces for DI
β β β βββ repositories/
β β β βββ services/
β β βββ models/ # Data transfer objects
β β β βββ Property.ts
β β β βββ Tenant.ts
β β β βββ Unit.ts
β β β βββ Lease.ts
β β β βββ RentPayment.ts
β β β βββ User.ts
β β βββ routes/ # API route definitions
β β βββ utils/ # Backend utilities
β β βββ constants/ # Configuration constants
β β βββ middlewares/ # Express middlewares
β β β βββ authMiddleware.ts
β β β βββ validationMiddleware.ts
β β βββ server.ts # Application entry point
β βββ tests/ # Test suites
β βββ package.json
βββ docker/ # Docker configurations
βββ docs/ # API documentation
βββ scripts/ # Build and deployment scripts
βββ docker-compose.yml # Multi-container setup
βββ package.json # Root workspace configuration
# Clone the repository
git clone <repository-url>
cd PropertyManagementPlatform
# Install dependencies for all workspaces
npm install
# Copy environment template
cp .env.example .env
# Edit .env with your configuration
# Required: DATABASE_URL, JWT_SECRET, GOOGLE_CLIENT_ID, etc.
For the fastest setup, use the single-command pipeline:
# Complete database setup in one command (interactive)
python3 setup_database.py
This runs the 3-step pipeline with confirmation before each step:
Test Credentials:
admin@assetplatform.com / admin123ramesh_patel@example.com / owner123# Start PostgreSQL with Docker Compose
docker-compose up -d postgres
# Or use the full stack
docker-compose up -d
The project includes comprehensive Python scripts for database management:
# First-time setup (migration + test data)
./scripts/db_manage.sh setup
# Or run individual commands
./scripts/db_manage.sh migrate # Convert IDs to UUID
./scripts/db_manage.sh seed # Add test data
./scripts/db_manage.sh clean # Remove test data
./scripts/db_manage.sh test # Test connection
For complete system setup from scratch, use the end-to-end script:
# Complete setup (database + services + tests)
./scripts/e2e_setup.sh
# Quick setup (skip build and tests)
./scripts/e2e_setup.sh --skip-build --skip-tests
# Show help
./scripts/e2e_setup.sh --help
What the end-to-end script does:
Test Credentials:
admin@propertyplatform.com / admin123john.doe@example.com / password123manager@propertyplatform.com / manager123See scripts/python/README.md for detailed database documentation.
# Start both frontend and backend in development mode
npm run dev
# Or run workspaces separately
npm run dev --workspace=frontend
npm run dev --workspace=backend
The platform supports seamless Google OAuth authentication:
POST /api/auth/google
Content-Type: application/json
{
"credential": "google-jwt-token"
}
POST /api/auth/login
Content-Type: application/json
{
"email": "user@example.com",
"password": "securePassword123"
}
POST /api/auth/register
Content-Type: application/json
{
"username": "john.doe",
"email": "john@example.com",
"password": "securePassword123"
}
GET /api/properties
Authorization: Bearer <token>
Response:
{
"success": true,
"data": [
{
"id": "uuid-string",
"name": "Sunset Apartments",
"description": "Luxury apartment complex",
"address": "123 Main St, City, State 12345",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 1
}
}
POST /api/properties
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "Riverside Condos",
"description": "Modern condominium complex",
"address": "456 River Rd, City, State 12345"
}
PUT /api/properties/:id
DELETE /api/properties/:id
Authorization: Bearer <token>
# Run all tests
npm test
# Run backend tests only
npm test --workspace=backend
# Run with coverage
npm run test:coverage
# Build and run with Docker Compose
docker-compose up --build
# Or build manually
npm run build
docker build -t property-management .
docker run -p 5000:5000 property-management
| Variable | Description | Default |
|---|---|---|
NODE_ENV |
Environment mode | development |
PORT |
Server port | 5000 |
DATABASE_URL |
PostgreSQL connection string | Required |
JWT_SECRET |
JWT signing secret | Required |
JWT_EXPIRE |
JWT expiration time | 1h |
REFRESH_TOKEN_EXPIRE |
Refresh token expiration | 7d |
BCRYPT_ROUNDS |
Password hashing rounds | 12 |
GOOGLE_CLIENT_ID |
Google OAuth client ID | Required |
git checkout -b feature/amazing-featuregit commit -m 'Add amazing feature'git push origin feature/amazing-feature# 1. Create feature branch
git checkout -b feature/new-feature
# 2. Make changes and run tests
npm test
# 3. Lint and format code
npm run lint
npm run format
# 4. Commit with conventional format
git commit -m "feat: add new property filtering"
# 5. Push and create PR
git push origin feature/new-feature
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ using React, TypeScript, Node.js, Express, and PostgreSQL