|
| 1 | +# Mavluda Beauty - Full Stack Application |
| 2 | + |
| 3 | +## Overview |
| 4 | +This is a full-stack application for Mavluda Beauty. The backend is built with NestJS and provides a robust, modular API. The frontend is built with Angular 19+ and features a modern, reactive UI using Signals and NgRx. |
| 5 | + |
| 6 | +## Architecture |
| 7 | + |
| 8 | +The system consists of three main components: |
| 9 | +1. **Frontend (Angular):** Handles user interactions, displaying the catalog, gallery, and admin dashboard. |
| 10 | +2. **Backend (NestJS):** Provides RESTful API endpoints, business logic, authentication, and database interactions. |
| 11 | +3. **Database (MongoDB):** Stores all persistent data, such as users, treatments, veils, and gallery items. |
| 12 | +4. **Cache (Redis):** Used for session management and caching where appropriate. |
| 13 | + |
| 14 | +```mermaid |
| 15 | +graph TD |
| 16 | + Client[Client Browser/Angular App] -->|HTTP/REST| API[NestJS Backend API] |
| 17 | + API -->|Mongoose| MongoDB[(MongoDB Database)] |
| 18 | + API -->|Redis Client| Redis[(Redis Cache)] |
| 19 | +``` |
| 20 | + |
| 21 | +## Setup & Running |
| 22 | + |
| 23 | +### Docker (Recommended) |
| 24 | +You can run the entire stack using Docker Compose: |
| 25 | + |
| 26 | +```bash |
| 27 | +docker-compose up --build |
| 28 | +``` |
| 29 | +This will start the Frontend (port 80), Backend (port 3000), MongoDB, and Redis. |
| 30 | + |
| 31 | +### Local Development |
| 32 | + |
| 33 | +**Backend:** |
| 34 | +1. Navigate to the `backend` directory. |
| 35 | +2. `npm install` |
| 36 | +3. Copy `.env.example` to `.env` and fill in the required values (or use defaults). |
| 37 | +4. `npm run start:dev` |
| 38 | + |
| 39 | +**Frontend:** |
| 40 | +1. Navigate to the `frontend` directory. |
| 41 | +2. `npm install` |
| 42 | +3. `npm run dev` |
| 43 | + |
| 44 | +## API Documentation |
| 45 | +The backend exposes a Swagger UI for API documentation. When the backend is running, you can access it at: |
| 46 | +`http://localhost:3000/api/docs` |
| 47 | + |
| 48 | +## Features |
| 49 | + |
| 50 | +- **Authentication:** JWT and Google OAuth strategies using Passport.js. |
| 51 | +- **Admin Panel:** Secured routes for managing content. |
| 52 | +- **Catalog:** Display veils and treatments with optimized images (`NgOptimizedImage`). |
| 53 | +- **State Management:** Uses NgRx and Signals. |
| 54 | +- **Testing:** Vitest for frontend unit tests, Jest for backend, and Playwright for E2E testing. |
0 commit comments