|
| 1 | +# 🏆 Product Inventory Management |
| 2 | + |
| 3 | +<p align="center"> |
| 4 | + <img src="docs/screenshots/frontend.png" alt="Prodcut Inventory" width="100%" /> |
| 5 | + <br> |
| 6 | + <i>Product Inventory Manager - http://62.72.6.16:3000</i> |
| 7 | +</p> |
| 8 | + |
| 9 | +<p align="center"> |
| 10 | + <img src="docs/screenshots/workflow.png" alt="Github CI/CD Pipeline" width="100%" /> |
| 11 | + <br> |
| 12 | + <i>GitHub CI/CD Pipeline</i> |
| 13 | +</p> |
| 14 | + |
| 15 | +## 🖥️ Backend: Serverless REST API (AWS) |
| 16 | + |
| 17 | +### 📂 Project Structure |
| 18 | + |
| 19 | +``` |
| 20 | +backend/ |
| 21 | + package.json |
| 22 | + serverless.yml |
| 23 | + tsconfig.json |
| 24 | + webpack.config.js |
| 25 | + scripts/ |
| 26 | + src/ |
| 27 | + config/ |
| 28 | + index.ts |
| 29 | + handlers/ |
| 30 | + auth/ |
| 31 | + authorizer.ts |
| 32 | + getCurrentUser.ts |
| 33 | + signIn.ts |
| 34 | + signUp.ts |
| 35 | + items/ |
| 36 | + all.ts |
| 37 | + create.ts |
| 38 | + delete.ts |
| 39 | + get.ts |
| 40 | + list.ts |
| 41 | + update.ts |
| 42 | + libs/ |
| 43 | + apiGateway.ts |
| 44 | + dynamoDB.ts |
| 45 | + types/ |
| 46 | + auth.ts |
| 47 | + item.ts |
| 48 | + utils/ |
| 49 | + dynamodb.ts |
| 50 | + tests/ |
| 51 | +``` |
| 52 | + |
| 53 | +### 🚀 Tech Stack & Architecture |
| 54 | + |
| 55 | +- **Node.js + TypeScript** |
| 56 | +- **Serverless Framework** for Infrastructure as Code (IAC) |
| 57 | +- **AWS Lambda** functions for each CRUD operation |
| 58 | +- **AWS API Gateway** for RESTful endpoints |
| 59 | +- **AWS DynamoDB** for persistent storage |
| 60 | +- **AWS Cognito** for secure authentication (sign up, sign in, user management) |
| 61 | +- **Multi-stage deployments**: dev & prod environments |
| 62 | +- **CI/CD**: Designed for integration with GitHub Actions, AWS CodePipeline, or Serverless Pro CI/CD (auto-deploy on master branch push) |
| 63 | +- **YAML organization**: Clean, modular `serverless.yml` with resources, outputs, and function definitions |
| 64 | + |
| 65 | +### 🛠️ Features |
| 66 | + |
| 67 | +- **CRUD Lambdas**: |
| 68 | + - Create, Read (single & all), Update, Delete items |
| 69 | + - No direct API Gateway → DynamoDB proxy; all logic in Lambda |
| 70 | + - Endpoints:<br/> |
| 71 | + GET - https://byit9b38a0.execute-api.us-west-1.amazonaws.com/dev/items/all<br/> |
| 72 | + POST - https://byit9b38a0.execute-api.us-west-1.amazonaws.com/dev/auth/signup<br/> |
| 73 | + POST - https://byit9b38a0.execute-api.us-west-1.amazonaws.com/dev/auth/signin<br/> |
| 74 | + GET - https://byit9b38a0.execute-api.us-west-1.amazonaws.com/dev/auth/me<br/> |
| 75 | + POST - https://byit9b38a0.execute-api.us-west-1.amazonaws.com/dev/items<br/> |
| 76 | + GET - https://byit9b38a0.execute-api.us-west-1.amazonaws.com/dev/items/{id}<br/> |
| 77 | + GET - https://byit9b38a0.execute-api.us-west-1.amazonaws.com/dev/items<br/> |
| 78 | + PUT - https://byit9b38a0.execute-api.us-west-1.amazonaws.com/dev/items/{id}<br/> |
| 79 | + DELETE - https://byit9b38a0.execute-api.us-west-1.amazonaws.com/dev/items/{id}<br/> |
| 80 | +- **Authentication**: |
| 81 | + - Cognito User Pool & Client for user management |
| 82 | + - Custom authorizer Lambda for protected routes |
| 83 | +- **Automated Infrastructure**: |
| 84 | + - DynamoDB table creation |
| 85 | + - Cognito resources provisioned via IAC |
| 86 | +- **Extensible**: |
| 87 | + - Easily add more resources or functions |
| 88 | + - IAM roles scoped for least privilege |
| 89 | +- **Testing**: |
| 90 | + - Structure supports unit/integration tests (see `/tests` folder) |
| 91 | + |
| 92 | +### 🧑💻 Developer Experience |
| 93 | + |
| 94 | +- **Frequent commits** for traceable progress |
| 95 | +- **Documented template** for easy onboarding |
| 96 | +- **Video walkthrough** (Loom) for code, IAC, and deployment explanation |
| 97 | +- **Optional scripts** for deployment and packaging |
| 98 | + |
| 99 | +--- |
| 100 | + |
| 101 | +## 🌐 Frontend: React Application |
| 102 | + |
| 103 | +### 📂 Project Structure |
| 104 | + |
| 105 | +``` |
| 106 | +frontend/ |
| 107 | + public/ |
| 108 | + index.html |
| 109 | + src/ |
| 110 | + App.tsx |
| 111 | + declarations.d.ts |
| 112 | + index.css |
| 113 | + index.tsx |
| 114 | + material-tailwind.d.ts |
| 115 | + assets/ |
| 116 | + svg/ |
| 117 | + check.svg |
| 118 | + close.svg |
| 119 | + error.svg |
| 120 | + logout.svg |
| 121 | + refresh.svg |
| 122 | + components/ |
| 123 | + Dashboard.tsx |
| 124 | + ItemForm.tsx |
| 125 | + ItemList.tsx |
| 126 | + LoadingSpinner.tsx |
| 127 | + Modal.tsx |
| 128 | + ProductCard.tsx |
| 129 | + SignInForm.tsx |
| 130 | + SignUpForm.tsx |
| 131 | + config/ |
| 132 | + index.ts |
| 133 | + contexts/ |
| 134 | + AuthContext.tsx |
| 135 | + services/ |
| 136 | + api.ts |
| 137 | + auth.ts |
| 138 | + types/ |
| 139 | + auth.ts |
| 140 | + item.ts |
| 141 | + eslint.config.js |
| 142 | + package.json |
| 143 | + postcss.config.js |
| 144 | + tailwind.config.js |
| 145 | + tsconfig.json |
| 146 | + webpack.config.js |
| 147 | +``` |
| 148 | + |
| 149 | +### ⚛️ Tech Stack & Architecture |
| 150 | + |
| 151 | +- **React + TypeScript** |
| 152 | +- **Tailwind CSS** for modern, responsive design |
| 153 | +- **Webpack** for bundling |
| 154 | +- **Context API** for authentication state |
| 155 | +- **Service layer** for API communication |
| 156 | + |
| 157 | +### 🎨 Features |
| 158 | + |
| 159 | +- **Full CRUD UI**: |
| 160 | + - Create, Read, Update, Delete items via backend API |
| 161 | +- **Authentication**: |
| 162 | + - Sign up, sign in, protected routes (dashboard, item management) |
| 163 | + - Auth context for user state |
| 164 | +- **Modern Design**: |
| 165 | + - Tailwind CSS for clean, professional look |
| 166 | + - SVG icons for visual feedback (✔️, ❌, 🔄, etc.) |
| 167 | +- **Responsive**: |
| 168 | + - Adapts to 4+ device sizes (mobile, tablet, desktop, large screens) |
| 169 | +- **Component-based**: |
| 170 | + - Dashboard, ItemForm, ItemList, Modal, ProductCard, LoadingSpinner, etc. |
| 171 | +- **Deployment-ready**: |
| 172 | + - Flexible deployment options (Netlify, Vercel, S3, etc.) |
| 173 | + - Entry point URL to be provided |
| 174 | + |
| 175 | +### 🧑💻 Developer Experience |
| 176 | + |
| 177 | +- **TypeScript types** for safety |
| 178 | +- **Organized assets** (SVGs, CSS, config) |
| 179 | +- **Easy API integration** via service layer |
| 180 | +- **Extensible for business cases** (custom item fields, user roles, etc.) |
| 181 | + |
| 182 | +--- |
| 183 | + |
| 184 | +## 📦 CI/CD & Automation |
| 185 | + |
| 186 | +- **Multi-stage pipeline**: dev & prod |
| 187 | +- **Auto-deploy on master push** |
| 188 | +- **Screenshots & documentation** for setup |
| 189 | +- **Supports GitHub Actions, AWS CodePipeline, Serverless Pro CI/CD** |
| 190 | + |
| 191 | +--- |
| 192 | + |
| 193 | +## 🔒 Security & Best Practices |
| 194 | + |
| 195 | +- **AWS Cognito** for secure user management |
| 196 | +- **Protected API routes** |
| 197 | +- **IAM roles with least privilege** |
| 198 | +- **No direct DynamoDB proxy from API Gateway** |
| 199 | + |
| 200 | +--- |
0 commit comments