diff --git a/z1/README.md b/z1/README.md new file mode 100644 index 0000000..5dbacda --- /dev/null +++ b/z1/README.md @@ -0,0 +1,143 @@ +# Assignment 1 – Docker Notes App + +## Overview + +This project is a simple **Notes Application** built using Docker. +It demonstrates how to run a multi-container application composed of: + +- Frontend (Nginx) +- Backend (Flask REST API) +- Database (PostgreSQL) + +The application allows users to: +- Add notes +- View saved notes +- Delete notes + +All data is stored persistently using a Docker volume. + +--- + +## Architecture + +The application consists of three services: + +### 1. Frontend +- Technology: Nginx +- Serves static HTML page +- Proxies API requests to backend +- Accessible via browser + +### 2. Backend +- Technology: Python (Flask) +- Provides REST API: + - `GET /api/notes` + - `POST /api/notes` + - `DELETE /api/notes/{id}` +- Connects to PostgreSQL database + +### 3. Database +- Technology: PostgreSQL 16 +- Stores notes data +- Uses persistent Docker volume + +--- + +## Networking + +All containers are connected via a Docker virtual network: + +- **Network name:** `zkt_net` + +This allows communication between: +- frontend → backend +- backend → database + +--- + +## Persistent Storage + +- **Volume name:** `zkt_db_data` +- Purpose: store PostgreSQL data +- Ensures data is not lost after stopping containers + +--- + +## Containers Used + +| Container Name | Description | +|----------------|------------------------| +| zkt_frontend | Nginx web server | +| zkt_backend | Flask API | +| zkt_db | PostgreSQL database | + +--- + +## Requirements + +- Docker +- Docker Compose (plugin) +- Linux / WSL / Docker Desktop +- Web browser + +--- + +## How to Run the Application + +### 1. Prepare the application + +```bash +./prepare-app.sh + +### 2. Start the application + +./start-app.sh + +### Then open your browser: + + http://localhost:8080 + + +### 3. Stop the application +./stop-app.sh + +### 4. Remove the application +./remove-app.sh + +## Testing the Application + +-Open the web interface +-Add a note +-Verify it appears in the list +-Stop and restart the app: +./stop-app.sh +./start-app.sh +-Refresh the page + +## If the note is still there → persistence works correctly + +## Key Concepts Demonstrated + +-Multi-container Docker application +-Docker Compose usage +-Container networking +-Persistent storage with volumes +-REST API communication +-Reverse proxy with Nginx + +## Use of Artificial Intelligence + +Artificial intelligence was used to: + +-Design application architecture +-Generate initial code (frontend, backend, Docker config) +-Explain Docker concepts +-Assist with debugging and troubleshooting +-Prepare documentation + +## Tool used: + +-ChatGPT +-Gemini + +## Pablo Pérez Arcas \ No newline at end of file