How acodev/olddash works
1. Overall shape
- This is a single Next.js application using the App Router.
- The app combines UI pages, API routes, and server-side business logic in one codebase rather than splitting into separate frontend/backend services.
- The main architectural boundary is src/app for routes and src/lib for domain logic, with src/components for reusable UI.
2. Presentation layer
- User-facing screens live under src/app/*/page.tsx for areas like dashboard, billing, revenue, users, groups, packager, profile, login, password reset, and auger management.
- Most pages are thin route shells that compose feature components from src/components/*.
- Shared layout and navigation are centralized in src/app/layout.tsx and sidebar/nav components.
3. API layer
- All server endpoints are implemented as Next.js route handlers under src/app/api/**/route.ts.
- The API surface is broad and domain-oriented: projects, users, groups, payment methods, payments, reports, revenue, product images/types, package downloads, skin validation, auth flows, and auger operations.
- These handlers are the main ingress for client actions and likely call into src/lib/* services or Prisma.
4. Data persistence
- Prisma is the database layer, with the schema in prisma/schema.prisma and the client wrapper in src/lib/prisma.ts.
- This suggests a relational database-backed app where most entities such as users, projects, payment methods, invites, groups, and reports are stored centrally.
- The API routes and feature components likely read/write through Prisma rather than directly accessing external storage.
5. Authentication and session model
- Authentication is handled through NextAuth in src/app/api/auth/[...nextauth]/route.ts and src/lib/auth.ts.
- Session state is propagated to the client via src/components/providers/SessionProvider.tsx and general providers in Providers.tsx.
- Access control is enforced in the UI with PermissionGuard, NoAccessState, and hooks like useSession and usePermissions.
6. Core business domains
- The repository is organized around several operational domains:
- Projects and available products
- Users, invites, and groups
- Billing and payment methods
- Revenue and payment reporting
- Auger management/status/submissions
- Packager creation and downloads
- Skin validation
- This is not a generic CRUD app; it appears to be an internal operations platform for managing digital products, payments, and partner access.
7. Packager subsystem
- Packaging logic is isolated in src/lib/packager/** with separate builders for addon, skinpack, and world artifacts.
- Each builder has templates and helper libraries for tasks like crypto, image processing, mapping, UUID generation, token handling, placeholder substitution, and zipping.
- Built packages are exposed as downloadable assets from public/packages/**, and package download is served through src/app/api/download-package/**.
- The presence of many ZIP files under public/packages/skinpack indicates the app also serves prebuilt distributable artifacts, not just generated ones.
8. Payment and billing flow
- Payment-related functionality centers on payment-methods, billing, and payments/wise-batch.
- src/lib/paymentService.ts and src/lib/revenueService.ts likely encapsulate the accounting/business logic used by the payment and revenue endpoints.
- src/app/api/reports/payments/send-email indicates reporting can be exported or notified via email, making email part of the financial workflow.
9. Auger integration
- Auger-related code lives in src/lib/augerService.ts, src/other/auger/*, and multiple API/page routes for projects, submissions, management, and status.
- The repo contains marketplace metadata files such as genre, price tier, tags, and submission modal config, suggesting the app supports structured marketplace submission workflows.
- This looks like an external platform integration with a dedicated admin/ops surface inside the app.
10. Content and media utilities
- product-images, product-types, and validate-skin form a media/content validation area.
- The custom SkinValidator components and MinecraftSkinViewer suggest visual inspection and validation are part of the workflow, not just file storage.
- Static resources and generated files are split between public/ and UI components.
11. Reusable UI and interaction layer
- Most UI primitives come from src/components/ui/*, with feature-specific composites like tables, charts, forms, dropzones, and management views.
- The app uses a modern component-driven client layer, including shared navigation, tables, dialogs, calendars, charts, and toast/alert patterns.
- Responsive behavior is supported by hooks like use-mobile and debouncing utilities.
12. Important architectural boundaries for a diagram
- Draw the system as one Next.js application with three main internal zones:
- Route/UI layer in src/app
- Server/API and domain services in src/app/api and src/lib
- Shared client components in src/components
- External dependencies to show are the database via Prisma, authentication via NextAuth, email/payment-related integrations, and any Auger/Wise workflows.
- Static downloadable artifacts under public/packages are a separate asset boundary from live generated packager logic.
Main entry points: PackagerClient.tsx Feature views · index.ts Packager engine · auth.ts Auth logic · prisma.ts Prisma client
Components 25
App Router
Next.js pages, layouts, and route handlers
- Root shell · Global layout, landing entry, and app providers
src/app/layout.tsx - Screens · Dashboard, billing, users, revenue, packager, profile, login, and admin screens
src/app - API routes · All server endpoints under src/app/api
src/app/api - Auth routes · Login, forgot/reset password, invite accept, and NextAuth handler
src/app/api/auth/[...nextauth]/route.ts - Projects API · Projects, available products, sync, and project details
src/app/api/projects - People API · Users, invites, partner groups, and permissions-related endpoints
src/app/api/users - Finance API · Billing, payment methods, wise batch payments, revenue, and reports
src/app/api/payment-methods - Packager API · Package generation and download endpoints
src/app/api/packager/route.ts - Media checks · Product images, product types, and skin validation endpoints
src/app/api/validate-skin/route.ts - Auger API · Auger projects, submissions, status, and management flows
src/app/api/auger-projects/route.ts
Shared UI
Reusable client components and hooks
- Nav shell · Sidebar, header, navigation, and layout chrome
src/components/app-sidebar.tsx - Feature views · Management tables, billing forms, revenue views, packager client, and auger screens
src/components/PackagerClient.tsx - Auth UI · Login, forgot-password, permission guard, no-access state, and session provider
src/components/providers/SessionProvider.tsx - UI primitives · Reusable tables, dialogs, charts, inputs, alerts, and other base components
src/components/ui
Server Domain
Auth, persistence, business services, and packager logic
- Auth logic · Session and access control logic used by routes and UI
src/lib/auth.ts - Prisma client · Database wrapper and schema-backed persistence layer
src/lib/prisma.ts - Finance services · Payment and revenue workflows used by finance endpoints
src/lib/paymentService.ts - Packager engine · Addon, skinpack, and world packaging builders plus helper libraries
src/lib/packager/index.ts - Skin validator · Skin layout and validation helpers for content checks
src/lib/validator/index.ts - Auger service · Auger-specific coordination and external workflow logic
src/lib/augerService.ts
External Boundaries
Database, email, payment, and marketplace integrations
- Database · Relational datastore defined by Prisma schema
prisma/schema.prisma - Email · Outbound email for reports and password reset workflows
src/lib/mail.ts - Wise batch · Batch payment workflow and Wise CSV artifact
src/other/Wise/bacth_paymentsWise.csv - Package assets · Prebuilt downloadable package files served from public/packages
public/packages/skinpack - Auger platform · Marketplace and submission destination for Auger integrations
src/other/auger/marketplaceTags.ts
Connections 28
- Root shell → Nav shell: uses · Global chrome and navigation
- Root shell → Auth UI: wraps · Providers and session context
- Screens → Feature views: composes · Route pages are mostly feature shells
- Screens → UI primitives: renders · Pages rely on shared UI primitives
- API routes → Prisma client: reads/writes · API handlers persist through Prisma
- API routes → Auth logic: authenticates · Protected endpoints use NextAuth/session logic
- Auth routes → Auth logic: implements · Auth route handlers are backed by auth config
- Auth routes → Email: sends · Password reset and auth notifications
- Projects API → Prisma client: queries · Project and product data access
- People API → Prisma client: queries · Users, invites, and groups data
- Finance API → Finance services: delegates · Billing, payments, and revenue workflows
- Finance API → Wise batch: exports · Wise batch payment output
- Finance API → Email: emails · Financial report notifications
- Packager API → Packager engine: builds · Generates distributable packages
- Packager API → Package assets: serves · Downloads static and generated artifacts
- Media checks → Skin validator: validates · Skin and media checks
- Auger API → Auger service: coordinates · Auger admin and submission flows
- Auth logic → Database: stores sessions/users · Auth state depends on persisted identity data
- Prisma client → Database: connects · Primary relational database boundary
- Finance services → Database: reads/writes · Accounting records and payment state
- Packager engine → Package assets: outputs · Built artifacts land alongside public package files
- Packager engine → Skin validator: uses · Packaging may validate content/assets
- Auger service → Auger platform: integrates · External marketplace/submission platform
- Auth UI → Auth logic: consumes · Client auth state and permissions
- Feature views → Finance services: calls · Feature screens trigger finance workflows
- Feature views → Packager engine: calls · Packager UI invokes generation flow
- Feature views → Auger service: calls · Auger management views use integration service
- UI primitives → Feature views: supports · Reusable tables, charts, dialogs, and inputs