diff --git "a/Documents/pr\303\251sentation.pdf" "b/Documents/pr\303\251sentation.pdf" new file mode 100644 index 0000000000000000000000000000000000000000..933dc3d9a9654fcd30473eca5d2ebf0f10fea397 Binary files /dev/null and "b/Documents/pr\303\251sentation.pdf" differ diff --git a/todo-workspace/frontend/.dockerignore b/todo-workspace/frontend/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..72902e2db53480e758bfa2f291f86e7f360afcb7 --- /dev/null +++ b/todo-workspace/frontend/.dockerignore @@ -0,0 +1,55 @@ +# Node.js dependencies +node_modules/ + +# Build outputs +dist/ +build/ +out/ + +# IDE and editor files +.idea/ +.vscode/ +*.swp +*.swo + +# Logs and temporary files +*.log +tmp/ +temp/ +*.tmp + +# Version control +.git/ +.gitignore + +# Environment and secrets +.env* +*.env +*.pem +*.key +*.crt + +# Documentation +*.md +README* + +# Docker files +Dockerfile* +docker-compose* + +# Cache and development artifacts +.angular/cache/ + +# Project-specific patterns +public/ + +# Exclude specific files +!.nvmrc +!.prettierignore +!.prettierrc +!.editorconfig + +# Exclude source files +src/**/*.ts +src/**/*.html +src/**/*.scss \ No newline at end of file diff --git a/todo-workspace/frontend/Dockerfile b/todo-workspace/frontend/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a6731de947f7d1b737d4c52571faaa3fc7cc37e6 --- /dev/null +++ b/todo-workspace/frontend/Dockerfile @@ -0,0 +1,52 @@ +# syntax=docker/dockerfile:1 + +# Define build arguments for Node.js and pnpm versions +ARG NODE_VERSION=20.11.1 +ARG PNPM_VERSION=10.4.1 + +# Base image for development and building +FROM node:${NODE_VERSION} AS base + +# Update Corepack and enable pnpm +RUN npm install --global corepack@latest && corepack enable && corepack prepare pnpm@${PNPM_VERSION} --activate + +# Set working directory +WORKDIR /app + +# Builder stage for compiling the Angular application +FROM base AS builder + +# Copy package manager files +COPY package.json pnpm-lock.yaml ./ + +# Install dependencies with pnpm +RUN --mount=type=cache,target=/root/.pnpm-store pnpm install --frozen-lockfile + +# Copy application source code +COPY . ./ + +# Build the Angular application +RUN pnpm run build + +# Production stage with a minimal image +FROM node:${NODE_VERSION}-slim AS final + +# Update Corepack and enable pnpm +RUN npm install --global corepack@latest && corepack enable && corepack prepare pnpm@${PNPM_VERSION} --activate + +# Set working directory +WORKDIR /app + +# Copy built application and necessary files from builder stage +COPY --from=builder /app/dist ./dist +COPY --from=builder /app/package.json ./ +COPY --from=builder /app/node_modules ./node_modules + +# Set environment to production +ENV NODE_ENV=production + +# Expose the default Angular port +EXPOSE 4200 + +# Start the Angular application +CMD ["npx", "http-server", "dist"] \ No newline at end of file diff --git a/todo-workspace/frontend/README.md.bak b/todo-workspace/frontend/README.md.bak new file mode 100644 index 0000000000000000000000000000000000000000..6e342baf7e5cdbc329b5ceb2e94e23be82ba35da --- /dev/null +++ b/todo-workspace/frontend/README.md.bak @@ -0,0 +1,59 @@ +# Frontend + +This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.1.4. + +## Development server + +To start a local development server, run: + +```bash +ng serve +``` + +Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files. + +## Code scaffolding + +Angular CLI includes powerful code scaffolding tools. To generate a new component, run: + +```bash +ng generate component component-name +``` + +For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run: + +```bash +ng generate --help +``` + +## Building + +To build the project run: + +```bash +ng build +``` + +This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed. + +## Running unit tests + +To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command: + +```bash +ng test +``` + +## Running end-to-end tests + +For end-to-end (e2e) testing, run: + +```bash +ng e2e +``` + +Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs. + +## Additional Resources + +For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page. diff --git a/todo-workspace/frontend/compose.yaml b/todo-workspace/frontend/compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..756c66ece94d6aa98fa1f0d35b7e4cdec5c7a7d4 --- /dev/null +++ b/todo-workspace/frontend/compose.yaml @@ -0,0 +1,21 @@ +services: + frontend: + build: + context: ./ + ports: + - "4200:4200" + restart: unless-stopped + init: true + # env_file: ./.env # Uncomment if .env file exists + depends_on: + - database + database: + image: postgres:latest + environment: + POSTGRES_USER: user + POSTGRES_PASSWORD: password + volumes: + - db_data:/var/lib/postgresql/data + restart: unless-stopped +volumes: + db_data: \ No newline at end of file