diff --git a/Dockerfile b/Dockerfile index e032576..85f806b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,8 @@ COPY backend/Cargo.toml backend/Cargo.lock ./ RUN mkdir src && echo "fn main() {}" > src/main.rs && cargo build --release && rm -rf src COPY backend/src ./src COPY backend/migrations ./migrations -RUN cargo build --release +# Ensure we actually rebuild the binary with the real source +RUN touch src/main.rs && cargo build --release # --- Final Image --- FROM debian:bookworm-slim @@ -25,5 +26,6 @@ COPY --from=frontend-builder /app/frontend/build ./frontend/build ENV STATIC_DIR=/app/frontend/build ENV DATABASE_URL=sqlite:/data/attendance.db +ENV JWT_SECRET=change-me-at-runtime EXPOSE 3000 CMD ["./server"] diff --git a/GEMINI.md b/GEMINI.md index 89bc9fd..33965f1 100644 --- a/GEMINI.md +++ b/GEMINI.md @@ -33,6 +33,12 @@ TutorTool is a full-stack web application for tracking student attendance in tut - Node.js & npm - SQLite +### Demo Credentials +- **Admin**: `admin@tutortool.com` / `admin` + +### Environment-specific Fixes +- **btrfs pnpm fix**: Use `--package-import-method copy` when running pnpm. + ### Key Commands - `make dev`: Starts both backend and frontend in parallel (requires `JWT_SECRET` and `DATABASE_URL` in environment). - `make build`: Performs a full production build (frontend first, then backend). diff --git a/Makefile b/Makefile index c862163..773dc41 100644 --- a/Makefile +++ b/Makefile @@ -22,4 +22,4 @@ compose-up: seed-demo: @echo "Seeding demo data..." - sqlite3 $${DATABASE_URL#sqlite:} < backend/migrations/demo_seed.sql + sqlite3 $${DATABASE_URL#sqlite:} < backend/demo/demo_seed.sql diff --git a/backend/migrations/demo_seed.sql b/backend/demo/demo_seed.sql similarity index 100% rename from backend/migrations/demo_seed.sql rename to backend/demo/demo_seed.sql diff --git a/docker-compose.yml b/docker-compose.yml index 66eb1aa..4600fd8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.8' - services: app: build: . @@ -10,4 +8,5 @@ services: environment: - DATABASE_URL=sqlite:/data/attendance.db - STATIC_DIR=/app/frontend/build + - JWT_SECRET=${JWT_SECRET:-dev_secret_for_demo} restart: always