Enterprise Warehouse Management Platform. Portfolio-Grade University Project.
StockSphere is a modern Modular Monolith designed for high-performance transactional warehouse management operations, real-time inventory tracking, and predictive replenishment using AI.
- Core Backend: Node.js 22 + Fastify + TypeScript + Drizzle ORM
- Frontend: Next.js 16 + React + TypeScript + TailwindCSS + shadcn/ui + TanStack (Query, Table, Form) + Zod
- Databases & Cache: PostgreSQL (Transactional) + TimescaleDB (Time-Series Logs) + Redis (Cache & Queue)
- Object Storage: MinIO (S3-compatible Document Storage)
- AI Engine: Python FastAPI + Prophet + XGBoost + Pandas
- DevOps: Docker Compose + OrbStack + GitHub Actions
Ensure you have the following installed on your machine (Optimized for macOS / Apple Silicon):
- Node.js:
v22.0.0or higher - pnpm:
v10.0.0or higher - Docker / OrbStack
- Python:
v3.10or higher (withpiporuvpackage manager)
Clone the repository and install the workspace dependencies from the root directory:
pnpm installInitialize the environment file from the template:
cp .env.example .envEnsure database credentials inside .env align with your local configurations (the default parameters are set up out-of-the-box for the Docker Compose stack).
Start the backing services using Docker Compose:
pnpm db:upThis launches isolated containers for PostgreSQL, TimescaleDB, Redis, and MinIO.
Execute scripts from the root directory to run, build, or verify the monorepo:
| Script | Command | Description |
|---|---|---|
| dev | pnpm dev |
Starts server and web development servers concurrently |
| build | pnpm build |
Compiles typescript-configs, schemas, and applications in build order |
| lint | pnpm lint |
Audits lint formatting rules via ESLint Flat Configuration |
| typecheck | pnpm typecheck |
Checks type-safety validation across all packages (no emit) |
| test | pnpm test |
Executes all Vitest suites |
| test:watch | pnpm test:watch |
Runs Vitest suite in watch/interactive mode |
| format | pnpm format |
Prettifies the workspace code using Prettier rules |
.
├── apps/
│ ├── web/ # Next.js 16 Client App
│ ├── server/ # Core Fastify Monolith (Backend)
│ └── ai/ # Python FastAPI Forecasting Engine
├── packages/ # Shared packages & configurations
│ ├── typescript-config/ # Centralized tsconfig configurations
│ └── validation-schemas/ # Common Zod validations & shared TS interfaces
├── docs/ # Architecture, ADRs, database, and API specifications
├── docker/ # Docker Compose definitions
└── .github/ # CI/CD Workflows
StockSphere is structured as a Modular Monolith. Follow these conventions strictly to maintain system clean architecture:
- Module Boundaries: Do NOT perform direct imports between modules (e.g.
apps/server/src/modules/ordersmust never import anything fromapps/server/src/modules/inventory). - Module Communication:
- For Synchronous operations, modules must execute operations through public Facades registered via Dependency Injection.
- For Asynchronous operations, utilize the internal transactional Outbox / Event Bus.
- Layer Separation: Clean Architecture must be followed within modules. Decouple domain models from Drizzle schemas. Keep ORM code strictly inside the
infrastructure/repositories/folder.