The Forum Application is a comprehensive distributed web application developed using Advanced Java Programming concepts. It provides a robust platform for users to create topics, post comments, engage in discussions, and share knowledge through a modern, responsive web interface.
Developer: Simphiwe Radebe
Course: Advanced Java Programming (ITHCA0)
Institution: Eduvos
Project: Project 1 - Distributed Applications
Version: 1.0.0
- Java 11 or higher
- Apache Maven 3.6+
- MySQL 8.0+
- Apache Tomcat 9.0+
# Clone the repository
git clone <repository-url> forum-app
cd forum-app
# Set up environment variable
export CATALINA_HOME=/path/to/your/tomcat
# Run the automated deployment script
chmod +x deploy.sh
./deploy.sh# Build the project
mvn clean compile package
# Deploy to Tomcat
rm -rf $CATALINA_HOME/webapps/forum-app*
cp target/forum-app.war $CATALINA_HOME/webapps/
# Start Tomcat and view logs
$CATALINA_HOME/bin/catalina.sh start
tail -f $CATALINA_HOME/logs/catalina.outAccess the application: http://localhost:8080/forum-app/
- Installation Guide - Comprehensive setup instructions
- User Guide - Complete user documentation and tutorials
- API Documentation - RESTful API reference
-
β User Management
- Secure registration and authentication
- Password reset functionality
- Profile management and updates
- Session management with "Remember Me"
-
β Forum Features
- Topic creation and management
- Nested comment system with replies
- Real-time search functionality
- Activity logging and tracking
-
β Technical Features
- RESTful API endpoints
- Responsive Bootstrap 5 UI
- MySQL database with proper relationships
- Input validation and security measures
- Comprehensive error handling
- Web Services Integration: RESTful API for all major operations
- Security: Password hashing, input sanitization, SQL injection prevention
- Logging: Comprehensive activity logging for all user actions
- Responsive Design: Mobile-friendly interface that adapts to all screen sizes
- Search: Full-text search across topics and descriptions
- Java 11+ - Core programming language
- Servlets & JSP - Web framework
- Maven - Build tool and dependency management
- MySQL 8.0 - Database management system
- JDBC - Database connectivity
- Bootstrap 5 - CSS framework for responsive design
- Font Awesome 6 - Icon library
- JavaScript/jQuery - Client-side interactivity
- JSP/JSTL - Server-side templating
- Apache Tomcat 9.0+ - Application server
- MySQL Connector/J - Database driver
- Java Util Logging - Application logging
forum-app/
βββ src/
β βββ main/
β β βββ java/com/forum/
β β β βββ config/ # Database configuration
β β β βββ dao/ # Data Access Objects
β β β βββ filter/ # Security and request filters
β β β βββ listener/ # Application event listeners
β β β βββ model/ # Data models and entities
β β β βββ service/ # Business logic layer
β β β βββ servlet/ # Web controllers
β β β βββ util/ # Utility classes
β β β βββ webservice/ # REST API endpoints
β β βββ resources/ # Configuration files
β β βββ webapp/
β β βββ WEB-INF/
β β β βββ jsp/ # JSP pages and templates
β β β βββ web.xml # Web application configuration
β β βββ css/ # Custom stylesheets
β β βββ js/ # JavaScript files
β β βββ images/ # Static image assets
β βββ test/ # Unit and integration tests
βββ database_schema.sql # Database creation script
βββ deploy.sh # Automated deployment script
βββ pom.xml # Maven project configuration
βββ INSTALLATION_GUIDE.md # Comprehensive installation guide
βββ USER_GUIDE.md # Complete user documentation
βββ README.md # This file
-- Create database and user
CREATE DATABASE forum_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'forum_user'@'localhost' IDENTIFIED BY 'forum_password_2025';
GRANT ALL PRIVILEGES ON forum_db.* TO 'forum_user'@'localhost';
FLUSH PRIVILEGES;
-- Import schema
mysql -u forum_user -p forum_db < database_schema.sqlThe application uses a normalized database schema with the following main entities:
- users - User accounts and authentication
- topics - Forum discussion topics
- comments - Comments on topics
- replies - Replies to comments
For detailed schema information, see database_schema.sql.
Update database settings in src/main/java/com/forum/config/DatabaseConfig.java:
private static final String DATABASE_URL = "jdbc:mysql://localhost:3306/forum_db";
private static final String DATABASE_USERNAME = "forum_user";
private static final String DATABASE_PASSWORD = "forum_password_2025";Configuration options in src/main/resources/application.properties:
db.url=jdbc:mysql://localhost:3306/forum_db
db.username=forum_user
db.password=forum_password_2025
app.name=Forum Application
log.level=INFOUse the provided deployment script for quick and reliable deployments:
./deploy.sh # Full deployment with restart
./deploy.sh --no-restart # Deploy without restarting Tomcat
./deploy.sh --logs-only # View logs onlyFor manual control over the deployment process:
mvn clean compile package
rm -rf $CATALINA_HOME/webapps/forum-app*
cp target/forum-app.war $CATALINA_HOME/webapps/
$CATALINA_HOME/bin/catalina.sh restart- IntelliJ IDEA: Configure Tomcat server in Run Configurations
- Eclipse: Use Server adapter for Tomcat deployment
- VS Code: Use Java Extension Pack with Tomcat integration
The application provides RESTful API endpoints for integration:
GET /api/users # List all users
POST /api/users # Create new user
GET /api/users/{id} # Get user details
PUT /api/users/{id} # Update user
DELETE /api/users/{id} # Delete user
GET /api/topics # List all topics
POST /api/topics # Create new topic
GET /api/topics/{id} # Get topic details
PUT /api/topics/{id} # Update topic
DELETE /api/topics/{id} # Delete topic
GET /api/comments # Get comments for topic
POST /api/comments # Create new comment
PUT /api/comments/{id} # Update comment
DELETE /api/comments/{id} # Delete comment
For complete API documentation, visit: http://localhost:8080/forum-app/api
# Run all tests
mvn test
# Run specific test class
mvn test -Dtest=UserServiceTest
# Run tests with coverage report
mvn test jacoco:report- Unit Tests: Test individual components and methods
- Integration Tests: Test database operations and services
- Web Tests: Test servlet functionality and HTTP responses
- Password Hashing: BCrypt hashing for secure password storage
- Input Validation: Server-side validation for all user inputs
- SQL Injection Prevention: Parameterized queries throughout
- Session Management: Secure session handling with configurable timeouts
- CSRF Protection: Form token validation for state-changing operations
- XSS Prevention: Input sanitization and output encoding
Session timeout and security settings in web.xml:
<session-config>
<session-timeout>30</session-timeout>
<cookie-config>
<http-only>true</http-only>
<secure>false</secure>
</cookie-config>
</session-config>- Proper indexing on frequently queried columns
- Connection pooling for efficient database usage
- Query optimization with prepared statements
- Efficient DAO pattern implementation
- Proper resource management (connection closing)
- Optimized JSP rendering with minimal inline Java
# JVM Settings for production
export CATALINA_OPTS="-Xms512m -Xmx2048m -XX:PermSize=256m"
# Database connection pool settings
maxTotal="20" maxIdle="10" maxWaitMillis="10000"# Clear Maven cache
mvn dependency:purge-local-repository
# Rebuild with debug info
mvn clean compile package -X# Test database connectivity
mysql -u forum_user -p forum_db -e "SELECT 1;"
# Check connection string format
jdbc:mysql://localhost:3306/forum_db?useSSL=false&serverTimezone=UTC# Check Tomcat logs
tail -f $CATALINA_HOME/logs/catalina.out
# Verify WAR file integrity
jar -tf target/forum-app.war | head -20For detailed troubleshooting, see the Installation Guide.
- Documentation: Comprehensive JavaDoc for all public methods
- Naming Conventions: Follow Java naming standards
- Error Handling: Proper exception handling throughout
- Code Organization: Clear separation of concerns (MVC pattern)
- Testing: Unit tests for business logic components
- Follow existing code style and conventions
- Write comprehensive tests for new features
- Update documentation for any interface changes
- Ensure all tests pass before submitting changes
- Use meaningful commit messages
- Database Backup: Schedule regular backups
- Log Rotation: Implement log file rotation
- Security Updates: Keep dependencies updated
- Performance Monitoring: Monitor application metrics
# Database backup
mysqldump -u forum_user -p forum_db > forum_backup_$(date +%Y%m%d).sql
# Application backup
tar -czf forum_app_backup_$(date +%Y%m%d).tar.gz .- Application logs:
$CATALINA_HOME/logs/ - Database performance: MySQL slow query log
- User activity: Application activity logs
- System resources: Memory and CPU usage
- Course: Advanced Java Programming (ITHCA0)
- Institution: Eduvos
- Assessment: Project 1 - Distributed Applications
- Submission Date: June 13, 2025
- Academic Year: 2025
This application is developed as an academic project for educational purposes. It demonstrates:
- Advanced Java programming concepts
- Web application development with servlets and JSP
- Database design and integration
- RESTful web service implementation
- Modern web UI development practices
This project is created for educational purposes and demonstrates original work developed specifically for Advanced Java Programming course requirements. All code and documentation represent original implementation following academic integrity guidelines.
Developer: Simphiwe Radebe
Institution: Eduvos
Course: Advanced Java Programming (ITHCA0)
For technical questions about this project, please refer to:
- Installation Guide for setup issues
- User Guide for usage questions
- Source code documentation for implementation details
Last Updated: June 13, 2025
Version: 1.0.0
Status: Production Ready
This README provides a comprehensive overview of the Forum Application. For detailed setup instructions, see the Installation Guide. For usage instructions, see the User Guide.