Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Mavluda Beauty - Full Stack Application

## Overview
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.

## Architecture

The system consists of three main components:
1. **Frontend (Angular):** Handles user interactions, displaying the catalog, gallery, and admin dashboard.
2. **Backend (NestJS):** Provides RESTful API endpoints, business logic, authentication, and database interactions.
3. **Database (MongoDB):** Stores all persistent data, such as users, treatments, veils, and gallery items.
4. **Cache (Redis):** Used for session management and caching where appropriate.

```mermaid
graph TD
Client[Client Browser/Angular App] -->|HTTP/REST| API[NestJS Backend API]
API -->|Mongoose| MongoDB[(MongoDB Database)]
API -->|Redis Client| Redis[(Redis Cache)]
```

## Setup & Running

### Docker (Recommended)
You can run the entire stack using Docker Compose:

```bash
docker-compose up --build
```
This will start the Frontend (port 80), Backend (port 3000), MongoDB, and Redis.

### Local Development

**Backend:**
1. Navigate to the `backend` directory.
2. `npm install`
3. Copy `.env.example` to `.env` and fill in the required values (or use defaults).
4. `npm run start:dev`

**Frontend:**
1. Navigate to the `frontend` directory.
2. `npm install`
3. `npm run dev`

## API Documentation
The backend exposes a Swagger UI for API documentation. When the backend is running, you can access it at:
`http://localhost:3000/api/docs`

## Features

- **Authentication:** JWT and Google OAuth strategies using Passport.js.
- **Admin Panel:** Secured routes for managing content.
- **Catalog:** Display veils and treatments with optimized images (`NgOptimizedImage`).
- **State Management:** Uses NgRx and Signals.
- **Testing:** Vitest for frontend unit tests, Jest for backend, and Playwright for E2E testing.
16 changes: 16 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Stage 1: Build the NestJS app
FROM node:22-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build

# Stage 2: Run the app
FROM node:22-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --only=production
COPY --from=build /app/dist ./dist
EXPOSE 3000
CMD ["node", "dist/main.js"]
Loading
Loading