Movie Streaming App with Spring Boot & Thymeleaf
🎬 Movie Streaming App with Spring Boot & Thymeleaf
Quick Preview: A comprehensive movie streaming platform that combines movie information management with video streaming capabilities, built using Spring Boot backend and Thymeleaf templating engine.
🎯 Project Overview
This full-stack movie streaming application demonstrates modern Java web development practices using Spring Boot. The application features a robust backend API for movie information management and streaming services, coupled with a dynamic frontend built with Thymeleaf templates for an engaging user experience.
⚡ Key Features
- 🎭 Movie Information API: Comprehensive movie database with detailed information
- 📺 Video Streaming: Built-in streaming capabilities for movie playback
- 🔍 Search & Discovery: Advanced search and filtering for movies
- 📱 Responsive Design: Mobile-friendly interface with Thymeleaf templates
- 🛡️ Secure Backend: Spring Security integration for user authentication
🔍 Click to see detailed technical implementation
🛠️ Technical Architecture
Backend Stack
- Spring Boot 2.7+ - Main application framework
- Spring MVC - Web layer and REST API endpoints
- Spring Data JPA - Data persistence and repository layer
- Spring Security - Authentication and authorization
- H2 Database - In-memory database for development
- Maven - Dependency management and build tool
Frontend Stack
- Thymeleaf - Server-side templating engine
- Bootstrap - Responsive CSS framework
- JavaScript - Client-side interactivity
- HTML5 Video - Native video streaming support
Key Components
// Example Movie Entity
@Entity
@Table(name = "movies")
public class Movie {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String title;
@Column(length = 1000)
private String description;
private String genre;
private Integer releaseYear;
private Double rating;
private String posterUrl;
private String videoUrl;
// Constructors, getters, and setters
}
// Movie Controller for API endpoints
@RestController
@RequestMapping("/api/movies")
public class MovieApiController {
@Autowired
private MovieService movieService;
@GetMapping
public ResponseEntity<List<Movie>> getAllMovies() {
List<Movie> movies = movieService.findAll();
return ResponseEntity.ok(movies);
}
@GetMapping("/{id}")
public ResponseEntity<Movie> getMovieById(@PathVariable Long id) {
Movie movie = movieService.findById(id);
return ResponseEntity.ok(movie);
}
@GetMapping("/search")
public ResponseEntity<List<Movie>> searchMovies(@RequestParam String query) {
List<Movie> movies = movieService.searchByTitle(query);
return ResponseEntity.ok(movies);
}
}
🎨 Frontend Features
Thymeleaf Templates
- Dynamic Content Rendering: Server-side template processing
- Fragment Reusability: Modular template components
- Form Handling: Seamless form submission and validation
- Conditional Rendering: Dynamic UI based on data state
User Interface Components
-
Movie Catalog
- Grid layout with movie posters
- Hover effects and movie details
- Pagination for large movie collections
- Category-based filtering
-
Movie Details Page
- Comprehensive movie information display
- Embedded video player
- User ratings and reviews
- Related movies suggestions
-
Search Functionality
- Real-time search suggestions
- Advanced filtering options
- Search result highlighting
- Search history tracking
-
Video Streaming
- HTML5 video player integration
- Multiple video quality options
- Playback controls and progress tracking
- Fullscreen and theater mode
🔧 API Endpoints
Movie Information API
GET /api/movies
- Retrieve all moviesGET /api/movies/{id}
- Get specific movie detailsGET /api/movies/search?query={term}
- Search movies by titleGET /api/movies/genre/{genre}
- Filter movies by genrePOST /api/movies
- Add new movie (admin)PUT /api/movies/{id}
- Update movie information (admin)DELETE /api/movies/{id}
- Remove movie (admin)
Streaming API
GET /api/stream/{movieId}
- Get streaming URLGET /api/stream/{movieId}/qualities
- Available quality optionsPOST /api/stream/progress
- Update viewing progress
🚀 Performance Features
- Caching: Spring Cache for frequently accessed data
- Lazy Loading: Efficient data loading strategies
- Connection Pooling: Optimized database connections
- Static Resource Optimization: Compressed CSS/JS assets
🛡️ Security Implementation
- Authentication: User login and registration
- Authorization: Role-based access control
- CSRF Protection: Cross-site request forgery prevention
- Input Validation: Server-side data validation
🚀 Getting Started
Prerequisites
- Java 11 or higher
- Maven 3.6+
- Git
Installation Steps
-
Clone the Repository:
git clone https://github.com/amrelharti/movapp.git cd movapp
-
Build the Application:
mvn clean install
-
Run the Application:
mvn spring-boot:run
-
Access the Application:
- Open your browser and navigate to
http://localhost:8080
- The H2 database console is available at
http://localhost:8080/h2-console
- Open your browser and navigate to
🔗 Project Links
- 📂 GitHub Repository - Complete source code and documentation
- 📖 Spring Boot Documentation - Framework documentation
- 🎨 Thymeleaf Guide - Templating engine documentation
🎯 Technical Skills Demonstrated
✅ Spring Boot Framework - Modern Java web development
✅ RESTful API Design - Clean and scalable API architecture
✅ Thymeleaf Templating - Server-side rendering and dynamic content
✅ Database Integration - JPA/Hibernate for data persistence
✅ Security Implementation - Authentication and authorization
✅ Full Stack Development - End-to-end application development
🔮 Future Enhancements
- User Profiles: Personal watchlists and viewing history
- Recommendation Engine: AI-powered movie suggestions
- Social Features: User reviews and ratings system
- Mobile App: Native mobile application development
- Microservices: Break down into microservice architecture
- Cloud Deployment: AWS/Azure deployment with CDN integration
Interested in Spring Boot development or building streaming applications? Let’s discuss how modern Java frameworks can power your next web application!