Skip to content

Connect parser to DB + improve error handling & field normalization#33

Open
ItsMii176 wants to merge 7 commits intomainfrom
parser-db
Open

Connect parser to DB + improve error handling & field normalization#33
ItsMii176 wants to merge 7 commits intomainfrom
parser-db

Conversation

@ItsMii176
Copy link
Copy Markdown
Collaborator

No description provided.

- Add PostgreSQL schema with foreign key relationships (organizations, students, internships, complete)
- Implement reproducible data seeding with Faker.js
- Create database cleanup utilities for clean development workflow
- Add comprehensive data display functions with relational queries
- Configure Drizzle Kit for database migrations and schema management
- Set up TypeScript compilation and npm scripts for seed/clean/query operations
- Add proper .gitignore rules for node_modules and build artifacts
- Ensure 1:1 student-internship relationships for independent data modeling
Replaces usage of static fake data with dynamic data fetched from a new /api/internships endpoint backed by a PostgreSQL database via Drizzle ORM. Adds database schema, query utilities, data converters, and React hooks for fetching and displaying internships. Updates UI components to use new types and data flow, adds skeleton loaders, and improves error handling and sorting. Cleans up seed scripts and removes unnecessary console logs.
…ization

- Connected the parser to the database, enabling real-time data retrieval
- Implemented HTTP 500 error response when a database read operation fails
- Added a clear error message when no internship/stage entries are found
- Improved normalization logic across various fields to ensure consistent formatting and cleaner data input/output
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR connects the Excel parser to the database, improves error handling in data pipelines, and normalizes fields for consistency across import/export boundaries. It also updates the frontend to consume real data from Supabase instead of fake mocks.

  • Wire up parser output into Supabase insertion scripts
  • Add robust field normalization and validation in import tools
  • Refactor UI components to fetch and display live data

Reviewed Changes

Copilot reviewed 48 out of 55 changed files in this pull request and generated 1 comment.

File Description
src/lib/format-date.ts Parse multi-range date strings and handle French/ISO formats
src/features/internship/internship-card.tsx Migrate card to use InternshipCardData and real database fields
src/features/internship/internship-header.tsx Switch header to count live internships and adjust layout props
Files not reviewed (4)
  • backend/package-lock.json: Language not supported
  • backend/projetParseur/pnpm-lock.yaml: Language not supported
  • pnpm-lock.yaml: Language not supported
  • projetParseur/pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)

src/features/internship/internship-header.tsx:12

  • [nitpick] The prop fakeInternships now holds real data; consider renaming it to internships to avoid confusion and better reflect its purpose.
export function InternshipHeader({ fakeInternships, sort, setSort }: InternshipHeaderProps) {

src/lib/format-date.ts:27

  • The toLocaleDateString call omits the year: 'numeric' option, so the year isn’t displayed. Add year: 'numeric' to the options.
  return date.toLocaleDateString("fr-FR", {

<GraduationCap className="h-4 w-4" />
<span>
{internship.year} - {student.major}
2A - {internship.student.major || "??"}
Copy link

Copilot AI Jul 1, 2025

Choose a reason for hiding this comment

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

The year is hard-coded as "2A" but should use the dynamic internship.internship.year field. Update to ${internship.internship.year} - ....

Suggested change
2A - {internship.student.major || "??"}
{internship.internship.year} - {internship.student.major || "??"}

Copilot uses AI. Check for mistakes.
ItsMii176 added 3 commits July 1, 2025 18:55
Replaces Drizzle ORM with Supabase client for fetching internship, student, and organization data. Updates query logic, sorting, and data transformation to match Supabase's API and response structure. Improves error handling and ensures environment variables are checked for Supabase configuration.
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.

2 participants