StreamFlix is a comprehensive data processing system designed to manage a streaming platform's backend operations. It handles user accounts, profiles, subscriptions, media content (movies and series), viewing progress, and analytics. The system is built using a microservices-ready architecture with a Spring Boot API and a PostgreSQL database, fully containerized for easy deployment.
- Programming Language: Java 25 (Preview features enabled)
- Framework: Spring Boot 4.0.1 (Custom/Preview build)
- Database: PostgreSQL 16+
- Containerization: Docker & Docker Compose
- Authentication: Spring Security with JWT (JSON Web Tokens)
- API Documentation: OpenAPI 3.1 (Swagger UI)
- Build Tool: Maven
- External Integration: TMDB API (The Movie Database)
The system follows a layered architecture:
- Client Layer: Web-based frontend (HTML/JS) served by the backend.
- API Layer: Spring Boot REST Controllers handling HTTP requests.
- Service Layer: Business logic, transaction management, and external API integration.
- Data Access Layer: Spring Data JPA repositories interacting with PostgreSQL.
- Database: Relational database storing all persistent data.
Component Interactions:
- User interacts with the Web UI.
- Web UI sends REST requests to the API.
- API validates requests and calls Services.
- Services execute business logic and query the Database via Repositories.
- Database returns data, which flows back to the user.
- TMDB Service fetches external movie metadata when needed.
- Docker Desktop: Version 4.0+
- Java JDK: Version 25 (for local development)
- Maven: Version 3.9+ (optional, wrapper included)
- Git: For cloning the repository
git clone <repository-url>
cd Data-ProcessingThe system is pre-configured with default credentials in docker-compose.yml.
- Database User:
admin - Database Password:
admin123 - Database Name:
streamflix
The database is automatically initialized with schema and test data using scripts in the init-db/ directory when the Docker container starts.
docker-compose up --buildEnsure to create a .env file in the project root (next to docker-compose.yml) to avoid Docker Compose warnings:
use in git bash for example to generate token JWT_SECRET: openssl rand -base64 64
JWT_SECRET=change-me
TMDB_API_KEY=change-meWait for the logs to show "Started StreamflixApplication".
- Web Application: http://localhost:8080 or - Web Application: http://localhost:8080/index.html
- API Swagger UI: http://localhost:8080/swagger-ui.html
- Database Port:
5432(exposed for external tools)
Full API documentation is available via Swagger UI.
- URL: http://localhost:8080/swagger-ui.html
- Base URL:
/api/v1 - Authentication: Most endpoints require a Bearer Token.
- Register a user via
/api/v1/auth/register. - Login via
/api/v1/auth/loginto get a token. - Use the "Authorize" button in Swagger to enter the token:
Bearer <your-token>.
- Register a user via
You can connect to the database using tools like DataGrip or DBeaver.
- Host:
localhost - Port:
5432 - Database:
streamflix - User:
admin - Password:
admin123 - Driver: PostgreSQL
Data-Processing/
├── src/
│ ├── main/
│ │ ├── java/com/example/streamflix/ # Source code
│ │ │ ├── config/ # Security & App config
│ │ │ ├── controller/ # API Endpoints
│ │ │ ├── entity/ # JPA Entities
│ │ │ ├── model/ # DTOs
│ │ │ ├── repository/ # DB Access
│ │ │ ├── service/ # Business Logic
│ │ └── resources/
│ │ ├── static/ # Frontend assets (HTML/JS/CSS)
│ │ └── application.yml # App configuration
├── init-db/ # SQL scripts for DB init
├── Dockerfile # API container definition
├── docker-compose.yml # Orchestration config
└── pom.xml # Maven dependencies
Run unit tests using Maven:
./mvnw test- Start the application.
- Open Swagger UI.
- Create an account and login.
- Test endpoints like
GET /api/v1/mediato verify data retrieval.
- Docker Containerization:
Dockerfileanddocker-compose.ymlprovided. - API Implementation: Spring Boot REST API with CRUD operations.
- Database Design: 3NF PostgreSQL schema with Views, Triggers, and Procedures.
- Security: JWT Authentication and Role-Based Access Control.
- Documentation: OpenAPI/Swagger integration.
- No Direct DB Access: App uses API; API uses JPA.
- API User Account: Uses ORM (Spring Data JPA), so direct table access via
adminuser is permitted per assignment rules.
- Java 25: The project uses a very new Java version which might require specific IDE support.
- Student Name: [Your Name]
- Student Number: [Your Number]