Skip to content

3 ensure frontend backend are in sync by generating typescript types#6

Merged
ttd11204 merged 11 commits into
mainfrom
3-ensure-frontend-backend-are-in-sync-by-generating-typescript-types
Jul 17, 2025
Merged

3 ensure frontend backend are in sync by generating typescript types#6
ttd11204 merged 11 commits into
mainfrom
3-ensure-frontend-backend-are-in-sync-by-generating-typescript-types

Conversation

@ttd11204
Copy link
Copy Markdown
Collaborator

  • Selected openapi-typescript as the OpenAPI-to-TypeScript generator after evaluating tools like swagger-typescript-api and Orval. We chose it for its simplicity, type-only output, and ease of integration with our existing manual client setup. The setup approach was inspired by this article which demonstrates how to combine OpenAPI types with manually written API clients.
  • Script for generating the TypeScript types is configured in package.json. You can run it with: bun run script
  • For now, APIs are called directly inside components. Further abstraction or hook-based integration can be done in future iterations.

ttd11204 and others added 11 commits July 15, 2025 16:42
…chema

- Installed and configured `openapi-typescript` for generating API types
- Used GitHub's public OpenAPI schema as a temporary placeholder:
  https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json
- Generated types to `src/api/types.ts`
- This is a temporary setup until the backend provides the actual OpenAPI schema
- Next steps: replace the sample schema URL with the real backend schema once available
…nd' into 3-ensure-frontend-backend-are-in-sync-by-generating-typescript-types
…inks; update Home component and try to fetch api
…reset

Replaced old manually-configured project due to conflicts between TanStack Start and TanStack Query.

New setup using:
- bun create vite
- React + TanStack Router (file-based routing)
- Tailwind CSS
- ESLint + Shadcn UI components

This provides a stable baseline and avoids versioning or integration issues seen with manual setup.
@ttd11204 ttd11204 merged commit fff872c into main Jul 17, 2025
1 of 2 checks passed
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