A modern, full-stack e-commerce platform built for selling high-tech fitness equipment. Trainium features a comprehensive product catalog, shopping cart, checkout system, real-time notifications, and an admin panel for managing all aspects of the business.
For a comprehensive overview of the system architecture, design patterns, and implementation details, see the Architecture Documentation.
-
E-Commerce Core
- Product catalog with variants, categories, and inventory management
- Shopping cart with guest and authenticated user support
- Multi-provider payment processing (Stripe, Toss Payments)
- Order management and tracking
- Product recommendations engine
-
User Management
- Multi-provider authentication (Google, Kakao, Email/Password)
- Role-based access control (Admin, Staff, Customer)
- User profiles and account management
-
Real-Time Features
- Socket.IO-based notification system
- Real-time order updates
- Product alerts and system notifications
-
Admin Panel
- Dashboard with analytics and statistics
- Product, order, and customer management
- Category and FAQ management
- Low stock alerts and inventory tracking
-
Social Features
- Product reviews and ratings
- Favorites and likes
- Review replies and interactions
-
Internationalization
- Multi-language support (English, Korean, Uzbek)
- URL-based locale routing
- Translated email notifications
- Frontend: Next.js 15.5, React 19, TypeScript, Tailwind CSS
- Backend: Next.js API Routes, Express.js
- Database: PostgreSQL with Prisma ORM
- Authentication: NextAuth.js 5.0
- Real-Time: Socket.IO
- Payments: Stripe, Toss Payments
- Email: Resend
- Build System: Turbo (Monorepo)
- Package Manager: pnpm
trainium/
βββ apps/
β βββ web/ # Next.js web application
β βββ socket/ # Socket.IO server
βββ apps/packages/
β βββ shared/ # Shared utilities
β βββ tsconfig/ # Shared TypeScript configs
βββ prisma/ # Database schema
βββ scripts/ # Build scripts
βββ architecture.md # Architecture documentation
- Node.js 18+
- pnpm 9.0.6+
- PostgreSQL database
- Docker (optional, for containerized deployment)
- Clone the repository:
git clone <repository-url>
cd trainium- Install dependencies:
pnpm install- Set up environment variables:
cp .env.example .env
# Edit .env with your configurationRequired environment variables:
DATABASE_URL: PostgreSQL connection stringAUTH_SECRET: NextAuth secret keyGOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRET: Google OAuth credentialsKAKAO_CLIENT_ID/KAKAO_CLIENT_SECRET: Kakao OAuth credentialsSTRIPE_SECRET_KEY/NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: Stripe credentialsTOSS_CLIENT_KEY/TOSS_SECRET_KEY: Toss Payments credentialsRESEND_API_KEY: Resend email service keyNEXTAUTH_URL: Application URLSOCKET_ADMIN_SECRET: Socket server admin secret
Important Security Note: Environment variables are handled securely:
.envfiles are NOT copied into Docker images- Build-time variables (
NEXT_PUBLIC_*) are passed via build args - Runtime variables are loaded via
env_filein docker-compose
Building with Docker Compose:
-
Ensure your
.envfile exists in the project root with all required variables -
Build and start services:
docker-compose up -d --build
-
Set up the database:
# Generate Prisma client
pnpm --filter @apps/web prisma:generate
# Run migrations (or push schema)
pnpm --filter @apps/web prisma:push- Start development servers:
# Start both web and socket servers
pnpm dev
# Or start individually
pnpm dev:web # Web app on http://localhost:3000
pnpm dev:socket # Socket server on http://localhost:4000pnpm dev- Start all services in development modepnpm build- Build all applicationspnpm start- Start all services in production modepnpm lint- Lint all codepnpm typecheck- Type check all TypeScript code
pnpm dev:web- Start Next.js dev serverpnpm start:web- Start Next.js production serverpnpm --filter @apps/web prisma:studio- Open Prisma Studio
pnpm dev:socket- Start Socket.IO serverpnpm start:socket- Start Socket.IO server in production
The project includes Docker configuration for containerized deployment:
# Build and start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down- Architecture Documentation - Comprehensive system architecture, design patterns, and implementation details
- Prisma Schema - Database schema and models
The platform supports multiple authentication methods:
- Google OAuth: Social login via Google
- Kakao OAuth: Korean social login
- Email/Password: Traditional credentials authentication
All authentication is handled via NextAuth.js with JWT session strategy.
The platform integrates with two payment providers:
- Stripe: International payment processing
- Toss Payments: Korean payment gateway
Both providers support multiple currencies and handle zero-decimal currencies (KRW, JPY, VND) correctly.
The platform supports three languages:
- English (en) - Default
- Korean (ko)
- Uzbek (uz)
Locale routing is URL-based (/en/..., /ko/..., /uz/...) with cookie-based preference storage.
Email notifications are sent via Resend for:
- Order confirmations
- Order status updates
- Shipping notifications
The platform includes a real-time notification system powered by Socket.IO:
- User-specific notifications
- Order update notifications
- Product alerts
- System-wide announcements
- Components: Reusable React components in
apps/web/src/components/ - API Routes: Next.js API routes in
apps/web/src/app/api/ - Business Logic: Core logic in
apps/web/src/lib/ - Types: TypeScript definitions in
apps/web/src/types/
# Open Prisma Studio
pnpm --filter @apps/web prisma:studio
# Generate ERD diagram
pnpm erd:generateMIT License
[I will update soon]
[Refer to my GitHub profile links for contact and support]