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
19 changes: 19 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# PostgreSQL
POSTGRES_DB=taskflow
POSTGRES_USER=taskflow
POSTGRES_PASSWORD=taskflow_password

# Spring Boot datasource (used by API container)
SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/taskflow
SPRING_DATASOURCE_USERNAME=taskflow
SPRING_DATASOURCE_PASSWORD=taskflow_password

# JWT — MUST be changed in production (min 32 chars)
JWT_SECRET=REPLACE_WITH_64_CHAR_RANDOM_STRING # e.g. openssl rand -hex 32

# CORS — comma-separated list of allowed frontend origins
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173

# Frontend API URL (baked into React build at docker compose build time)
VITE_API_URL=http://localhost:8080

84 changes: 84 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
# ── Backend ────────────────────────────────────────────────────────────────
backend:
name: Backend — Test & Build
runs-on: ubuntu-latest

services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DB: taskflow_test
POSTGRES_USER: taskflow
POSTGRES_PASSWORD: taskflow_password
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 10

defaults:
run:
working-directory: backend

steps:
- uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven

- name: Run tests
run: mvn verify -B
env:
SPRING_DATASOURCE_URL: jdbc:postgresql://localhost:5432/taskflow_test
SPRING_DATASOURCE_USERNAME: taskflow
SPRING_DATASOURCE_PASSWORD: taskflow_password
JWT_SECRET: ci-test-secret-at-least-32-characters-long

- name: Build JAR (skip tests — already ran)
run: mvn package -B -DskipTests

# ── Frontend ───────────────────────────────────────────────────────────────
frontend:
name: Frontend — Lint & Build
runs-on: ubuntu-latest

defaults:
run:
working-directory: frontend

steps:
- uses: actions/checkout@v4

- name: Set up Node 20
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
cache-dependency-path: frontend/package-lock.json

- name: Install dependencies
run: npm ci

- name: Type-check
run: npx tsc --noEmit

- name: Build
run: npm run build
env:
VITE_API_URL: https://placeholder.up.railway.app # real URL set in Netlify env vars

31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ── Secrets / Environment ────────────────────────────────────────────────────
.env
.env.local
.env.*.local
!.env.example # keep the example template (no real secrets in it)

# ── Frontend ──────────────────────────────────────────────────────────────────
frontend/node_modules/
frontend/dist/
frontend/.vite/
frontend/coverage/

# ── Backend ───────────────────────────────────────────────────────────────────
backend/target/
backend/.mvn/wrapper/maven-wrapper.jar
backend/*.log

# ── Java / IDE ────────────────────────────────────────────────────────────────
*.class
*.jar
*.war
.idea/
*.iml
.DS_Store

# ── Docker ────────────────────────────────────────────────────────────────────

# ── Logs ─────────────────────────────────────────────────────────────────────
*.log
logs/

Loading
Loading