vintasoftware / django-react-boilerplate

Django 5, React, Bootstrap 5 with Python 3 and Webpack project boilerplate
MIT License
1.94k stars 466 forks source link

Set up client API code generation #656

Closed pamella closed 3 months ago

pamella commented 3 months ago

Description

We will use the openapi-ts tool to generate TypeScript client code for the frontend based on the backend schema generated by DRF-Spectacular.

Motivation and Context

Screenshots (if appropriate):

Screencast from 14-05-2024 17:39:51.webm

Steps to reproduce (if appropriate):

Types of changes

Checklist:

pamella commented 3 months ago

Note: the security/snyk step is failing due to an Uncontrolled resource consumption issue on https://github.com/micromatch/braces. The issue was reported yesterday and there isn't a patch yet.

pamella commented 3 months ago

Overall LGTM, but can we add client generation to pre-commit?

I already added it to pre-commit. See: image

The frontend client generation script is triggered whenever the backend schema changes.

fjsj commented 3 months ago

Nice @pamella , then all we need to merge here is passing snyk and explaining the pre-commit client generation on README.

pamella commented 3 months ago

I've made the fixes. I guess we will just have to wait for braces to fix the vulnerability now. Hopefully, the will merge the in-progress PR soon :crossed_fingers:

fjsj commented 3 months ago

I think we need to remove redux mentions from README. @pamella

pamella commented 3 months ago

I think we need to remove redux mentions from README. @pamella

Sorry, I missed it. Done (commit 37d8ba0)