A secure messaging application built with Spring Boot, featuring user authentication, message management, and a modern web interface.
-
User Authentication & Authorization
- JWT-based authentication system
- User registration and login
- Role-based access control (Admin/User)
- Secure logout functionality
-
Messaging System
- Send and receive messages between users
- Message inbox with read/unread status
- Message threading and organization
- Real-time message delivery
-
User Management
- User profile management
- Admin dashboard for user administration
- User search and listing capabilities
- Profile updates and modifications
-
Modern Web Interface
- Responsive HTML/CSS design
- Interactive JavaScript functionality
- Clean and intuitive user experience
- Cross-browser compatibility
- Backend: Spring Boot 3.3.1, Java 22
- Database: PostgreSQL with JPA/Hibernate
- Security: JWT (JSON Web Tokens)
- Frontend: HTML5, CSS3, JavaScripts
- Build Tool: Maven
- Validation: Bean Validation API
- Utilities: Lombok, ModelMapper
Before running this application, make sure you have the following installed:
- Java 22 (JDK 22)
- Maven 3.6+
- PostgreSQL 12+
- Git
- Install PostgreSQL on your system
- Create a new database:
CREATE DATABASE burak;
- Create a user (optional, you can use existing user):
CREATE USER burak WITH PASSWORD 'your_password'; GRANT ALL PRIVILEGES ON DATABASE burak TO burak;
-
Clone the repository:
git clone <your-repository-url> cd hw2
-
Update database configuration in
src/main/resources/application.properties:spring.datasource.url=jdbc:postgresql://localhost:5432/burak spring.datasource.username=burak spring.datasource.password=your_password
-
Customize application settings (optional):
# Server port (default: 8080) server.port=8080 # JWT secret key jwt.secret=your_jwt_secret_key # Hibernate DDL mode spring.jpa.hibernate.ddl-auto=update
# Make sure you're in the project root directory
./mvnw spring-boot:run# Clean and compile
mvn clean compile
# Run the application
mvn spring-boot:run- Open the project in your preferred IDE (IntelliJ IDEA, Eclipse, VS Code)
- Run the
Hw2Application.javamain class
Once the application is running, you can access it at:
- Main Application: http://localhost:8080
- Login Page: http://localhost:8080/login.html
- User Dashboard: http://localhost:8080/user-dashboard.html
- Admin Dashboard: http://localhost:8080/admin-dashboard.html
POST /users/login- User loginGET /users/logout- User logout
GET /users- List all users (Admin only)POST /users- Create new userPUT /users/{id}- Update userDELETE /users/{id}- Delete user (Admin only)
GET /messages- Get user messagesPOST /messages- Send new messagePUT /messages/{id}/read- Mark message as read
- Send and receive messages
- View personal inbox
- Update profile information
- Access user dashboard
- All regular user privileges
- Manage all users in the system
- Access admin dashboard
- Delete users and messages
- JWT Authentication: Secure token-based authentication
- Password Validation: Strong password requirements
- Input Validation: Comprehensive input sanitization
- Role-based Access Control: Secure endpoint access
- Session Management: Proper token lifecycle management
- 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