How manoharsamvel24/digital-store works
Purpose and Runtime
This is a server-rendered digital-product store. A Java Spring Boot application runs Spring MVC, Spring Data JPA/Hibernate, Thymeleaf templates, and embedded Tomcat; MySQL is the persistence service. Products represent downloadable eBooks, music, photography, and software.
Entry point: src/main/java/com/app/digital_store/DigitalStoreApplication.java. Runtime configuration is in src/main/resources/application.properties.
HTTP Presentation Layer
Controllers own browser/API request routing and select the user/admin views:
• src/main/java/com/app/digital_store/controller/LoginController.java
• src/main/java/com/app/digital_store/controller/ApiController.java
Thymeleaf pages form the primary UI boundary, including registration/login, catalog/welcome, purchase, download, and admin flows:
• src/main/resources/templates/login.html
• src/main/resources/templates/buyProduct.html
• src/main/resources/templates/admin.html
ApiController is the REST-oriented boundary for clients such as Postman, while the login controller supports the server-rendered journey.
Identity, Sessions, and Admin Boundary
Users register and authenticate through the controller/service/repository stack. The domain user model carries the persisted account and download-related state:
• src/main/java/com/app/digital_store/entity/User.java
• src/main/java/com/app/digital_store/service/UserService.java
• src/main/java/com/app/digital_store/repository/UserRepository.java
Admin authentication/session state is separately handled by src/main/java/com/app/digital_store/config/AdminSessionManager.java. This establishes a privileged boundary around administration rather than exposing dashboard operations publicly.
Product Catalog and Management
Products are typed domain records, accessed through a service boundary over JPA repositories:
• src/main/java/com/app/digital_store/entity/Product.java
• src/main/java/com/app/digital_store/entity/ProductType.java
• src/main/java/com/app/digital_store/service/ProductService.java
• src/main/java/com/app/digital_store/repository/ProductRepository.java
The expected flow is catalog/category browsing → product selection → purchase/download page. Admin operations add, delete, search, and inspect catalog/user records through the same persistence-backed domain.
Purchase and Download Flow
A user selects one product per transaction, submits simulated payment credentials, reaches a success state, and receives the corresponding asset. Successful transactions update the user’s download count in MySQL. Key UI stages are:
• src/main/resources/templates/buyProduct.html
• src/main/resources/templates/paymentSuccess.html
• src/main/resources/templates/downloadPage.html
Payment is application-local simulation using account number and PIN; no external payment gateway is identified.
Static Asset Delivery and Bootstrap Data
Downloadable files are packaged as static Spring resources and served directly by the application:
• src/main/resources/static/downloads/ebook
• src/main/resources/static/downloads/music
• src/main/resources/static/downloads/software
src/main/java/com/app/digital_store/config/ProductSeeder.java initializes product/catalog data, coupling persisted product metadata to these packaged download assets. This makes deployment artifact contents part of the product-delivery boundary.
Components 15
HTTP Presentation
- Browser
- API Clients · Clients such as Postman use the REST boundary.
- Login Controller
src/main/java/com/app/digital_store/controller/LoginController.java - API Controller
src/main/java/com/app/digital_store/controller/ApiController.java - Store & Admin Views · Login, catalog, purchase, success, download, and admin pages.
- Admin Session Manager · Separates authenticated administration from public operations.
src/main/java/com/app/digital_store/config/AdminSessionManager.java
Domain Services
- User Service
src/main/java/com/app/digital_store/service/UserService.java - Product Service · Handles typed product catalog and management operations.
src/main/java/com/app/digital_store/service/ProductService.java - Purchase & Download Flow · Simulates payment, records successful downloads, and exposes the purchased asset.
src/main/resources/templates/paymentSuccess.html
Persistence
- User Repository
src/main/java/com/app/digital_store/repository/UserRepository.java - Product Repository
src/main/java/com/app/digital_store/repository/ProductRepository.java - MySQL · Persists users, download state, and product catalog metadata.
Product Delivery
- Product Seeder · Initializes catalog metadata for packaged download assets.
src/main/java/com/app/digital_store/config/ProductSeeder.java - Packaged Downloads · eBook, music, and software files served by the application.
src/main/resources/static/downloads/ebook
Other components
- Spring Boot Store Runtime · Server-rendered application runtime with JPA, Thymeleaf, and static resource delivery.
src/main/java/com/app/digital_store/DigitalStoreApplication.java
Connections 20
- Browser → Spring Boot Store Runtime: HTTP requests
- API Clients → API Controller: REST requests
- Spring Boot Store Runtime → Login Controller: routes MVC requests
- Spring Boot Store Runtime → API Controller: routes API requests
- Login Controller → Store & Admin Views: renders
- API Controller → Store & Admin Views: selects store/admin views
- API Controller → Admin Session Manager: checks admin session
- Login Controller → User Service: registration & authentication
- API Controller → User Service: user operations
- API Controller → Product Service: catalog & admin operations
- Store & Admin Views → Purchase & Download Flow: purchase journey
- Purchase & Download Flow → User Service: updates download count
- Purchase & Download Flow → Packaged Downloads: delivers selected asset
- User Service → User Repository: persists users
- Product Service → Product Repository: persists catalog
- User Repository → MySQL: JPA/Hibernate
- Product Repository → MySQL: JPA/Hibernate
- Product Seeder → Product Repository: seeds product metadata
- Product Seeder → Packaged Downloads: maps metadata to assets
- Spring Boot Store Runtime → Packaged Downloads: serves static files