diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..2d91638 --- /dev/null +++ b/.env.example @@ -0,0 +1,9 @@ +# Database Configuration +DB_HOST=postgres +DB_PORT=5432 +DB_USERNAME=postgres +DB_PASSWORD=postgres +DB_DATABASE=evrak + +# Application +NODE_ENV=development diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7e5c326 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,52 @@ +services: + postgres: + image: postgres:14-alpine + container_name: evrak-postgres + environment: + POSTGRES_DB: evrak + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + ports: + - "5432:5432" + volumes: + - postgres_data:/var/lib/postgresql/data + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U postgres" ] + interval: 5s + timeout: 5s + retries: 5 + + backend: + build: + context: ./backend + dockerfile: Dockerfile + container_name: evrak-backend + environment: + DB_HOST: postgres + DB_PORT: 5432 + DB_USERNAME: postgres + DB_PASSWORD: postgres + DB_DATABASE: evrak + NODE_ENV: development + ports: + - "3000:3000" + volumes: + - ./backend:/app + - /app/node_modules + depends_on: + postgres: + condition: service_healthy + command: npm run start:dev + + frontend: + build: + context: ./frontend + dockerfile: Dockerfile + container_name: evrak-frontend + ports: + - "8080:80" + depends_on: + - backend + +volumes: + postgres_data: diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 50f9a43..17d2640 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -15,8 +15,8 @@ server { proxy_cache_bypass $http_upgrade; } - # Proxy direct backend endpoints (projects, tenants, etc.) - location ~ ^/(projects|tenants) { + # Proxy direct backend endpoints (projects, tenants, tasks, etc.) + location ~ ^/(projects|tenants|tasks) { proxy_pass http://backend:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; diff --git a/frontend/src/components/ProjectDetailPanel.tsx b/frontend/src/components/ProjectDetailPanel.tsx index 8899f36..ebdc0c3 100644 --- a/frontend/src/components/ProjectDetailPanel.tsx +++ b/frontend/src/components/ProjectDetailPanel.tsx @@ -101,6 +101,7 @@ const ProjectDetailPanel: React.FC = ({ projectId, onCl }); setNewTaskTitle(''); message.success('Task added'); + await fetchTasks(project.id); // Refresh the task list }; if (!project) { @@ -195,14 +196,25 @@ const ProjectDetailPanel: React.FC = ({ projectId, onCl renderItem={(task) => ( } onClick={() => deleteTask(task.id)} /> +