Skip to Content
Stack Overview

Stack Overview

CardNexus is a multi-platform trading card inventory and sales management system built as a Turborepo monorepo.

Backend

TechnologyPurpose
Node.jsΒ  + TypeScriptΒ Runtime & Language
ExpressΒ HTTP Server
oRPCΒ Contract-first API framework
MongoDBΒ  + MongooseΒ Database & ODM
TSyringeΒ Dependency Injection
VitestΒ Testing
BiomeΒ Linting & Formatting

Key Patterns

  • Layered Architecture: Handlers β†’ Features β†’ Domains β†’ Views β†’ Foundation
  • Contract-First API: Define schemas in @repo/api-dtos, implement in @repo/api
  • Result Pattern: Services return Result<T, E> using neverthrowΒ 
  • Event-Driven: Domain events for cross-cutting concerns

See the Backend Introduction for detailed architecture documentation.

Frontend

TechnologyPurpose
Next.js 15Β React Framework (App Router)
Tailwind CSSΒ Styling
JotaiΒ State Management
TanStack QueryΒ Server State
ZodΒ Validation
ClerkΒ Authentication

Key Patterns

  • Atomic Design: Component architecture principles
  • Type-Safe API: oRPC client with full type inference
  • Form Atoms: jotai-formΒ  for form state

Mobile

TechnologyPurpose
React NativeΒ  + ExpoΒ Framework
NativeWindΒ Styling (Tailwind for RN)
JotaiΒ State Management
DrizzleΒ  + SQLiteLocal Database

Key Patterns

  • Atomic File Organization: queries.ts, mutations.ts, ui.ts, effects.ts
  • Offline-First: SQLite for local persistence
  • Template-Based Creation: Mutation atoms for inventory management

Infrastructure

ServicePlatform
FrontendVercelΒ 
BackendAWS ECSΒ 
DatabaseMongoDB AtlasΒ 
SearchOpenSearchΒ 
QueuesAWS SQSΒ 
StorageAWS S3Β 
Background JobsTrigger.devΒ 
Mobile BuildsEASΒ 

Local Development Stack

Docker Compose provides these services locally:

ServicePortPurpose
MongoDB27017Database
LocalStack4566AWS services (SQS, SNS, S3)
OpenSearch9200Search engine

Monorepo Structure

/cardnexus β”œβ”€β”€ apps/ β”‚ β”œβ”€β”€ frontend/ # Next.js web app (port 4200) β”‚ β”œβ”€β”€ backend/ # Express API server (port 3000) β”‚ β”œβ”€β”€ mobile/ # React Native app β”‚ β”œβ”€β”€ admin/ # Vite admin app β”‚ └── cli/ # oclif CLI tool β”œβ”€β”€ packages/ β”‚ β”œβ”€β”€ api/ # oRPC handlers β”‚ β”œβ”€β”€ api-dtos/ # oRPC contracts (schemas) β”‚ β”œβ”€β”€ db/ # Mongoose models β”‚ β”œβ”€β”€ ui/ # Shared UI components β”‚ └── ...

We use WallabyJSΒ  locally to speed up testing - highly recommended.

Last updated on