Skip to content

feat: Add Docker Compose setup for backend service and fix ideas.even…#99

Open
annegoldriver wants to merge 1 commit intoflushingtech:mainfrom
annegoldriver:feature/setup-codespaces-and-schema-fix
Open

feat: Add Docker Compose setup for backend service and fix ideas.even…#99
annegoldriver wants to merge 1 commit intoflushingtech:mainfrom
annegoldriver:feature/setup-codespaces-and-schema-fix

Conversation

@annegoldriver
Copy link

This PR introduces a Dockerfile and updates docker-compose.yml to allow the backend service (Node.js application) to be run and managed as a Docker container, alongside the PostgreSQL database.

It also includes a crucial database schema fix in src/db/schemas/schemas.ts.

Why the schema fix was needed:
The ideas.eventId column was previously defined as text, but it attempts to reference events.id, which is an integer. This caused a foreign key constraint error (Key columns "event_id" and "id" are of incompatible types: text and integer) during database migrations. The fix changes ideas.eventId to integer to resolve this type mismatch and ensure proper database relationships.

How to test/verify:
After pulling these changes, team members should be able to set up and run the backend by following these steps:

  1. docker-compose up -d --build (to build the backend image and start services)
  2. docker-compose exec backend npm run db:migrate (to apply the schema changes and ensure the database is set up correctly)
  3. docker-compose exec backend npm start (to run the application)

@annegoldriver annegoldriver requested a review from a team as a code owner August 11, 2025 06:41
@vercel
Copy link

vercel bot commented Aug 11, 2025

@cs-sally is attempting to deploy a commit to the flushingtech Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@gent1999 gent1999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the schema change for ideas.event_id, that column is currently a text type by design so we can store multiple event IDs (comma-separated) for a single idea. Switching it to an integer would limit us to one event per idea and break some of our existing routes like /add-event-to-idea. For now, I’ll need to reject this PR to avoid that impact.

Copy link
Contributor

@wilrnh wilrnh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @unisally thx for helping address these 2 issues! It would help make it easier to review if we can split this PR into 2 separate PRs: one for the docker changes and one for the migrations fix.

For the docker changes, could you also please state any clear benefits you saw for adding the app to docker in this PR? Maybe this was already discussed with the team and I missed it, but it would also help if we can document the reasons for it here. It would also help us review this addition so that we are sure it's providing the benefits that were intended.

For the migrations fix, if migrations are currently failing because of a foreign key error, lets definitely discuss the best way to fix that!

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants