A modern Spring Boot application for managing house rentals with features like property listing, user authentication, booking management, and admin dashboard.
- Authentication: Secure login/register with email verification
- Property Search: Advanced search and filter capabilities
- Property Details: Detailed property views with image galleries
- Booking Management: Request and manage property bookings
- Profile Management: Update personal information and preferences
- Favorites: Save and manage favorite properties
- Property Management: Add, edit, and manage property listings
- Dashboard: Overview of properties, bookings, and revenue
- Image Upload: Multiple property images with drag-and-drop interface
- Booking Requests: Review and respond to tenant requests
- Analytics: Property performance and viewing statistics
- Admin Dashboard: System overview and user management
- User Management: Manage user accounts and permissions
- Property Oversight: Monitor and moderate property listings
- System Analytics: Platform usage and performance metrics
- Java 21+ (for local development)
- Maven 3.9+ (for local development)
- Node.js 16+ & npm 8+ (for CSS/frontend build)
- Docker & Docker Compose (recommended for easy setup)
- Clone the repository
git clone https://github.com/yourusername/house-rental.git
cd house-rental- Environment Setup
Create a
.envfile:
SPRING_DATASOURCE_URL=jdbc:sqlserver://localhost:1434;databaseName=HouseRentalDB;encrypt=true;trustServerCertificate=true
SPRING_DATASOURCE_USERNAME=sa
SPRING_DATASOURCE_PASSWORD=Dat12345!
SPRING_MAIL_USERNAME=your-email@gmail.com
SPRING_MAIL_PASSWORD=your-app-password- Start with Docker
docker-compose up -d- Access the application
- π Web app: http://localhost:8080
- ποΈ SQL Server: localhost:1434
- π¦ Redis: localhost:6380
- Install dependencies
npm install- Build CSS (one-time)
npm run build:css:prod- Run the application
./mvnw spring-boot:runThis project uses Tailwind CSS with a custom build system:
src/main/resources/static/css/
βββ input.css # π Source file (edit this)
βββ main.css # π Built file (auto-generated)
For active development (watch mode):
# Windows
./dev-css.bat
# Linux/Mac
./dev-css.sh
# Or directly
npm run build:cssFor production build:
npm run build:css:prodAuto-build on app start:
mvn spring-boot:run # CSS builds automatically- βοΈ Edit
src/main/resources/static/css/input.css - π Run watch mode:
npm run build:css - πΎ CSS compiles to
main.cssautomatically - π Refresh browser to see changes
π HouseRental/
βββ π src/main/
β βββ π java/com/rental/houserental/
β β βββ π controller/ # REST controllers
β β β βββ π admin/ # Admin endpoints
β β β βββ π landlord/ # Landlord endpoints
β β β βββ π user/ # User endpoints
β β βββ π service/ # Business logic
β β βββ π repository/ # Data access
β β βββ π entity/ # JPA entities
β β βββ π dto/ # Data transfer objects
β β βββ π security/ # Security configuration
β β βββ π config/ # App configuration
β β βββ π exceptions/ # Custom exceptions
β βββ π resources/
β βββ π static/
β β βββ π css/ # Stylesheets
β β βββ π js/ # JavaScript files
β βββ π templates/ # Thymeleaf templates
β βββ π admin/ # Admin pages
β βββ π landlord/ # Landlord pages
β βββ π user/ # User pages
β βββ π fragments/ # Reusable components
β βββ π layout/ # Page layouts
βββ π package.json # npm dependencies & scripts
βββ π tailwind.config.js # Tailwind configuration
βββ π pom.xml # Maven dependencies
βββ π docker-compose.yml # Docker setup
- Spring Boot 3.x - Application framework
- Spring Security - Authentication & authorization
- Spring Data JPA - Database operations
- Thymeleaf - Server-side templating
- SQL Server - Primary database
- Redis - Caching & session storage
- Java Mail - Email notifications
- Tailwind CSS 3.x - Utility-first CSS framework
- JavaScript ES6+ - Client-side interactions
- Font Awesome 6 - Icons
- Inter Font - Typography
- Docker & Docker Compose - Containerization
- Maven - Build tool & dependency management
- npm - Frontend package management
- JWT Authentication with refresh tokens
- Email Verification for new accounts
- Password Reset with secure tokens
- CSRF Protection on all forms
- Session Management with Redis
- Role-based Access Control (User, Landlord, Admin)
- Remember Me functionality
# Build CSS for production
npm run build:css:prod
# Create jar file
./mvnw clean package -DskipTests
# Run with Docker
docker-compose -f docker-compose.prod.yml up -d# Database
SPRING_DATASOURCE_URL=your_database_url
SPRING_DATASOURCE_USERNAME=your_username
SPRING_DATASOURCE_PASSWORD=your_password
# Email
SPRING_MAIL_USERNAME=your_email
SPRING_MAIL_PASSWORD=your_app_password
# Redis
SPRING_REDIS_HOST=your_redis_host
SPRING_REDIS_PORT=6379
# Application
SERVER_PORT=8080
SPRING_PROFILES_ACTIVE=prod# Terminal 1: Start CSS watch mode
npm run build:css
# Terminal 2: Start Spring Boot with dev profile
./mvnw spring-boot:run -Dspring-boot.run.profiles=dev# Connect to SQL Server (Docker)
docker exec -it houserental-db-1 /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Dat12345!
# Backup database
docker exec houserental-db-1 /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Dat12345! -Q "BACKUP DATABASE HouseRentalDB TO DISK = '/var/opt/mssql/backup/HouseRentalDB.bak'"# Start services
docker-compose up -d
# View logs
docker-compose logs -f app
# Rebuild with changes
docker-compose up -d --build
# Clean reset
docker-compose down -v && docker-compose up -d# Run all tests
./mvnw test
# Run specific test class
./mvnw test -Dtest=AuthServiceTest
# Run with coverage
./mvnw test jacoco:reportThe application provides REST endpoints for:
- Authentication:
/api/auth/* - Properties:
/api/properties/* - Users:
/api/users/* - Bookings:
/api/bookings/* - Admin:
/api/admin/*
Visit /swagger-ui.html when running locally for interactive API docs.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow Java coding standards
- Write unit tests for new features
- Use conventional commits
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
- Your Name - Initial work - @yourusername
If you have any questions or run into issues:
- Check the Issues page
- Create a new issue with detailed description
- Contact: your.email@example.com
Built with β€οΈ using Spring Boot and Tailwind CSS