# claude_code_warehouse **Repository Path**: mfary/claude_code_warehouse ## Basic Information - **Project Name**: claude_code_warehouse - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-02-16 - **Last Updated**: 2026-02-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Warehouse Management System (出入库管理系统) A comprehensive warehouse management system built with NestJS, Next.js, SQLite, and OAuth 2.0 authentication. ## Features - **Asset Management**: Full CRUD operations for warehouse assets - **Inbound Operations**: Track incoming inventory with approval workflows - **Outbound Operations**: Manage outgoing shipments with picking and shipping - **Role-Based Access Control**: Granular permissions for different user roles - **OAuth 2.0 Authentication**: Generic OAuth implementation for flexible provider support - **OpenAPI Documentation**: Auto-generated API documentation with Swagger - **Real-time Dashboard**: Overview of inventory status and pending operations ## Tech Stack ### Backend - **NestJS**: Progressive Node.js framework - **TypeORM**: ORM with SQLite database - **Passport**: Authentication middleware - **Swagger/OpenAPI**: API documentation ### Frontend - **Next.js 14**: React framework with App Router - **Ant Design**: Enterprise UI component library - **Zustand**: State management - **Axios**: HTTP client ## Project Structure ``` . ├── apps/ │ ├── backend/ # NestJS backend API │ └── frontend/ # Next.js frontend application ├── package.json # Root package with workspaces ├── pnpm-workspace.yaml # PNPM workspace configuration └── turbo.json # Turborepo configuration ``` ## Getting Started ### Prerequisites - Node.js >= 18.0.0 - PNPM >= 8.0.0 ### Installation 1. Clone the repository: ```bash git clone cd claude_auto_crm_with_teable_support ``` 2. Install dependencies: ```bash pnpm install ``` ### Configuration #### Backend Configuration Create `apps/backend/.env`: ```bash # Application NODE_ENV=development PORT=3001 API_PREFIX=api # Database DATABASE_TYPE=sqlite DATABASE_PATH=./data/warehouse.db # JWT JWT_SECRET=your-super-secret-jwt-key-change-in-production JWT_EXPIRES_IN=1h JWT_REFRESH_SECRET=your-refresh-token-secret JWT_REFRESH_EXPIRES_IN=7d # OAuth 2.0 OAUTH2_PROVIDER=generic OAUTH2_AUTHORIZATION_URL=https://your-oauth-provider.com/oauth/authorize OAUTH2_TOKEN_URL=https://your-oauth-provider.com/oauth/token OAUTH2_CLIENT_ID=your-client-id OAUTH2_CLIENT_SECRET=your-client-secret OAUTH2_CALLBACK_URL=http://localhost:3001/api/auth/oauth/callback OAUTH2_SCOPE=openid email profile # CORS CORS_ORIGIN=http://localhost:3000 # OpenAPI SWAGGER_ENABLED=true ``` #### Frontend Configuration Create `apps/frontend/.env.local`: ```bash NEXT_PUBLIC_API_URL=http://localhost:3001/api NEXT_PUBLIC_OAUTH_CLIENT_ID=your-client-id ``` ### Running the Application #### Development Mode Start both backend and frontend: ```bash pnpm dev ``` Or start individually: ```bash # Backend cd apps/backend pnpm run start:dev # Frontend (in another terminal) cd apps/frontend pnpm run dev ``` #### Production Build ```bash pnpm build ``` ## API Documentation Once the backend is running, visit: - Swagger UI: http://localhost:3001/api/docs ## Default User Roles | Role | Description | Permissions | |------|-------------|-------------| | **Admin** | Full system access | All permissions | | **Manager** | Asset management & approvals | asset:*, inbound:*, outbound:*, inventory:read | | **Operator** | Daily operations | inbound:create, outbound:create, inventory:read | | **Viewer** | Read-only access | All resources:read | ## Database Schema The application uses SQLite with the following main tables: - **users** - User accounts - **roles** - System roles - **permissions** - Granular permissions - **user_roles** - User-role assignments - **role_permissions** - Role-permission assignments - **assets** - Asset catalog - **inventory** - Stock levels - **inbound_requests** - Inbound orders - **outbound_requests** - Outbound orders - **workflows** - Processing workflows ## OAuth 2.0 Setup This system uses a generic OAuth 2.0 implementation that can work with various providers. To configure: 1. Set up your OAuth provider (Google, GitHub, Auth0, etc.) 2. Update the `.env` file with your provider's details: - `OAUTH2_AUTHORIZATION_URL` - `OAUTH2_TOKEN_URL` - `OAUTH2_CLIENT_ID` - `OAUTH2_CLIENT_SECRET` - `OAUTH2_CALLBACK_URL` For testing, you can use: - **Google**: https://console.cloud.google.com/ - **GitHub**: https://github.com/settings/developers - **Auth0**: https://auth0.com/ ## Development ### Backend Development ```bash cd apps/backend # Watch mode pnpm run start:dev # Debug mode pnpm run start:debug # Run tests pnpm run test # Run e2e tests pnpm run test:e2e ``` ### Frontend Development ```bash cd apps/frontend # Dev server pnpm run dev # Build for production pnpm run build # Start production server pnpm run start # Lint code pnpm run lint ``` ## License MIT ## Support For issues and questions, please open an issue on the repository.