Go to file
vahidrezvani d2b6c0bb2b upload 2025-08-21 11:56:39 +03:30
.vscode upload 2025-08-21 11:56:39 +03:30
advertisement-service upload 2025-08-21 11:56:39 +03:30
api-gateway upload 2025-08-21 11:56:39 +03:30
catalog-service upload 2025-08-21 11:56:39 +03:30
discount-service upload 2025-08-21 11:56:39 +03:30
order-service upload 2025-08-21 11:56:39 +03:30
user-service upload 2025-08-21 11:56:39 +03:30
vendor-service upload 2025-08-21 11:56:39 +03:30
.editorconfig upload 2025-08-21 11:56:39 +03:30
.env upload 2025-08-21 11:56:39 +03:30
.gitignore upload 2025-08-21 11:56:39 +03:30
.prettierignore upload 2025-08-21 11:56:39 +03:30
.prettierrc upload 2025-08-21 11:56:39 +03:30
README.md upload 2025-08-21 11:56:39 +03:30
eslint.config.js upload 2025-08-21 11:56:39 +03:30
jest.config.ts upload 2025-08-21 11:56:39 +03:30
jest.preset.js upload 2025-08-21 11:56:39 +03:30
nx.json upload 2025-08-21 11:56:39 +03:30
package-lock.json upload 2025-08-21 11:56:39 +03:30
package.json upload 2025-08-21 11:56:39 +03:30
tsconfig.base.json upload 2025-08-21 11:56:39 +03:30

README.md

EcommerceMicroservices

Your new, shiny Nx workspace is almost ready .

Run npx nx graph to visually explore what got created. Now, let's get you up to speed!

Finish your remote caching setup

Click here to finish setting up your workspace!

Run tasks

To run tasks with Nx use:

npx nx <target> <project-name>

For example:

npx nx build myproject

These targets are either inferred automatically or defined in the project.json or package.json files.

More about running tasks in the docs »

Add new projects

While you could add new projects to your workspace manually, you might want to leverage Nx plugins and their code generation feature.

To install a new plugin you can use the nx add command. Here's an example of adding the React plugin:

npx nx add @nx/react

Use the plugin's generator to create new projects. For example, to create a new React app or library:

# Generate an app
npx nx g @nx/react:app demo

# Generate a library
npx nx g @nx/react:lib some-lib

You can use npx nx list to get a list of installed plugins. Then, run npx nx list <plugin-name> to learn about more specific capabilities of a particular plugin. Alternatively, install Nx Console to browse plugins and generators in your IDE.

Learn more about Nx plugins » | Browse the plugin registry »

Learn more about Nx on CI

Install Nx Console

Nx Console is an editor extension that enriches your developer experience. It lets you run tasks, generate code, and improves code autocompletion in your IDE. It is available for VSCode and IntelliJ.

Install Nx Console »

Learn more:

And join the Nx community:

/* User Service (Handles user profiles, authentication, notifications):

Collections: User, Address, AddressDocument, PaymentMethod, Invitation, Support, Comment. Services to Implement:

User registration/login (with roles: seller/user). Profile management (update name, language, nationality). Notification system (send based on categories/frequency). Address CRUD (create/read/update/delete). Payment method management. Support ticket creation/resolution. Comment/review posting (with likes/dislikes).

Catalog Service (Manages products, categories, properties):

Collections: ProductCategory, ProductCategoryDocument, ShopCategory, ShopCategoryDocument, Property, PropertyDocument, Tag, Product, ProductDocument, Brand. Services to Implement:

Category CRUD (hierarchical trees for shops/products). Product listing/create/update (with properties, tags, images). Brand management. Search/filtering (by tags, categories, properties). Property definition (user/system types).

Why? Core catalog domain; scales independently for search-heavy ops.

Vendor Service (Handles shops, branches, regions):

Collections: Shop, ShopDocument, Branch, Region, RegionDocument. Services to Implement:

Shop/branch creation (with addresses, schedules, facilities). Region management (polygons for geo-queries). Vendor approval (adminStatus updates). Scoring/facilities updates.

Why? Vendor-specific; allows separate scaling for multi-vendor growth.

Discount Service (Manages promotions and discounts):

Collections: ItemDiscount, Discount. Services to Implement:

Discount creation (types, percentages, expirations, limits). Apply discounts to items/products/shops. Validation (e.g., check expiry, max usage). Event emission for discount applications.

Why? Isolated for complex rules; easy to update without affecting core e-commerce.

Order Service (Handles orders, reservations, transactions):

Collections: Order, OrderDetail, Transaction, Reservation. Services to Implement:

Order creation/processing (apply discounts, calculate final price). Payment integration (via PaymentMethod refs). Transaction logging (increases/decreases). Status updates (e.g., delivery time, process). Reservation handling.

Why? Transactional core; use sagas for distributed transactions (e.g., with discounts).

Advertisement Service (Handles ads and banners):

Collections: Advertisement. Services to Implement:

Ad creation (banners, costs, dates). Targeting (by location, tags, user). Transaction linking for ad payments.

Why? Non-core; can be scaled separately for marketing teams.

API Gateway / Orchestration Service (Cross-cutting):

No specific collections; aggregates from others. Services: Authentication, rate-limiting, routing to other services. Why? Entry point; handles multi-language responses.

*/