{"id":23554447,"url":"https://github.com/amrmuhamedd/e-commerce-nestjs","last_synced_at":"2026-04-28T17:35:32.776Z","repository":{"id":149586053,"uuid":"393905099","full_name":"amrmuhamedd/e-commerce-nestjs","owner":"amrmuhamedd","description":"This project is a robust and scalable e-commerce backend built using NestJS, a powerful Node.js framework. It offers user registration, role-based authentication, and authorization. Users can be either \"user\" or \"admin,\" with different privileges. \"Users\" can browse products, add them to their cart, and view related items from specific sellers. ","archived":false,"fork":false,"pushed_at":"2023-09-15T20:24:50.000Z","size":248,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-15T19:14:12.107Z","etag":null,"topics":["authentication","authorization","ecommerce","monogodb","nestjs","swagger-ui"],"latest_commit_sha":null,"homepage":"https://e-commerce-0tqz.onrender.com/docs/","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/amrmuhamedd.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":"2021-08-08T08:36:14.000Z","updated_at":"2025-04-28T13:17:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"bb2798aa-6fb1-4e11-94ec-bd4372b8c9e4","html_url":"https://github.com/amrmuhamedd/e-commerce-nestjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/amrmuhamedd/e-commerce-nestjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amrmuhamedd%2Fe-commerce-nestjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amrmuhamedd%2Fe-commerce-nestjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amrmuhamedd%2Fe-commerce-nestjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amrmuhamedd%2Fe-commerce-nestjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amrmuhamedd","download_url":"https://codeload.github.com/amrmuhamedd/e-commerce-nestjs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amrmuhamedd%2Fe-commerce-nestjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32392300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["authentication","authorization","ecommerce","monogodb","nestjs","swagger-ui"],"created_at":"2024-12-26T12:14:29.046Z","updated_at":"2026-04-28T17:35:32.756Z","avatar_url":"https://github.com/amrmuhamedd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# E-Commerce Project Documentation\n\nWelcome to the documentation for the E-Commerce project built with NestJS. This project aims to provide a backend solution for an e-commerce platform with user registration, product management, and shopping cart functionality.\n\n## Project Overview\n\nThe E-Commerce project is built using the NestJS framework, which provides a robust foundation for creating scalable and maintainable applications. The project follows a clear structure to ensure organization and readability.\n\n\n\n## Tech Stack\n\nThe E-Commerce project REST API is built using the following technologies:\n\n- **Node.js**: The server-side environment for running JavaScript.\n- **Nest.js**: A fast and minimalist web framework for Node.js.\n- **mongoose**: An ORM (Object-Relational Mapping) for database interactions.\n- **MongoDb**: A powerful, open-source relational database.\n- **JWT (JSON Web Tokens)**: For secure authentication and authorization.\n- **Swagger**: For API documentation.\n\n\n### Project Structure\n\nThe project is organized into the following main directories:\n\n- `src`: This directory contains the source code of the application.\n  - `auth`: Manages user authentication and authorization.\n  - `products`: Handles product management and shopping cart functionality.\n    - `products-controller`: Contains CRUD operations for products and shopping cart management.\n\n## Design Patterns and Logic\n\n### Authentication and Authorization\n\nThe project implements a role-based authentication and authorization system. Users can register with the system and have roles of either \"user\" or \"admin\". Users with the \"user\" role can browse products and add them to their cart, while users with the \"admin\" role can create and update products.\n\n### Product Management\n\nProduct management is handled through the `products` module. The `products-controller` implements CRUD operations for products. Only admins can create and update products, and users can view products and add them to their cart.\n\n### Shopping Cart\n\nUsers can add products to their shopping cart, allowing them to collect items before proceeding to checkout. The shopping cart functionality is integrated with the `products` module.\n\n## Optimization and Validation\n\n### Validation Process\n\nInput validation and data integrity are crucial in any application. The project employs validation mechanisms to ensure that only valid data is accepted. NestJS provides built-in validation through decorators and pipes, which helps prevent invalid data from entering the system.\n\n### Error Handling\n\nThe project has implemented error handling strategies to provide meaningful and user-friendly error messages in case of failures. This enhances the user experience and helps developers quickly identify and resolve issues.\n\n## Getting Started\n\nTo set up the project locally, follow these steps:\n\n1. Clone the repository.\n2. Navigate to the project directory and run `npm install` to install dependencies.\n3. Create a `.env.prod` file and add your database URL in the following format:\n\n```\nDataBaseUrl = \"your_database_url_here\"\n```\n4. Run `npm start` to start the project. It will run on port 7000 by default.\n\n\n## Conclusion\n\nThe E-Commerce project built with NestJS provides a solid foundation for developing an e-commerce backend. The clear project structure, role-based authentication, product management, and shopping cart functionality make it a versatile solution for building and scaling e-commerce platforms.\n\nPlease refer to the [live documentation](https://e-commerce-0tqz.onrender.com/docs/) for more detailed information about the project's API endpoints and functionality.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famrmuhamedd%2Fe-commerce-nestjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famrmuhamedd%2Fe-commerce-nestjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famrmuhamedd%2Fe-commerce-nestjs/lists"}