A comprehensive full-stack property management system built with Go backend and React frontend. This system provides complete property, tenant, lease, maintenance, and accounting management with role-based access control.
- User Management: Admin, landlord, tenant, and maintenance team roles
- Property Management: Create, read, update, and delete properties
- Lease Management: Handle lease agreements and tenant-property relationships
- Maintenance Tracking: Request, assign, and track maintenance tasks
- Accounting System: Invoice generation and expense tracking
- Authentication: JWT-based authentication with role-based access control
- Dashboard: Real-time analytics and KPIs for different user roles
- Modern UI/UX: Responsive design with modern components and navigation
- Admin: Full system access, user management, system-wide reports
- Landlord: Property management, tenant relations, financial tracking
- Tenant: View personal information, submit maintenance requests
- Maintenance Team: View and update maintenance requests
- Language: Go 1.24
- Framework: Gin (HTTP web framework)
- Database: PostgreSQL with GORM ORM
- Cache: Redis v8 (rate limiting only)
- Authentication: JWT tokens (golang-jwt/jwt/v4)
- Logging: Standard Go logging
- Configuration: Godotenv for environment variables
- Security: Bcrypt for password hashing
- CORS: Gin-contrib/cors middleware
- Testing: Go testing framework
- Framework: React 18
- Routing: React Router DOM v7
- HTTP Client: Axios
- UI Components: Custom modern components
- State Management: React Context API
- Styling: CSS3 with modern design system
- Authentication: JWT with automatic refresh
- Notifications: React Toastify
- Testing: React Testing Library
- Prop Validation: PropTypes
property-manager/
βββ backend/ # Go backend application
β βββ api/ # HTTP handlers organized by domain
β β βββ accounting/ # Invoice and expense handlers
β β βββ auth/ # Authentication handlers
β β βββ dashboard/ # Dashboard and analytics handlers
β β βββ lease/ # Lease management handlers
β β βββ maintenance/ # Maintenance request handlers
β β βββ property/ # Property management handlers
β β βββ user/ # User management handlers
β βββ cmd/ # Application entry points
β βββ config/ # Configuration management
β βββ db/ # Database connections
β βββ middleware/ # HTTP middleware
β βββ models/ # Data models
β βββ router/ # HTTP routing
β βββ utils/ # Utility functions (email service)
β βββ tests/ # Test files
βββ frontend/ # React frontend application
β βββ public/ # Static assets
β βββ src/
β β βββ api/ # API service layer
β β βββ components/ # Reusable UI components
β β β βββ common/ # Common components (Button, DataTable, etc.)
β β β βββ layout/ # Layout components (Header, Sidebar, etc.)
β β βββ constants/ # Application constants and routes
β β βββ context/ # React Context providers
β β βββ hooks/ # Custom React hooks
β β βββ pages/ # Page components
β β βββ utils/ # Utility functions
β βββ package.json # Dependencies and scripts
β βββ README.md # Frontend-specific documentation
βββ docs/ # Project documentation
- Go 1.24 or later
- Node.js 16 or later
- PostgreSQL 12 or later
- Redis 6 or later
git clone https://github.com/geoo115/property-manager.git
cd property-managercd backend
go mod downloadCreate a .env file in the backend directory:
# Database Configuration
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=your_password
DB_NAME=property_management_db
# Redis Configuration (for rate limiting)
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
# JWT Configuration
JWT_SECRET=your-super-secret-jwt-key-here
JWT_EXPIRY=24h
REFRESH_TOKEN_EXPIRY=168h
# Server Configuration
PORT=8080
APP_ENV=development
# Email Configuration (for maintenance notifications)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-password
MAINTENANCE_TEAM_EMAIL=maintenance@example.com- Create the PostgreSQL database:
CREATE DATABASE property_management_db;- Run the database migrations (auto-migrated on startup):
go run cmd/main.go- Seed the database with initial data:
go run scripts/comprehensive_seed.gogo run cmd/main.goThe API will be available at http://localhost:8080
cd frontend
npm installCreate a .env file in the frontend directory:
REACT_APP_API_URL=http://localhost:8080
REACT_APP_ENV=developmentnpm startThe frontend will be available at http://localhost:3000
- AppLayout: Main application wrapper with sidebar and header
- Sidebar: Navigation menu with role-based menu items
- Header: Top navigation with user info and logout functionality
- Button: Reusable button component with multiple variants
- DataTable: Advanced table with sorting, filtering, and pagination
- FormField: Consistent form input component with validation
- LoadingSpinner: Loading states for async operations
- Alert: Notification and alert component
- Dashboard: Role-specific dashboard with KPIs and quick actions
- Properties: Property management with CRUD operations
- Leases: Lease management and tenant relations
- Users: User management (admin only)
- Maintenance: Maintenance request tracking
- Invoices: Invoice management and generation
- Expenses: Expense tracking and reporting
/login- User authentication/register- User registration
-
Admin Routes:
/admin/dashboard- Admin dashboard/admin/properties- All properties management/admin/leases- All leases management/admin/users- User management/admin/maintenances- All maintenance requests/admin/accounting/invoices- All invoices/admin/accounting/expenses- All expenses
-
Landlord Routes:
/landlord/properties- Landlord's properties/landlord/leases- Landlord's leases/accounting/invoices- Landlord's invoices/accounting/expenses- Landlord's expenses
-
Tenant Routes:
/tenant/leases- Tenant's leases/tenant/maintenance- Tenant's maintenance requests
-
Maintenance Team Routes:
/maintenanceTeam/maintenances- Assigned maintenance requests
- Color Palette: Professional blue and gray theme
- Typography: Clean, readable font hierarchy
- Spacing: Consistent spacing using CSS custom properties
- Responsive Design: Mobile-first approach with breakpoints
- Accessibility: WCAG 2.1 compliant components
- Real-time Updates: Automatic data refresh for critical information
- Form Validation: Client-side validation with error messages
- Loading States: Skeleton screens and spinners
- Toast Notifications: Success, error, and info messages
- Confirmation Dialogs: Destructive action confirmations
- Sidebar Navigation: Collapsible sidebar with role-based menu items
- Breadcrumbs: Context-aware navigation breadcrumbs
- Quick Actions: Dashboard shortcuts for common tasks
- Search Functionality: Global search across entities
- Login Process: User credentials sent to
/loginendpoint - Token Storage: JWT tokens stored in localStorage
- Auto-refresh: Automatic token refresh before expiration
- Route Protection: Protected routes based on user roles
- Logout: Secure token cleanup and redirect
- JWT Token Management: Automatic refresh and secure storage
- Role-based Route Protection: Component-level access control
- Input Validation: Client-side validation with backend verification
- CORS Configuration: Proper cross-origin resource sharing
- XSS Prevention: Sanitized user inputs and outputs
- Rate Limiting: Redis-based rate limiting for API protection
- System Overview: Total users, properties, active leases
- Financial Metrics: Monthly revenue, outstanding invoices
- Maintenance Status: Open, in-progress, completed requests
- Recent Activity: Latest system activities and notifications
- Quick Actions: Direct access to common admin tasks
- Property Portfolio: Property count, occupancy rates
- Financial Performance: Rental income, expenses, profit margins
- Maintenance Overview: Property maintenance status
- Tenant Information: Active tenants, lease expirations
- Quick Actions: Add property, create lease, view reports
- Lease Information: Current lease details, payment history
- Maintenance Requests: Submit and track maintenance requests
- Payment Status: Outstanding invoices, payment history
- Property Details: Current residence information
- Quick Actions: Submit maintenance, view lease, contact landlord
- Work Queue: Assigned maintenance requests by priority
- Completion Status: Daily, weekly, monthly completion rates
- Priority Distribution: High, medium, low priority requests
- Performance Metrics: Response times, completion rates
- Quick Actions: Update status, add notes, schedule work
// Usage examples
<Button variant="primary" size="medium" onClick={handleClick}>
Primary Action
</Button>
<Button variant="secondary" size="small" disabled>
Secondary Action
</Button>
<Button variant="danger" size="large" icon="trash">
Delete Item
</Button>// Usage example
<DataTable
data={properties}
columns={[
{ key: 'address', title: 'Address', sortable: true },
{ key: 'type', title: 'Type', filterable: true },
{ key: 'rent_amount', title: 'Rent', sortable: true, format: 'currency' }
]}
onEdit={handleEdit}
onDelete={handleDelete}
pagination={true}
searchable={true}
/>// Usage example
<FormField
label="Property Address"
type="text"
value={formData.address}
onChange={(value) => setFormData({...formData, address: value})}
required
validation={addressValidation}
placeholder="Enter property address"
/>The frontend uses a centralized API service layer for backend communication:
// api/apiService.js
import axios from 'axios';
const apiClient = axios.create({
baseURL: process.env.REACT_APP_API_URL || 'http://localhost:8080',
timeout: 10000,
});
// Request interceptor for authentication
apiClient.interceptors.request.use((config) => {
const token = localStorage.getItem('token');
if (token) {
config.headers.Authorization = `Bearer ${token}`;
}
return config;
});
// Response interceptor for error handling
apiClient.interceptors.response.use(
(response) => response,
(error) => {
if (error.response?.status === 401) {
// Handle token expiration
localStorage.removeItem('token');
window.location.href = '/login';
}
return Promise.reject(error);
}
);POST /login- User authenticationPOST /register- User registrationPOST /refresh-token- Token refreshPOST /logout- User logout
GET /admin/properties- Get all propertiesGET /admin/properties/:id- Get property by IDPOST /admin/properties- Create propertyPUT /admin/properties/:id- Update propertyDELETE /admin/properties/:id- Delete property
GET /admin/leases- Get all leasesGET /admin/leases/:id- Get lease by IDGET /tenant/leases- Get tenant leasesPOST /admin/leases- Create leasePUT /admin/leases/:id- Update leaseDELETE /admin/leases/:id- Delete lease
GET /admin/maintenances- Get all maintenance requestsGET /admin/maintenances/:id- Get maintenance by IDPOST /admin/maintenances- Create maintenance requestPUT /admin/maintenances/:id- Update maintenance requestDELETE /admin/maintenances/:id- Delete maintenance request
GET /admin/accounting/invoices- Get all invoicesGET /admin/accounting/expenses- Get all expensesPOST /admin/accounting/invoices- Create invoicePOST /admin/accounting/expenses- Create expense
# Run all tests
go test ./...
# Run tests with coverage
go test -cover ./...
# Run specific test file
go test ./tests/auth_test.go
# Run with verbose output
go test -v ./...# Run all tests
npm test
# Run tests with coverage
npm test -- --coverage
# Run tests in watch mode
npm test -- --watch
# Run specific test file
npm test -- --testNamePattern="Button"- Backend:
tests/directory with Go test files - Frontend:
src/directory with.test.jsfiles alongside components
# Build binary
go build -o bin/server cmd/main.go
# Docker build
docker build -t property-manager-backend .
# Run with Docker Compose
docker-compose up -d# Build for production
npm run build
# The build folder contains optimized production files
# Deploy to your preferred hosting service (Netlify, Vercel, etc.)| Variable | Default | Description |
|---|---|---|
PORT |
8080 | Server port |
APP_ENV |
development | Application environment |
DB_HOST |
localhost | PostgreSQL host |
DB_PORT |
5432 | PostgreSQL port |
DB_USER |
postgres | Database user |
DB_PASSWORD |
- | Database password |
DB_NAME |
property_management_db | Database name |
REDIS_HOST |
localhost | Redis host (rate limiting) |
REDIS_PORT |
6379 | Redis port |
JWT_SECRET |
- | JWT signing secret |
JWT_EXPIRY |
24h | JWT token expiry |
SMTP_HOST |
- | SMTP server for email notifications |
SMTP_USER |
- | SMTP username |
SMTP_PASS |
- | SMTP password |
MAINTENANCE_TEAM_EMAIL |
- | Email for maintenance notifications |
| Variable | Default | Description |
|---|---|---|
REACT_APP_API_URL |
http://localhost:8080 | Backend API URL |
REACT_APP_ENV |
development | Application environment |
The system includes the following demo users for testing:
-
Admin User
- Email:
admin@example.com - Password:
admin123 - Role: Admin
- Access: Full system access
- Email:
-
Landlord User
- Email:
landlord@example.com - Password:
landlord123 - Role: Landlord
- Access: Property and tenant management
- Email:
-
Tenant User
- Email:
tenant@example.com - Password:
tenant123 - Role: Tenant
- Access: Personal information and maintenance requests
- Email:
-
Maintenance Team User
- Email:
maintenance@example.com - Password:
maintenance123 - Role: Maintenance Team
- Access: Maintenance request management
- Email:
-
API Connection Issues
- Check backend server is running on port 8080
- Verify REACT_APP_API_URL environment variable
- Check browser console for CORS errors
-
Authentication Issues
- Clear localStorage and try logging in again
- Check JWT token expiration in browser dev tools
- Verify user credentials with demo accounts
-
Component Rendering Issues
- Check browser console for React errors
- Verify all required props are passed to components
- Check for missing dependencies in package.json
-
Database Connection Issues
- Check PostgreSQL service status
- Verify connection credentials in .env file
- Ensure database exists and migrations are run
-
Authentication Failures
- Verify JWT secret configuration
- Check token expiration settings
- Validate user credentials in database
-
Email Notification Issues
- Check SMTP configuration in .env file
- Verify email credentials are correct
- Test email functionality with maintenance requests
Enable debug logging:
Backend:
export LOG_LEVEL=debug
go run cmd/main.goFrontend:
REACT_APP_LOG_LEVEL=debug npm start- Backend: Follow Go naming conventions, use
gofmt - Frontend: Follow React best practices, use ES6+ features
- Comments: Add comments for public functions and complex logic
- Testing: Write tests for new features and bug fixes
- Create feature branch from main
- Make changes with descriptive commit messages
- Add tests for new functionality
- Create pull request with detailed description
- Code review and merge
- Create reusable components in
src/components/common/ - Use PropTypes for type checking
- Follow naming conventions (PascalCase for components)
- Add CSS modules for styling
- Include comprehensive documentation
- OpenAPI/Swagger: Available at
http://localhost:8080/swagger - Postman Collection: Import from
docs/postman_collection.json - API Reference: See
docs/API_DOCUMENTATION.md
- Storybook: Run
npm run storybookfor component documentation - PropTypes: Component prop documentation in source files
- Usage Examples: See component files for usage examples
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow installation instructions above
- Make sure all tests pass
- Follow code style guidelines
- Add tests for new features
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Email: support@propertymanager.com
- Documentation: API Documentation
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Mobile app (React Native)
- Advanced reporting and analytics
- Document management system
- Payment integration (Stripe/PayPal)
- Multi-language support
- Advanced notification system
- API rate limiting dashboard
- Audit trail and logging improvements
- Initial release with full CRUD operations
- Authentication system with JWT
- Role-based access control
- Basic dashboard functionality
- Modern React frontend with responsive design
- Enhanced UI/UX with modern design system
- Advanced data table with filtering and sorting
- Improved form validation and error handling
- Real-time notifications
- Performance optimizations
- Comprehensive testing suite
- Go community for excellent libraries and tools
- React community for modern frontend development patterns
- PostgreSQL for robust database management
- Redis for efficient rate limiting
- All contributors and users of this project