VertexChain is a decentralized geospatial social platform combining social curation, mapping, and on-chain ownership via Soroban smart contracts on the Stellar network.
┌─────────────────────────────────────────────────────────────────────┐
│ VertexChain Platform │
├─────────────────┬─────────────────────┬─────────────────────────────┤
│ Frontend │ Backend API │ Blockchain │
│ (Next.js) │ (NestJS) │ (Soroban/Stellar) │
│ │ │ │
│ • Map View │ • REST/GraphQL │ • Gist Registry Contract │
│ • Social Feed │ • Auth/Sessions │ • Gist Token Contract │
│ • Wallet Mgmt │ • Geo Queries │ • On-chain Metadata │
│ • Analytics │ • IPFS Integration │ │
└─────────────────┴─────────────────────┴─────────────────────────────┘
│ │ │
│ │ │
▼ ▼ ▼
┌─────────────────┬─────────────────────┬─────────────────────────────┐
│ Infrastructure Layer (Docker / Kubernetes) │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌───────────────────┐ │
│ │ PostgreSQL│ │ Redis │ │Prometheus│ │ OpenTelemetry │ │
│ │ (PostGIS)│ │ Cache │ │Gateway │ │ Collector │ │
│ └──────────┘ └──────────┘ └──────────┘ └───────────────────┘ │
│ │ │ │ │ │ │
│ └────────────┴────────────┴──────────────┴──────────┘ │
│ Observability Stack │
└─────────────────────────────────────────────────────────────────────┘
| Layer | Technology | Purpose |
|---|---|---|
| Framework | Next.js 15 (App Router) | SSR, routing, API routes |
| UI | React 19, Tailwind CSS v4 | Component rendering |
| Mapping | Leaflet + React-Leaflet | Geospatial visualization |
| Blockchain | Wagmi, viem, React | Stellar wallet interaction |
| State | React hooks, TanStack Query | Client state management |
Key Pages:
- Map view with geospatial pins
- User profiles and social feeds
- Pin creation/editing workflow
- Analytics dashboard
| Layer | Technology | Purpose |
|---|---|---|
| Framework | NestJS 11 | Structured API architecture |
| ORM | TypeORM 0.3 | Database migrations, entities |
| Database | PostgreSQL + PostGIS | Geo-spatial queries |
| Auth | Session-based / JWT | User authentication |
| Blockchain | ethers.js v6 | Soroban contract interaction |
| Validation | class-validator | DTO validation pipeline |
Key Modules:
AuthModule- User authentication and sessionsPinsModule- Pin CRUD, geo-queriesUsersModule- User profiles and social graphBlockchainModule- Soroban contract callsAnalyticsModule- Metrics aggregationDatabaseModule- TypeORM configuration
PostgreSQL (PostGIS)
├── users # User accounts and profiles
├── pins # Geospatial pin data
│ └── geometry # PostGIS Point/Geometry columns
├── sessions # Auth sessions
├── gists # IPFS hash references
└── migrations # TypeORM migration history
Redis
├── Cache # API response caching
├── Rate Limit # Request throttling
└── Sessions # Session storage (optional)
IPFS
└── gist-content # Decentralized pin content storage
Stellar Network (Soroban)
├── gist_registry
│ ├── register_gist(metadata_hash, location)
│ ├── transfer_gist(gist_id, new_owner)
│ └── burn_gist(gist_id)
├── gist_token (Stellar Asset)
│ ├── mint(beneficiary, amount)
│ ├── transfer(from, to, amount)
│ └── balance_of(account)
└── Soroban RPC
└── Contract invocation & events
┌──────────────────────────────────────────────────────────────┐
│ Docker Compose / K8s │
├──────────────────┬───────────────────┬────────────────────────┤
│ backend │ frontend │ postgres │
│ (NestJS:3000) │ (Next.js:3001) │ (PostGIS:5432) │
│ │ │ │
│ ├── OpenTelemetry│ └── OTEL SDK │ └── PostGIS enabled │
│ └── Prom client │ │ │
├──────────────────┴───────────────────┴────────────────────────┤
│ Observability Stack │
├──────────────────┬───────────────────┬────────────────────────┤
│ otel-collector │ prometheus │ grafana │
│ (4317/4318) │ (9090) │ (3000) │
├──────────────────┼───────────────────┼────────────────────────┤
│ loki │ jaeger │ alertmanager │
│ (3100) │ (16686) │ (9093) │
└──────────────────┴───────────────────┴────────────────────────┘
Namespace: vertexchain
Deployments
├── backend (2-3 replicas, HPA)
├── analytics (2 replicas, HPA)
├── otel-collector (1-2 replicas)
├── prometheus (1 replica, StatefulSet)
├── loki (1 replica, StatefulSet)
└── jaeger (1 replica)
Services
├── backend-service (ClusterIP)
├── analytics-service (ClusterIP)
└── ingress (nginx-controller, TLS)
Secrets
├── database-credentials
├── stellar-keys
├── session-keys
└── ipfs-gateway-credentials
PVCs
├── postgresql-data
├── prometheus-data
└── loki-data
- Structured, opinionated framework for enterprise Node.js
- Built-in dependency injection, guards, interceptors
- TypeORM integration for database operations
- Swagger integration for API documentation
- App Router with React Server Components
- Excellent DX with Turbopack for dev
- Built-in image optimization and routing
- API routes for server-side operations
- PostGIS for geospatial queries (radius search, bounding boxes)
- Strong consistency for financial/social data
- Mature ecosystem and tooling
- Lower transaction fees vs Ethereum
- Rust-based smart contracts
- Built-in asset issuance (Stellar Asset)
- Environment sustainability focus
- OpenTelemetry for vendor-neutral instrumentation
- Prometheus for metrics and alerting
- Jaeger for distributed tracing
- Loki for log aggregation
- Grafana for unified dashboards
- Terraform for cloud infrastructure (VPC, EKS, RDS, etc.)
- Helm for Kubernetes application packaging
- Separation of concerns between platform and application
- Application metrics via Prometheus client and OTel exporter
- Infrastructure metrics via node-exporter
- SLI/SLO definitions tracked in alerts
- Auto-instrumentation for HTTP, database, blockchain calls
- Sample rate: 10% head-based, tail-based for errors/latency
- Trace context propagated across services
- Structured JSON logging in backend
- Filelog receiver for container logs
- Log-based alerting in Alertmanager
- Infrastructure overview
- API latency and error rates
- Database performance
- Blockchain transaction status
Application Layer
├── Input Validation (class-validator)
├── Rate Limiting (@nestjs/throttler)
├── CORS (configurable origins)
├── Helmet (security headers)
└── Session Management (secure, httpOnly cookies)
Infrastructure Layer
├── TLS termination (Ingress / ALB)
├── Network Policies (K8s)
├── RBAC (least-privilege)
├── Secrets Management (External Secrets Operator)
└── Vulnerability Scanning (CI security gates)
Data Layer
├── PostgreSQL: pgcrypto for sensitive columns
├── Encryption at rest (AWS RDS / EBS)
├── Backup encryption
└── Secrets: never in code, never in logs
- Backend: ~1000 RPS per instance with current configuration
- Frontend: Edge-cached, serves static assets
- Database: Read replicas for analytics-heavy workloads
- Backend: Stateless, scales behind load balancer
- Frontend: Stateless, multiple replicas
- Database: Streaming replication with hot standby
- PostGIS queries: Spatial indexes mitigate complexity
- Soroban RPC: Connection pooling required
- IPFS: Gateway rate limits; pinning service for reliability