{"id":32843984,"url":"https://github.com/azizbekdevuz/trainium","last_synced_at":"2026-04-02T13:13:35.116Z","repository":{"id":321381099,"uuid":"1085532350","full_name":"azizbekdevuz/trainium","owner":"azizbekdevuz","description":"TRAINIUM - This a NextJS turborepo app including web app and socket server offering the client pages and admin pages offering the modern and user friendly design.","archived":false,"fork":false,"pushed_at":"2025-11-05T15:06:13.000Z","size":22628,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-05T16:24:42.008Z","etag":null,"topics":["nextjs","nodejs","postgresql","prisma","socket","socket-io","socketio-client","socketio-server","tailwindcss","typescript"],"latest_commit_sha":null,"homepage":"https://trainium.shop","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/azizbekdevuz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-29T07:02:59.000Z","updated_at":"2025-11-05T15:06:17.000Z","dependencies_parsed_at":"2025-10-29T11:35:31.405Z","dependency_job_id":null,"html_url":"https://github.com/azizbekdevuz/trainium","commit_stats":null,"previous_names":["azizbekdevuz/trainium"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/azizbekdevuz/trainium","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azizbekdevuz%2Ftrainium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azizbekdevuz%2Ftrainium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azizbekdevuz%2Ftrainium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azizbekdevuz%2Ftrainium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azizbekdevuz","download_url":"https://codeload.github.com/azizbekdevuz/trainium/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azizbekdevuz%2Ftrainium/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283307727,"owners_count":26814472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-08T02:00:06.281Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nextjs","nodejs","postgresql","prisma","socket","socket-io","socketio-client","socketio-server","tailwindcss","typescript"],"created_at":"2025-11-08T06:00:55.917Z","updated_at":"2026-04-02T13:13:35.102Z","avatar_url":"https://github.com/azizbekdevuz.png","language":"TypeScript","readme":"# Trainium E-Commerce Platform\n\nA 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.\n\n## 🏗️ Architecture\n\nFor a comprehensive overview of the system architecture, design patterns, and implementation details, see the [Architecture Documentation](./architecture.md).\n\n## ✨ Features\n\n- **E-Commerce Core**\n  - Product catalog with variants, categories, and inventory management\n  - Shopping cart with guest and authenticated user support\n  - Multi-provider payment processing (Stripe, Toss Payments)\n  - Order management and tracking\n  - Product recommendations engine\n\n- **User Management**\n  - Multi-provider authentication (Google, Kakao, Email/Password)\n  - Role-based access control (Admin, Staff, Customer)\n  - User profiles and account management\n\n- **Real-Time Features**\n  - Socket.IO-based notification system\n  - Real-time order updates\n  - Product alerts and system notifications\n\n- **Admin Panel**\n  - Dashboard with analytics and statistics\n  - Product, order, and customer management\n  - Category and FAQ management\n  - Low stock alerts and inventory tracking\n\n- **Social Features**\n  - Product reviews and ratings\n  - Favorites and likes\n  - Review replies and interactions\n\n- **Internationalization**\n  - Multi-language support (English, Korean, Uzbek)\n  - URL-based locale routing\n  - Translated email notifications\n\n- **Presentation \u0026 UX**\n  - Design-token CSS (globals plus `styles/glass.css`, `components.css`, `admin.css`) with light/dark theming\n  - Glass-morphism surfaces, consistent overlays via portals, scroll-reveal and heading motion helpers\n  - **Desktop**: interactive background with a cursor-driven blob (Framer Motion). **Touch / coarse pointer**: CSS-only ambient layer (no scroll-bound motion) and lighter blur on nav and cards for smoother scrolling\n\n## 🛠️ Tech Stack\n\n- **Frontend**: Next.js 15.5, React 19, TypeScript, Tailwind CSS, Framer Motion (UI/background motion)\n- **Backend**: Next.js API Routes, Express.js\n- **Database**: PostgreSQL with Prisma ORM\n- **Authentication**: NextAuth.js 5.0\n- **Real-Time**: Socket.IO\n- **Payments**: Stripe, Toss Payments\n- **Email**: Resend\n- **Build System**: Turbo (Monorepo)\n- **Package Manager**: pnpm\n\n## 📁 Project Structure\n\n```\ntrainium/\n├── apps/\n│   ├── web/              # Next.js web application (see architecture.md for src layout: styles/, motion/, ui/, …)\n│   └── socket/            # Socket.IO server\n├── prisma/                # Database schema\n├── scripts/               # Build and utility scripts\n└── architecture.md        # Architecture documentation\n```\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- Node.js 18+ \n- pnpm 9.0.6+\n- PostgreSQL database\n- Docker (optional, for containerized deployment)\n\n### Installation\n\n1. Clone the repository:\n```bash\ngit clone \u003crepository-url\u003e\ncd trainium\n```\n\n2. Install dependencies:\n```bash\npnpm install\n```\n\n3. Set up environment variables:\n```bash\ncp .env.example .env\n# Edit .env with your configuration\n```\n\nRequired environment variables:\n- `DATABASE_URL`: PostgreSQL connection string\n- `AUTH_SECRET`: NextAuth secret key\n- `GOOGLE_CLIENT_ID` / `GOOGLE_CLIENT_SECRET`: Google OAuth credentials\n- `KAKAO_CLIENT_ID` / `KAKAO_CLIENT_SECRET`: Kakao OAuth credentials\n- `STRIPE_SECRET_KEY` / `NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY`: Stripe credentials\n- `TOSS_CLIENT_KEY` / `TOSS_SECRET_KEY`: Toss Payments credentials\n- `RESEND_API_KEY`: Resend email service key\n- `NEXTAUTH_URL`: Application URL\n- `SOCKET_SERVER_URL`: Socket server URL for server-side HTTP calls (required in production)\n- `NEXT_PUBLIC_SOCKET_URL`: Socket server URL for client WebSocket connections\n- `SOCKET_ADMIN_SECRET`: Socket server admin secret (X-Admin-Secret header)\n\n### Docker Deployment\n\n**Important Security Note**: Environment variables are handled securely:\n- `.env` files are NOT copied into Docker images\n- Build-time variables (`NEXT_PUBLIC_*`) are passed via build args\n- Runtime variables are loaded via `env_file` in docker-compose\n\n**Building with Docker Compose:**\n\n1. Ensure your `.env` file exists in the project root with all required variables\n2. Build and start services:\n   ```bash\n   docker-compose up -d --build\n   ```\n\n4. Set up the database:\n```bash\n# Generate Prisma client\npnpm --filter @apps/web prisma:generate\n\n# Push schema (or run migrations)\npnpm --filter @apps/web prisma:push\n\n# Optional: seed database\npnpm --filter @apps/web seed\n```\n\n5. Start development servers:\n```bash\n# Start both web and socket servers\npnpm dev\n\n# Or start individually\npnpm dev:web      # Web app on http://localhost:3000\npnpm dev:socket   # Socket server on http://localhost:4000\n```\n\n## 📝 Available Scripts\n\n### Root Level\n- `pnpm dev` - Start all services in development mode\n- `pnpm build` - Build all applications\n- `pnpm start` - Start all services in production mode\n- `pnpm lint` - Lint all code\n- `pnpm typecheck` - Type check all TypeScript code\n\n### Web Application\n- `pnpm dev:web` - Start Next.js dev server (port 3000)\n- `pnpm start:web` - Start Next.js production server\n- `pnpm --filter @apps/web prisma:studio` - Open Prisma Studio\n- `pnpm --filter @apps/web test` - Run Vitest tests\n\n### Socket Server\n- `pnpm dev:socket` - Start Socket.IO server (port 4000)\n- `pnpm start:socket` - Start Socket.IO server in production\n\n## 🐳 Docker Deployment\n\nThe project includes Docker configuration for containerized deployment:\n\n```bash\n# Build and start all services\ndocker-compose up -d\n\n# View logs\ndocker-compose logs -f\n\n# Stop services\ndocker-compose down\n```\n\n## 📚 Documentation\n\n- **[Architecture Documentation](./architecture.md)** - System architecture, design patterns, implementation details\n- **[Prisma Schema](./prisma/schema.prisma)** - Database schema and models\n- **[Contributing](./CONTRIBUTING.md)** - How to contribute, development workflow, coding standards\n- **[Code of Conduct](./CODE_OF_CONDUCT.md)** - Community standards and expectations\n- **[Security Policy](./SECURITY.md)** - How to report security vulnerabilities\n\n## 🔐 Authentication\n\nThe platform supports multiple authentication methods:\n- **Google OAuth**: Social login via Google\n- **Kakao OAuth**: Korean social login\n- **Email/Password**: Traditional credentials authentication\n\nAll authentication is handled via NextAuth.js with JWT session strategy. Admin routes and API endpoints are protected via `requireAdminSession()`; the first admin account is created via `/admin/auth/signup` when no admin exists (bootstrap).\n\n## 💳 Payment Processing\n\nThe platform integrates with two payment providers:\n- **Stripe**: International payment processing\n- **Toss Payments**: Korean payment gateway\n\nBoth providers support multiple currencies and handle zero-decimal currencies (KRW, JPY, VND) correctly.\n\n## 🌐 Internationalization\n\nThe platform supports three languages:\n- English (en) - Default\n- Korean (ko)\n- Uzbek (uz)\n\nLocale routing is URL-based (`/en/...`, `/ko/...`, `/uz/...`) with cookie-based preference storage.\n\n## 📧 Email Notifications\n\nEmail notifications are sent via Resend for:\n- Order confirmations\n- Order status updates\n- Shipping notifications\n\n## 🔔 Real-Time Notifications\n\nThe platform includes a real-time notification system powered by Socket.IO:\n- User-specific notifications\n- Order update notifications\n- Product alerts\n- System-wide announcements\n- Deduplication and read sync between DB and socket events\n\n## 🧪 Development\n\n### Code Structure\n- **Components**: Reusable React components in `apps/web/src/components/` (feature folders, `ui/`, `motion/`, `background/`, etc.)\n- **Styles**: Shared CSS in `apps/web/src/styles/`; global tokens and imports in `apps/web/src/app/globals.css`\n- **API Routes**: Next.js API routes in `apps/web/src/app/api/`\n- **Business Logic**: Core logic in `apps/web/src/lib/`\n- **Types**: TypeScript definitions in `apps/web/src/types/`\n\n### Database Management\n```bash\n# Open Prisma Studio\npnpm --filter @apps/web prisma:studio\n\n# Generate ERD diagram (requires Mermaid CLI; use WSL on Windows)\nnode scripts/generate-erd.js\n```\n\n### CI (GitHub Actions)\n\nOn push/PR to `main`, the workflow runs: lint (web + socket), typecheck (web), and tests (web). No build step (sitemap generation requires a live DB).\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.\n\n## 🤝 Contributing\n\nContributions are welcome! Please read our [Contributing Guidelines](./CONTRIBUTING.md) and [Code of Conduct](./CODE_OF_CONDUCT.md) before submitting a pull request. Use our [issue templates](.github/ISSUE_TEMPLATE/) and [pull request template](.github/PULL_REQUEST_TEMPLATE.md) when opening issues and PRs.\n\n## 📞 Support\n\nFor questions and discussions, use [GitHub Discussions](https://github.com/azizbekdevuz/trainium/discussions). For security issues, see [SECURITY.md](./SECURITY.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazizbekdevuz%2Ftrainium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazizbekdevuz%2Ftrainium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazizbekdevuz%2Ftrainium/lists"}