{"id":23399548,"url":"https://github.com/bayajidalam/gentrandz","last_synced_at":"2026-04-11T05:04:47.014Z","repository":{"id":268772654,"uuid":"904066130","full_name":"BayajidAlam/GenTrandz","owner":"BayajidAlam","description":"GenTrandz is a scalable eCommerce platform built with Next.js and Node.js, supporting multiple roles (Customer, Seller, Admin etc). It features product management, order tracking, and payment processing. Docker is used for containerization, with PostgreSQL for storage and Redis for caching. Designed for scalability","archived":false,"fork":false,"pushed_at":"2024-12-24T09:09:52.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T15:46:19.185Z","etag":null,"topics":["ant-design","docker","expressjs","jwt","nextjs","nginx","nodejs","postgresql","prisma","redis","redux","socket-io","stripe","tailwind","typescript","zod"],"latest_commit_sha":null,"homepage":"","language":null,"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/BayajidAlam.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}},"created_at":"2024-12-16T07:31:59.000Z","updated_at":"2024-12-24T09:09:55.000Z","dependencies_parsed_at":"2024-12-18T20:36:45.724Z","dependency_job_id":"c99959db-699f-444c-96b9-76a70bd555cf","html_url":"https://github.com/BayajidAlam/GenTrandz","commit_stats":null,"previous_names":["bayajidalam/gentrandz"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BayajidAlam%2FGenTrandz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BayajidAlam%2FGenTrandz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BayajidAlam%2FGenTrandz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BayajidAlam%2FGenTrandz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BayajidAlam","download_url":"https://codeload.github.com/BayajidAlam/GenTrandz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247918940,"owners_count":21018043,"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","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":["ant-design","docker","expressjs","jwt","nextjs","nginx","nodejs","postgresql","prisma","redis","redux","socket-io","stripe","tailwind","typescript","zod"],"created_at":"2024-12-22T10:14:39.350Z","updated_at":"2025-12-30T18:59:42.038Z","avatar_url":"https://github.com/BayajidAlam.png","language":null,"funding_links":["https://www.paypal.com"],"categories":[],"sub_categories":[],"readme":"## GenTrandz: A Scalable and Modern Multi-Vendor eCommerce Platform\n## Table of Contents\n\n- [Project Overview](#project-overview)\n- [System Design](#system-design)\n- [Data Model Design](#data-mode-design)\n- [Architecture Overview](#architecture-overview)\n- [Technology Stack](#technology-stack)\n- [User Interface](#user-interface)\n\n## Project Overview\n\nWelcome to GenTrandz, an innovative multi-vendor eCommerce platform designed to simplify business and management operations. I have successfully developed the MVP (Minimum Viable Product), which covers the core functionalities required for our initial launch. Currently, I am focusing on extending the platform by developing advanced features for the Admin and Super Admin roles to enhance control and scalability\n\n\n## System Design\n\nThe system should meet the following requirements:\n\n### Functional requirements\n\nI will design the system for five diffrent role Customer, Sells Manager, Seller, Admin, Super Admin\n\n**Customers**\n\n- Buy, wishlist, or report product\n- Checkout cart\n- View,search and filter products\n- Make and Track Order\n- Read blogs\n- Contact with supports or chat with sales manager\n- Take the help of map to navigate towards shop\n\n**Sells Manager**\n\n- Create Product\n- Edit product(availability and others)\n- Accept order\n- Update tracking\n- Chat with customer\n\n**Seller**\n\n- Assign or create, remove managers to his shop and products\n- Remove reported item\n- Create discount, Offer\n- Create Product\n- Edit product(availability and others)\n- Accept order\n- Update tracking\n- Chat with sells Managers\n\n**Admin**\n\n- Verify and edit,ban seller\n- Add, change the content of the application\n- Manage the Sells and Seller of the software\n- Business supervision\n- Assist seller and sales manager to get a better user experience\n- Collect feedback from seller and Sells manager\n\n**Super Admin**\n\n- Add, remove a admin\n- Business supervision\n\n### Non-Functional requirements\n\n- High reliability.\n- High availability with minimal latency.\n- The system should be scalable and efficient\n\n### Extended requirements\n\n- Customers can rate the product, shop after it's completed.\n- Payment processing.\n- Metrics and analytics\n\n## Estimation and Constraints\n\nLet's start with the estimation and constraints.\n\n### Traffic\n\nLet us assume we have 10000 daily active users (DAU).If on average each user performs 10 actions (such as request a check available product, addtoCart, checkout, etc.) we will have to handle 100000 requests daily.\n\n$$\n10000 \\times 10 \\space actions = 100000 \\space /day\n$$\n\n**What would be Requests Per Second (RPS) for our system?**\n\n100000 requests per day translate into 1.2 requests per second.\n\n$$\n\\frac{100000 \\space}{(24 \\space hrs \\times 3600 \\space seconds)} = \\sim 1.2 \\space requests/second\n$$\n\n### Storage\n\nIf we assume each user comsume on average is 400 bytes, we will require about 0.04 GB of database storage every day.\n\n$$\n100000 \\space \\times 400 \\space bytes = \\sim 0.04 \\space GB/day\n$$\n\nAnd for 10 years, we will require about 146 GB of storage.\n\n$$\n0.04 \\space GB \\times 10 \\space years \\times 365 \\space days = \\sim 146 \\space GB\n$$\n\n### Bandwidth\n\nAs our system is handling 0.04 GB of ingress every day, we will require a minimum bandwidth of around 0.46 KB per second.\n\n$$\n\\frac{0.04 \\space GB}{(24 \\space hrs \\times 3600 \\space seconds)} = \\sim 0.46 \\space KB/second\n$$\n\n### High-level estimate\n\nHere is our high-level estimate:\n\n| Type                      | Estimate    |\n| ------------------------- | ----------- |\n| Daily active users (DAU)  | 10000       |\n| Requests per second (RPS) | 1.2/s      |\n| Storage (per day)         | ~0.04 GB    |\n| Storage (10 years)        | ~146 GB     |\n| Bandwidth                 | ~0.46 KB/s |\n\n\n\n\n## Data Model Design\n\nThis is the general data model which reflects our requirements.\n\n![diagram-export-12-18-2024-3_45_51-PM](https://github.com/user-attachments/assets/0e832a91-f4a4-4211-948a-7df3a1323405)\n\n\nWe have the following tables:\n\n**User**  \nThis is the user table that includes all user data with fields such as `id`, `email`, `password`, `role`, `createdAt`, `updatedAt`.\n\n**SuperAdmin**  \nThis table contains data for super admins, including `id`, `fullName`, `contactNumber`, `emergencyContactNumber`, `address`, `profileImg`, `nidNumber`, `userId`, `isActive`, `createdAt`, `updatedAt`.\n\n**Admin**  \nThis table stores admin data, including fields like `id`, `fullName`, `contactNumber`, `emergencyContactNumber`, `address`, `profileImg`, `userId`, `nidNumber`, `isActive`, `createdAt`, `updatedAt`.\n\n**Seller**  \nThis table holds seller data with fields such as `id`, `fullName`, `contactNumber`, `emergencyContactNumber`, `address`, `profileImg`, `userId`, `nidNumber`, `isActive`, `createdAt`, `updatedAt`.\n\n**SellsManager**  \nThis table stores data for sales managers with fields like `id`, `fullName`, `contactNumber`, `emergencyContactNumber`, `address`, `profileImg`, `userId`, `nidNumber`, `isActive`, `shopId`, `createdAt`, `updatedAt`.\n\n**Customer**  \nThis table holds customer information, including fields like `id`, `fullName`, `contactNumber`, `emergencyContactNumber`, `address`, `profileImg`, `userId`, `isActive`, `dob`, `createdAt`, `updatedAt`.\n\n**Conversation**  \nThis table contains conversation data, including `id`, `message`, `participants`, `senderId`, `receiverId`, `createdAt`, `updatedAt`.\n\n**Message**  \nThis table holds message data within conversations with fields such as `id`, `message`, `senderId`, `receiverId`, `conversationId`, `createdAt`, `updatedAt`.\n\n**Shop**  \nThis table contains information about shops, including `id`, `sellerId`, `shopName`, `shopImage`, `rating`, `location`, `isVerified`, `createdAt`, `updatedAt`.\n\n**Coupon**  \nThis table stores coupon data related to shops, including `id`, `shopId`, `couponName`, `discount`, `shippingCharge`, `validTill`, `createdBy`, `createdAt`, `updatedAt`.\n\n**Product**  \nThis table contains product data for each shop, including `id`, `shopId`, `productName`, `productMainImage`, `productAdditionalImages`, `shortDescription`, `productDetails`, `minPrice`, `discountPrice`, `discountPercentage`, `moneySaved`, `sellCount`, `createdBy`, `categoryId`, `productSkuId`, `productTags`, `createdAt`, `updatedAt`, `orderId`, `orderOrderId`, `cartId`.\n\n**Category**  \nThis table holds product categories with fields like `id`, `image`, `title`, `createdAt`, `updatedAt`.\n\n**ProductSku**  \nThis table contains SKU (Stock Keeping Unit) information for products with fields like `id`, `title`, `quantity`, `availableColor`, `availableSize`, `shopId`, `createdAt`, `updatedAt`.\n\n**Color**  \nThis table contains color options for products with fields such as `id`, `title`, `shopId`, `createdAt`, `updatedAt`.\n\n**Size**  \nThis table stores size options for products with fields such as `id`, `title`, `shopId`, `createdAt`, `updatedAt`.\n\n**ProductTags**  \nThis table holds tags related to products, including `id`, `title`, `createdAt`, `updatedAt`.\n\n**Cart**  \nThis table stores data related to customer shopping carts with fields such as `id`, `userId`, `productId`, `quantity`, `createdAt`, `updatedAt`.\n\n**Order**  \nThis table stores order data, including `id`, `fullName`, `contactNumber`, `emergencyContactNumber`, `email`, `address`, `subTotal`, `shippingCharge`, `tax`, `total`, `paidAmount`, `dueAmount`, `orderStatus`, `trnsId`, `isPaid`, `orderPlacedAt`, `payment_acceptedAt`, `delivered_to_curier`, `curier_wareshouse`, `being_delivered`, `delivered`, `canceledAt`, `userId`, `shopId`, `couponId`, `createdAt`, `updatedAt`.\n\n**OrderItem**  \nThis table stores the details of items in an order, including `id`, `orderId`, `productId`, `quantity`, `createdAt`.\n\n**Payment**  \nThis table holds payment information for orders, including `id`, `trnxId`, `userId`, `orderId`, `createdAt`, `updatedAt`.\n\n**WishList**  \nThis table stores customer wish list items, including `id`, `userId`, `productId`, `createdAt`, `updatedAt`.\n\n**ReviewAndRatings**  \nThis table holds product reviews and ratings from customers, including `id`, `customerId`, `productId`, `comment`, `rating`, `like`, `disLike`, `createdAt`, `updatedAt`.\n\n\n\n### What kind of database should we use?\n\nWe are developing a monolithic application, and we will use a single [PostgreSQL](https://www.postgresql.org) database to store all of our data. While our data model is quite relational, keeping everything in one database is suitable for our current architecture. This allows us to leverage PostgreSQL's powerful relational capabilities, including complex queries, transactions, and referential integrity, which are critical for our application.\n\nDespite using a monolithic architecture, we can still ensure scalability and maintainability by organizing the database schema in a way that logically separates concerns. We will define clear ownership of tables and ensure that the application components interact with the database in a modular and efficient way. This approach enables us to take full advantage of PostgreSQL's features while avoiding the complexity of managing multiple databases.\n\n## High-level design\n\nNow let us do a high-level design of our system.\n\nWe will be using Monolith architecure while we are building the MVP. According to demand we will scale it horizontally and If it reach to limitations we will consider to build to microservice.\n\n### How is the service expected to work?\n\nHere's how our service is expected to work:\n\n- **Customer** places an order by selecting products, adding them to the cart, choosing a payment method, and proceeding to checkout. They can also wishlist products, search, filter items, track orders, and contact support.\n- **Seller** manages their shop by creating or editing products, assigning managers, removing reported items, and offering discounts. They accept orders, update tracking, and communicate with the sales manager.\n- **Sells Manager** creates and edits products, accepts orders, and tracks shipments. They also chat with customers and assist sellers.\n- **Admin** supervises the business, verifies or bans sellers, manages content, and ensures a smooth experience for sellers and sales managers.\n- **Super Admin** manages admins, oversees the entire system, and ensures business operations run smoothly.\n### Payments\n\nHandling payments at scale is challenging, to simplify our system we can use a third-party payment processor like [Stripe](https://stripe.com) or [SSLCommerz](https://www.paypal.com). Once the payment is complete, the payment processor will redirect the user back to our application and we can set up a [webhook](https://en.wikipedia.org/wiki/Webhook) to capture all the payment-related data.\n\n### Notifications\n\nWe will send notifications through our server in future.\n\n## Identify and resolve bottlenecks\n\nLet us identify and resolve bottlenecks such as single points of failure in our design:\n\n- \"What if one of our services crashes?\"\n- \"How can we reduce the load on our database?\"\n\nTo make our system more resilient we can do the following:\n- Implement load balancer to distribute traffic across multiple instances or containers\n- Use a queue system (e.g., RabbitMQ or Kafka) to offload heavy tasks like email sending, Invoice generation etc.\n- Implement logging to identify the problem\n- Using caching to reduce load on our database.\n\n\n\n\n## Architecture Overview\n\n\n\n\n## Technology Stack\n- **Frontend**: Typescript, Next.js, Redux, Socket.io, Framer Motion, Email.js, React quill, Axios, Tailwind, Ant Design, etc\n- **Backend**: Typescript, Node.js, Express.js, Docker, Nginx, PostgreSQL, Prisma, Redis, Stripe, Socket.io, Jest, bcrypt, JWT, etc\n\n- **Containerization**: \n  - **Docker** for creating, managing, and deploying containers.\n  - **Docker Hub** for publishing and accessing the container images.\n\n## User Interface\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbayajidalam%2Fgentrandz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbayajidalam%2Fgentrandz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbayajidalam%2Fgentrandz/lists"}