How christyjohn/vilka_mvp works
This repo is a small microservice-style B2C platform split into three independently runnable Spring Boot applications: identity, marketplace (catalog), and subscription. Each service has its own pom.xml, Maven wrapper, application entry point, configuration, tests, and Flyway migrations, so they can be built and deployed separately.
The identity service is the user/account boundary. It owns authentication (AuthController, AuthService), user management (UserController, UserService), profiles, addresses, and countries. It also contains JWT support, Spring Security configuration, a custom user details service, and an internal API-key filter, which suggests it serves both public auth flows and protected internal service calls.
The marketplace service is the catalog boundary. Its only domain shown is offering, with a standard controller-service-repository-entity stack for offering lifecycle operations. It also has its own security configuration, which means it is a protected domain service rather than a public shared library.
The subscription service is the orchestration boundary. It owns subscription data and business logic, but it also depends on external services through Feign clients: MarketplaceClient and UserClient. That makes it the main integration point that validates or enriches subscription operations using catalog and identity data.
Across all three services, the internal structure is consistent: controllers expose HTTP APIs, services contain business rules, repositories handle persistence, entities map to database tables, DTOs shape request/response payloads, and mappers convert between layers. This makes the codebase easy to diagram as repeated vertical slices per bounded context.
Persistence is relational and migration-driven. Each service has src/main/resources/db/migration with versioned SQL scripts, indicating Flyway-managed schema evolution. Entities such as User, Profile, Address, Country, OfferingEntity, and Subscription are the source of truth for each service’s database model.
The main data flow in identity is: authentication requests come into AuthController, user/account state is managed through service and repository layers, and JWT-related utilities are used to secure downstream requests. The presence of InternalUserController and InternalApiKeyFilter indicates separate internal endpoints for other services to call without using the public auth flow.
The main data flow in subscription is: SubscriptionController accepts subscription requests, SubscriptionService coordinates local persistence plus remote lookups through Feign, and the service stores subscription state in its own database. This service therefore bridges local transactional state with remote dependency checks.
Security is service-local rather than centralized. Each app has its own SecurityConfig, and the subscription and marketplace services also expose SecurityUtils, likely for extracting the authenticated principal or claims from the security context. The architecture suggests JWT-based authentication established in identity and consumed by the other services.
Common platform code is repeated inside each service, not shared as a separate module. The shared patterns include ApiException, ErrorCode, ErrorResponse, GlobalExceptionHandler, and StartupTimer. These provide consistent error handling and startup instrumentation across services.
At a high level, the system boundary looks like this: identity owns who the user is, marketplace owns what can be subscribed to, and subscription owns the relationship between a user and an offering. The important cross-service dependency arrows are subscription -> identity and subscription -> marketplace; the other services do not appear to depend on each other directly.
Main entry points: SubscriptionApplication.java Subscription App · IdentityApplication.java Identity App · SubscriptionService.java Subscription Core · MarketplaceApplication.java Marketplace App
Components 18
Identity
User and account boundary
- Identity App · Identity service entry point
identity/src/main/java/com/vilka/app/identity/IdentityApplication.java - Auth API · Login, registration, password reset, token issuance
identity/src/main/java/com/vilka/app/identity/auth - User API · Users, profiles, addresses, and countries
identity/src/main/java/com/vilka/app/identity/user - Security · Spring Security, JWT utilities, internal API-key filter
identity/src/main/java/com/vilka/app/identity/auth/security - Identity Store · Entity mappings and Flyway-managed schema
identity/src/main/java/com/vilka/app/identity/common/base/entity/BaseEntity.java - Shared Common · Exception model, global handler, startup timing
identity/src/main/java/com/vilka/app/identity/common
Marketplace
Catalog boundary
- Marketplace App · Catalog service entry point
marketplace/src/main/java/com/vilka/app/catalog/MarketplaceApplication.java - Offering API · Offering lifecycle operations
marketplace/src/main/java/com/vilka/app/catalog/offering - Security · Service-local security and principal helpers
marketplace/src/main/java/com/vilka/app/catalog/common/config/SecurityConfig.java - Catalog Store · Offering entity persistence and schema migration
marketplace/src/main/java/com/vilka/app/catalog/offering/entity/OfferingEntity.java - Shared Common · Exception handling and startup timing
marketplace/src/main/java/com/vilka/app/catalog/common
Subscription
Orchestration boundary
- Subscription App · Subscription service entry point
subscription/src/main/java/com/vilka/app/subscription/SubscriptionApplication.java - Subscription API · Subscription request/response boundary
subscription/src/main/java/com/vilka/app/subscription/controller - Subscription Core · Subscription business logic and local persistence
subscription/src/main/java/com/vilka/app/subscription/service/SubscriptionService.java - Feign Clients · Remote lookups against catalog and identity
subscription/src/main/java/com/vilka/app/subscription/client - Security · Service-local security and principal helpers
subscription/src/main/java/com/vilka/app/subscription/common/config/security/SecurityConfig.java - Subscription Store · Subscription entity persistence and schema migration
subscription/src/main/java/com/vilka/app/subscription/entity/Subscription.java - Shared Common · Exception handling and startup timing
subscription/src/main/java/com/vilka/app/subscription/common
Connections 26
- Identity App → Auth API: hosts · Bootstraps public authentication flows
- Identity App → User API: hosts · Bootstraps account management APIs
- Identity App → Security: configures · Installs JWT and internal access controls
- Identity App → Identity Store: persists · Owns the identity database model
- Identity App → Shared Common: uses · Shares error handling and startup utilities
- Auth API → Security: authenticates · Login and token issuance depend on security components
- User API → Identity Store: stores · Users, profiles, addresses, and countries are persisted here
- Marketplace App → Offering API: hosts · Bootstraps catalog APIs
- Marketplace App → Security: configures · Protects catalog endpoints
- Marketplace App → Catalog Store: persists · Owns catalog schema and data
- Marketplace App → Shared Common: uses · Shares error handling and startup utilities
- Offering API → Catalog Store: stores · Offering operations write through repository layer
- Offering API → Security: guards · Relies on service-local security context
- Subscription App → Subscription API: hosts · Bootstraps subscription APIs
- Subscription App → Subscription Core: runs · Wires subscription orchestration
- Subscription App → Feign Clients: connects · Configures remote service clients
- Subscription App → Security: configures · Protects subscription endpoints
- Subscription App → Subscription Store: persists · Owns subscription database state
- Subscription App → Shared Common: uses · Shares error handling and startup utilities
- Subscription API → Subscription Core: delegates · HTTP requests flow into business logic
- Subscription Core → Feign Clients: validates · Checks catalog and user data remotely
- Subscription Core → Subscription Store: stores · Subscription records are saved locally
- Subscription Core → Security: reads context · Uses security helpers for caller identity
- Feign Clients → Offering API: calls · Looks up offerings in marketplace
- Feign Clients → User API: calls · Looks up users in identity
- Security → Auth API: supports · JWT and API-key support public and internal auth flows