Project Overview
Relevant source files
The following files were used as context for generating this wiki page:
The allShare marketplace application is a full-stack eCommerce platform. It consists of a server-side backend built with the NestJS framework and a client-side frontend built with the Angular framework. The system manages marketplace activities, including customer management, authentication, and product displays.
Sources: README.md:1-2, marketplace-backend/app/src/main.ts:13
System Architecture
The project follows a decoupled architecture with separate frontend and backend applications. The backend serves as a REST API, while the frontend provides the user interface.
Architecture Overview Diagram
The following diagram illustrates the high-level communication between the frontend client and the backend server.
Backend Specification
The backend is built using NestJS v8. It handles data persistence, authentication, and API documentation.
Core Technologies
| Technology | Version | Purpose |
|---|---|---|
| NestJS | ^8.2.4 | Framework for scalable server-side applications |
| Mongoose | ^6.1.4 | MongoDB object modeling |
| Passport/JWT | ^8.0.0 | Authentication and authorization |
| Swagger | ^5.1.5 | REST API documentation |
Sources: marketplace-backend/app/package.json:39-60
Application Bootstrapping
The server initializes in main.ts. It configures global filters, middleware, and API documentation.
- Swagger Documentation: The system generates API documentation using
DocumentBuilder. - CORS: The application enables Cross-Origin Resource Sharing for the frontend.
- Middleware: It uses
cookie-parser,body-parser, and a customaddAuthHeadermiddleware. - Global Filters: An
HttpExceptionFiltermanages application errors.
Sources: marketplace-backend/app/src/main.ts:11-35
Frontend Specification
The frontend is built with Angular v13 (updated from the CLI version 11 generator). It provides a responsive marketplace interface using Angular Material components.
Component Structure
The UI is organized into modular components:
- MarketHeader: Manages navigation, authentication links (Sign In/Sign Up), and language selection.
- MarketFooter: Displays copyright and general info.
- MarketHome: The landing module containing product cards.
- CommonDialog: A shared module for modal interactions.
Sources: marketplace-frontend/src/app/app.module.ts:19-23, marketplace-frontend/src/app/modules/market-home/market-home.module.ts:5-15
Authentication Flow
The frontend uses an AuthInterceptor to handle outgoing requests and a cookie-based service for session management.
Development Operations
Scripts and Commands
Both tiers use NPM for dependency management and lifecycle scripts.
| Task | Backend Command | Frontend Command |
|---|---|---|
| Install | npm install | npm install |
| Start Dev | npm run start:dev | npm start |
| Build | npm run build | npm run build |
| Test | npm run test | npm run test |
Sources: marketplace-backend/app/README.md:27-41, marketplace-frontend/README.md:11-27
Internationalization (i18n)
The application supports multiple languages using @ngx-translate. Language assets are stored in JSON files, with English (en.json) serving as a primary locale.
Sources: marketplace-frontend/src/assets/i18n/en.json:1-45, marketplace-frontend/src/app/app.module.ts:46-59
Summary
The Marketplace project integrates a NestJS backend and an Angular frontend to provide a functional eCommerce environment. The architecture emphasizes modularity through NestJS modules and Angular feature modules, supported by automated API documentation and standardized development scripts.