gitlab_ci_cd_documentation:cotrav-platform
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| gitlab_ci_cd_documentation:cotrav-platform [2026/03/30 10:17] – [Layer 2 – Port Listening] raviraj | gitlab_ci_cd_documentation:cotrav-platform [2026/03/31 05:54] (current) – [Stage 1 — Test] raviraj | ||
|---|---|---|---|
| Line 869: | Line 869: | ||
| ---- | ---- | ||
| - | |||
| ==== Layer 3 – HTTP Health Endpoint ==== | ==== Layer 3 – HTTP Health Endpoint ==== | ||
| Line 995: | Line 994: | ||
| ---- | ---- | ||
| - | |||
| ====== Network Configuration ====== | ====== Network Configuration ====== | ||
| Line 1063: | Line 1061: | ||
| < | < | ||
| - | |||
| Cotrav_Services │ ├── packages │ ├── logger │ ├── errors │ ├── middlewares │ └── common │ ├── services │ ├── auth-service │ ├── user-service │ ├── booking-service │ └── other microservices │ ├── scripts │ └── deploy.sh │ ├── pnpm-workspace.yaml ├── turbo.json ├── tsconfig.json ├── package.json └── LICENSE | Cotrav_Services │ ├── packages │ ├── logger │ ├── errors │ ├── middlewares │ └── common │ ├── services │ ├── auth-service │ ├── user-service │ ├── booking-service │ └── other microservices │ ├── scripts │ └── deploy.sh │ ├── pnpm-workspace.yaml ├── turbo.json ├── tsconfig.json ├── package.json └── LICENSE | ||
| Line 1069: | Line 1066: | ||
| ---- | ---- | ||
| - | |||
| ====== 1. packages Directory ====== | ====== 1. packages Directory ====== | ||
| Line 1105: | Line 1101: | ||
| ---- | ---- | ||
| - | |||
| ====== 2. services Directory ====== | ====== 2. services Directory ====== | ||
| Line 1111: | Line 1106: | ||
| ===== Purpose ===== | ===== Purpose ===== | ||
| - | The '' | + | The '' |
| Each service is: | Each service is: | ||
| Line 1151: | Line 1146: | ||
| ---- | ---- | ||
| - | |||
| ====== 3. scripts Directory ====== | ====== 3. scripts Directory ====== | ||
| Line 1157: | Line 1151: | ||
| ===== Purpose ===== | ===== Purpose ===== | ||
| - | The '' | + | The '' |
| Example: | Example: | ||
| Line 1167: | Line 1161: | ||
| </ | </ | ||
| - | The '' | + | The '' |
| It performs: | It performs: | ||
| Line 1178: | Line 1172: | ||
| ---- | ---- | ||
| - | |||
| ====== 4. pnpm-workspace.yaml ====== | ====== 4. pnpm-workspace.yaml ====== | ||
| Line 1202: | Line 1195: | ||
| ---- | ---- | ||
| - | |||
| ====== 5. turbo.json ====== | ====== 5. turbo.json ====== | ||
| - | '' | + | '' |
| Example pipeline tasks: | Example pipeline tasks: | ||
| Line 1225: | Line 1217: | ||
| ---- | ---- | ||
| - | |||
| ====== 6. TypeScript Configuration ====== | ====== 6. TypeScript Configuration ====== | ||
| Line 1246: | Line 1237: | ||
| ---- | ---- | ||
| - | |||
| ====== Monorepo Architecture Diagram ====== | ====== Monorepo Architecture Diagram ====== | ||
| Line 1268: | Line 1258: | ||
| ---- | ---- | ||
| - | |||
| ====== Backend Infrastructure ====== | ====== Backend Infrastructure ====== | ||
| Line 1282: | Line 1271: | ||
| │ | │ | ||
| ├── auth-service | ├── auth-service | ||
| - | ├── | + | ├── |
| - | └── | + | └── |
| </ | </ | ||
| ---- | ---- | ||
| - | |||
| ====== Advantages of This Architecture ====== | ====== Advantages of This Architecture ====== | ||
| Line 1311: | Line 1299: | ||
| Automated CI/CD pipeline with **GitLab CI/CD**. | Automated CI/CD pipeline with **GitLab CI/CD**. | ||
| + | |||
| + | ===== ===== | ||
| + | |||
| + | ===== Impliments to exmaple CICD ROOT SERVICES CICD ===== | ||
| + | |||
| + | |||
| + | ====== Auth Service Documentation Exmaple.. ====== | ||
| + | |||
| + | |||
| + | ===== Overview ===== | ||
| + | |||
| + | '' | ||
| + | |||
| + | It is built using **Node.js** | ||
| + | |||
| + | Responsibilities of this service include: | ||
| + | |||
| + | * User authentication | ||
| + | * Token generation | ||
| + | * Authorization middleware | ||
| + | * Secure API access | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== Service Folder Structure ====== | ||
| + | |||
| + | < | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | < | ||
| + | |||
| + | auth-service │ ├── src │ ├── controllers │ ├── routes │ ├── services │ ├── middlewares │ └── index.ts │ ├── Dockerfile ├── docker-compose.yml ├── nginx.conf ├── .gitlab-ci.yml ├── package.json ├── pnpm-lock.yaml └── tsconfig.json | ||
| + | |||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | |||
| + | ====== Source Code (src) ====== | ||
| + | |||
| + | < | ||
| + | The '' | ||
| + | |||
| + | Typical structure: | ||
| + | |||
| + | src │ ├── controllers # API request handlers ├── routes # Express route definitions ├── services # Business logic layer ├── middlewares # Authentication & validation └── index.ts # Application entry point | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Responsibilities ==== | ||
| + | |||
| + | ^Component^Description| | ||
| + | |Controllers|Handle incoming HTTP requests| | ||
| + | |Routes|Define API endpoints| | ||
| + | |Services|Business logic implementation| | ||
| + | |Middlewares|Authentication and request validation| | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== Dockerfile ====== | ||
| + | |||
| + | The '' | ||
| + | |||
| + | Responsibilities: | ||
| + | |||
| + | * Install dependencies | ||
| + | * Build TypeScript code | ||
| + | * Start the Node.js application | ||
| + | |||
| + | Example workflow: | ||
| + | |||
| + | < | ||
| + | Build Image ↓ Install Dependencies ↓ Compile TypeScript ↓ Run Service | ||
| + | |||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | |||
| + | ====== docker-compose.yml ====== | ||
| + | |||
| + | < | ||
| + | '' | ||
| + | |||
| + | It allows developers to quickly run the service with required dependencies. | ||
| + | |||
| + | Example usage: | ||
| + | |||
| + | docker-compose up -d | ||
| + | |||
| + | </ | ||
| + | |||
| + | Benefits: | ||
| + | |||
| + | Container orchestration for development | ||
| + | |||
| + | Easy local setup | ||
| + | |||
| + | Environment configuration | ||
| + | |||
| + | ---- | ||
| + | |||
| + | |||
| + | ====== nginx.conf ====== | ||
| + | |||
| + | The '' | ||
| + | |||
| + | Responsibilities: | ||
| + | |||
| + | * Reverse proxy configuration | ||
| + | * Load balancing | ||
| + | * Port routing | ||
| + | * Security headers | ||
| + | |||
| + | Traffic flow: | ||
| + | |||
| + | < | ||
| + | Client Request │ ▼ Nginx Reverse Proxy │ ▼ Auth Service Container | ||
| + | |||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | |||
| + | ====== .gitlab-ci.yml ====== | ||
| + | |||
| + | The '' | ||
| + | |||
| + | Pipeline stages may include: | ||
| + | |||
| + | - Validate service | ||
| + | - Run tests | ||
| + | - Build Docker image | ||
| + | - Push image to registry | ||
| + | - Deploy service | ||
| + | |||
| + | Example pipeline flow: | ||
| + | |||
| + | < | ||
| + | Code Push │ ▼ GitLab Pipeline │ ├── Install Dependencies ├── Run Tests ├── Build Docker Image ├── Push Image ▼ Deployment | ||
| + | |||
| + | </ | ||
| + | ==== Project: Cotrav Services – Auth Service ==== | ||
| + | |||
| + | ===== 1. Overview ===== | ||
| + | |||
| + | This project implements a **CI/CD pipeline using GitLab CI** to automate the process of: | ||
| + | |||
| + | * Testing | ||
| + | * Building | ||
| + | * Validating | ||
| + | * Deploying | ||
| + | * Cleaning Docker images | ||
| + | |||
| + | The pipeline is designed for a **Monorepo Microservices Architecture** | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== 2. Pipeline Architecture ====== | ||
| + | |||
| + | The CI/CD pipeline contains the following stages: | ||
| + | |||
| + | < | ||
| + | │ | ||
| + | ▼ | ||
| + | GitLab Repository | ||
| + | │ | ||
| + | ▼ | ||
| + | GitLab Runner (docker-runner01) | ||
| + | │ | ||
| + | ▼ | ||
| + | TEST → BUILD → VALIDATE → DEPLOY → CLEANUP | ||
| + | │ | ||
| + | ▼ | ||
| + | Docker Image Build | ||
| + | │ | ||
| + | ▼ | ||
| + | Push to GitLab Container Registry | ||
| + | │ | ||
| + | ▼ | ||
| + | SSH Deployment to Server | ||
| + | |||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== 3. Pipeline Stages ====== | ||
| + | |||
| + | ===== Stage 1 — Test ===== | ||
| + | |||
| + | < | ||
| + | test-auth | ||
| + | |||
| + | </ | ||
| + | |||
| + | This stage runs automated tests before building the service. | ||
| + | |||
| + | Purpose: | ||
| + | |||
| + | * Verify code functionality | ||
| + | * Prevent broken builds | ||
| + | * Ensure stability before deployment | ||
| + | |||
| + | The job extends a reusable template: | ||
| + | |||
| + | < | ||
| + | extends: .base_test_job | ||
| + | |||
| + | </ | ||
| + | |||
| + | The runner used: | ||
| + | |||
| + | < | ||
| + | tags: | ||
| + | - docker-runner01 | ||
| + | |||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | |||
| + | ====== 4. Stage 2 — Build ====== | ||
| + | |||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | Purpose: | ||
| + | |||
| + | * Build the Auth service | ||
| + | * Create Docker image | ||
| + | * Push image to GitLab Container Registry | ||
| + | |||
| + | Dependency: | ||
| + | |||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | Build only runs after **tests pass**. | ||
| + | |||
| + | Docker image naming format: | ||
| + | |||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | Example: | ||
| + | |||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== 5. Stage 3 — Validate ====== | ||
| + | |||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | Purpose: | ||
| + | |||
| + | * Validate Docker image | ||
| + | * Ensure artifacts are correct | ||
| + | * Check build integrity | ||
| + | |||
| + | Dependency: | ||
| + | |||
| + | < | ||
| + | - build-auth | ||
| + | |||
| + | </ | ||
| + | |||
| + | Artifacts from build are used for validation. | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== 6. Deployment Strategy ====== | ||
| + | |||
| + | Deployment is automated using **SSH + Docker**. | ||
| + | |||
| + | Pipeline supports **3 environments**: | ||
| + | |||
| + | ^Environment^Branch^Port| | ||
| + | |Dev|dev|4001| | ||
| + | |Test|test|4002| | ||
| + | |Production|production|4003| | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== 7. Dev Deployment ====== | ||
| + | |||
| + | Job: | ||
| + | < | ||
| + | deploy-dev | ||
| + | |||
| + | </ | ||
| + | |||
| + | Runs automatically when: | ||
| + | |||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | Configuration: | ||
| + | |||
| + | < | ||
| + | INTERNAL_PORT=3000 | ||
| + | |||
| + | </ | ||
| + | |||
| + | This deploys the container to the development environment. | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== 8. Test Deployment ====== | ||
| + | |||
| + | Job: | ||
| + | |||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | Runs when: | ||
| + | |||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | Deployment is **manual approval based**: | ||
| + | |||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | Configuration: | ||
| + | |||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | This allows QA or testing before production release. | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== 9. Production Deployment ====== | ||
| + | |||
| + | Job: | ||
| + | |||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | Production deployment uses **Blue-Green Deployment Strategy**. | ||
| + | |||
| + | Configuration: | ||
| + | |||
| + | < | ||
| + | GREEN_PORT=4004 | ||
| + | |||
| + | </ | ||
| + | |||
| + | Benefits: | ||
| + | |||
| + | * Zero downtime deployment | ||
| + | * Safe rollback | ||
| + | * High availability | ||
| + | |||
| + | Deployment is also **manual approval based**. | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== 10. Pipeline Rules ====== | ||
| + | |||
| + | Pipeline runs only if **relevant files change**. | ||
| + | |||
| + | < | ||
| + | - Cotrav_Services/ | ||
| + | - Cotrav_Services/ | ||
| + | - Cotrav_Services/ | ||
| + | - Cotrav_Services/ | ||
| + | |||
| + | </ | ||
| + | |||
| + | Benefits: | ||
| + | |||
| + | * Faster pipeline | ||
| + | * Avoid unnecessary builds | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== 11. Caching Strategy ====== | ||
| + | |||
| + | Pipeline uses **PNPM caching** | ||
| + | |||
| + | < | ||
| + | key: pnpm-cache-$CI_COMMIT_REF_SLUG | ||
| + | |||
| + | </ | ||
| + | |||
| + | Cached directories: | ||
| + | |||
| + | < | ||
| + | Cotrav_Services/ | ||
| + | node_modules | ||
| + | |||
| + | </ | ||
| + | |||
| + | Benefits: | ||
| + | |||
| + | * Faster dependency installation | ||
| + | * Reduced CI runtime | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== 12. Docker Build Optimization ====== | ||
| + | |||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | BuildKit improves: | ||
| + | |||
| + | * Docker build performance | ||
| + | * Layer caching | ||
| + | * Parallel builds | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== 13. Environment Variables ====== | ||
| + | |||
| + | Important pipeline variables: | ||
| + | |||
| + | ^Variable^Purpose| | ||
| + | |RUNNER_TAG|Runner to execute jobs| | ||
| + | |SERVICE_PATH|Path to service| | ||
| + | |DOCKER_IMAGE|Docker registry image| | ||
| + | |DOCKER_TAG|Unique build tag| | ||
| + | |REMOTE_BASE_PATH|Deployment directory| | ||
| + | |ENV_CONTENT|Encoded environment file| | ||
| + | |||
| + | Environment file is stored securely in GitLab CI variables: | ||
| + | < | ||
| + | AUTH_SERVICE_ENV_BASE64 | ||
| + | |||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== 14. Cleanup Stage ====== | ||
| + | |||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | Purpose: | ||
| + | |||
| + | Remove old Docker images from the registry. | ||
| + | |||
| + | Command used: | ||
| + | |||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | Configuration: | ||
| + | |||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | Meaning: | ||
| + | |||
| + | Only **latest 5 images are kept**. | ||
| + | |||
| + | Benefits: | ||
| + | |||
| + | * Saves registry storage | ||
| + | * Maintains clean image history | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== 15. GitLab Templates ====== | ||
| + | |||
| + | Pipeline uses reusable templates: | ||
| + | |||
| + | < | ||
| + | |||
| + | gitlab/ | ||
| + | gitlab/ | ||
| + | gitlab/ | ||
| + | gitlab/ | ||
| + | |||
| + | </ | ||
| + | |||
| + | Advantages: | ||
| + | |||
| + | * Reusable CI logic | ||
| + | * Cleaner '' | ||
| + | * Easy to scale for multiple services | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== 16. Monorepo Structure ====== | ||
| + | |||
| + | Example project structure: | ||
| + | |||
| + | < | ||
| + | Cotrav_Services | ||
| + | │ | ||
| + | ├── packages | ||
| + | │ ├── logger | ||
| + | │ ├── errors | ||
| + | │ └── middlewares | ||
| + | │ | ||
| + | ├── services | ||
| + | │ └── auth-service | ||
| + | │ | ||
| + | ├── scripts | ||
| + | │ | ||
| + | ├── pnpm-workspace.yaml | ||
| + | ├── turbo.json | ||
| + | └── package.json | ||
| + | |||
| + | Tools used: | ||
| + | PNPM TurboRepo TypeScript | ||
| + | |||
| + | </ | ||
| + | |||
| + | < | ||
| + | include: | ||
| + | - local: gitlab/ | ||
| + | - local: gitlab/ | ||
| + | - local: gitlab/ | ||
| + | - local: gitlab/ | ||
| + | |||
| + | variables: | ||
| + | RUNNER_TAG: " | ||
| + | DOCKER_BUILDKIT: | ||
| + | MONOREPO_ROOT: | ||
| + | SERVICE_PATH: | ||
| + | BASE_SERVICE_NAME: | ||
| + | VERSION_NUMBER: | ||
| + | DOCKER_IMAGE: | ||
| + | DOCKER_TAG: " | ||
| + | REMOTE_BASE_PATH: | ||
| + | ENV_CONTENT: | ||
| + | |||
| + | stages: | ||
| + | - test | ||
| + | - build | ||
| + | - validate | ||
| + | - deploy | ||
| + | - cleanup | ||
| + | |||
| + | cache: | ||
| + | key: " | ||
| + | paths: | ||
| + | - " | ||
| + | - " | ||
| + | - " | ||
| + | policy: pull-push | ||
| + | |||
| + | .auth-service_rules: | ||
| + | rules: | ||
| + | - if: ' | ||
| + | changes: | ||
| + | - " | ||
| + | - " | ||
| + | - " | ||
| + | - " | ||
| + | # ... | ||
| + | |||
| + | # ─── TEST ──────────────────────────────────────────────── | ||
| + | test-auth: | ||
| + | extends: .base_test_job | ||
| + | tags: | ||
| + | - " | ||
| + | <<: *auth_rules | ||
| + | |||
| + | # ─── BUILD ─────────────────────────────────────────────── | ||
| + | build-auth: | ||
| + | extends: .base_build_job | ||
| + | needs: [" | ||
| + | tags: | ||
| + | - " | ||
| + | <<: *auth_rules | ||
| + | |||
| + | # ─── VALIDATE ──────────────────────────────────────────── | ||
| + | validate-auth: | ||
| + | extends: .base_validate_job | ||
| + | stage: validate | ||
| + | needs: | ||
| + | - job: build-auth | ||
| + | artifacts: true | ||
| + | tags: | ||
| + | - " | ||
| + | <<: *auth_rules | ||
| + | |||
| + | # ─── DEPLOY DEV ────────────────────────────────────────── | ||
| + | deploy-dev: | ||
| + | extends: .base_deploy_job | ||
| + | needs: | ||
| + | - job: build-auth | ||
| + | artifacts: true | ||
| + | - job: validate-auth | ||
| + | artifacts: true | ||
| + | variables: | ||
| + | SERVICE_NAME: | ||
| + | TARGET_ENV: " | ||
| + | DEPLOY_SERVER_IP: | ||
| + | SSH_USER: " | ||
| + | PORT: " | ||
| + | INTERNAL_PORT: | ||
| + | environment: | ||
| + | name: dev/ | ||
| + | rules: | ||
| + | - if: ' | ||
| + | |||
| + | # ─── DEPLOY TEST ───────────────────────────────────────── | ||
| + | deploy-test: | ||
| + | extends: .base_deploy_job | ||
| + | needs: | ||
| + | - job: build-auth | ||
| + | artifacts: true | ||
| + | - job: validate-auth | ||
| + | artifacts: true | ||
| + | variables: | ||
| + | SERVICE_NAME: | ||
| + | TARGET_ENV: " | ||
| + | DEPLOY_SERVER_IP: | ||
| + | SSH_USER: " | ||
| + | PORT: " | ||
| + | INTERNAL_PORT: | ||
| + | environment: | ||
| + | name: test/ | ||
| + | rules: | ||
| + | - if: ' | ||
| + | when: manual | ||
| + | |||
| + | # ─── DEPLOY PROD ───────────────────────────────────────── | ||
| + | deploy-prod: | ||
| + | extends: .base_deploy_job | ||
| + | needs: | ||
| + | - job: build-auth | ||
| + | artifacts: true | ||
| + | - job: validate-auth | ||
| + | artifacts: true | ||
| + | variables: | ||
| + | SERVICE_NAME: | ||
| + | TARGET_ENV: " | ||
| + | DEPLOY_SERVER_IP: | ||
| + | SSH_USER: " | ||
| + | BLUE_PORT: " | ||
| + | GREEN_PORT: " | ||
| + | PORT: " | ||
| + | INTERNAL_PORT: | ||
| + | environment: | ||
| + | name: prod/ | ||
| + | rules: | ||
| + | - if: ' | ||
| + | when: manual | ||
| + | |||
| + | # ─── CLEANUP ───────────────────────────────────── | ||
| + | cleanup-registry: | ||
| + | stage: cleanup | ||
| + | image: registry.gitlab.com/ | ||
| + | script: | ||
| + | - echo " | ||
| + | - glab registry delete " | ||
| + | rules: | ||
| + | - if: ' | ||
| + | when: on_success | ||
| + | allow_failure: | ||
| + | |||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | |||
| + | ====== 17. Deployment Server ====== | ||
| + | |||
| + | Deployment server path: | ||
| + | |||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | Deployment method: | ||
| + | |||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== 18. Advantages of This Pipeline ====== | ||
| + | |||
| + | * Automated testing | ||
| + | * Automated Docker build | ||
| + | * Monorepo support | ||
| + | * Environment based deployment | ||
| + | * Blue-Green production deployment | ||
| + | * Docker registry cleanup | ||
| + | * Faster builds using caching | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== 19. Technologies Used ====== | ||
| + | |||
| + | ^Technology^Purpose| | ||
| + | |GitLab CI/ | ||
| + | |Docker|Containerization| | ||
| + | |PNPM|Dependency management| | ||
| + | |TurboRepo|Monorepo build system| | ||
| + | |TypeScript|Backend development| | ||
| + | |Nginx|Reverse proxy| | ||
| + | |SSH|Remote deployment| | ||
| + | |||
| + | ---- | ||
| + | |||
| + | |||
| + | ====== Deployment Architecture ====== | ||
| + | |||
| + | The service runs inside Docker containers and is exposed through **NGINX**. | ||
| + | < | ||
| + | Internet │ ▼ Nginx Gateway │ ▼ Auth Service Container | ||
| + | |||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | |||
| + | ====== Configuration Files ====== | ||
| + | |||
| + | ^File^Purpose| | ||
| + | |package.json|Node.js project configuration| | ||
| + | |pnpm-lock.yaml|Dependency lock file| | ||
| + | |tsconfig.json|TypeScript compiler configuration| | ||
| + | |||
| + | Dependencies are managed using **pnpm**. | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== Integration with Monorepo ====== | ||
| + | |||
| + | '' | ||
| + | |||
| + | Shared packages from the monorepo can be used inside the service: | ||
| + | |||
| + | Example: | ||
| + | |||
| + | < | ||
| + | import logger from " | ||
| + | |||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | |||
| + | ====== Advantages of This Setup ====== | ||
| + | |||
| + | * Microservice architecture | ||
| + | * Containerized deployment | ||
| + | * Automated CI/CD pipeline | ||
| + | * Scalable infrastructure | ||
| + | * Shared code through monorepo packages | ||
gitlab_ci_cd_documentation/cotrav-platform.1774865827.txt.gz · Last modified: by raviraj
