Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big upgrade: ChakraUI v3, Fastapi service & repository structure, better navbar header, backend unittest db isolation, and more! #1461

Conversation

peter-cognicode
Copy link

@peter-cognicode peter-cognicode commented Jan 15, 2025

I decided to do a big upgrade on this project to make it more ready for larger applications. Therefore i removed the crud file in favor of a service and repository structure. This helped me a lot in the past preventing duplicate code. Also i migrated the frontend to chakraui v3 and vite v6

I don't know if this is too big for you to review, please let me know how i can help to get this merged so more people can benefit from these upgrades.

Help needed / Questions:

  • Do we still want the custom theme? it felt a bit of overkill on an example template. Since chakraui changed the way of working, i opted for the default colors for now.
  • frontend client generation github action is failing.. I removed the formatter on the generated client code (./scripts/generate-client.sh), since with new biome version it gave too many exceptions. But i dont know what is going wrong now. Maybe a different python version.. im using 12 and github is using 10?

Changes

Major changes:

  • frontend to chakraui 3.3.1
    • updated all components
    • simplified form structure with label property and automatic ids
    • added custom RouteLink for tanstack router integration
    • added pagination component
    • added system default to darkmode setting page
  • frontend menu improvements
    • added top navbar with fastapi logo and better flex styling
    • improved sidebar
  • backend to service and repository structure
    • removed crud folder, it is not scalable
    • avoids duplicate code & improves folder structure for larger apps
  • backend tests using separate database app_test
    • automatically created in postrges docker via .env
    • this avoids localdev data pollution while testing
    • playwright still uses the normal running app and database

Minor changes:

  • upgraded all dependencies in frontend
  • fixed python version to <13 because i got errors on python 13
  • improved configuration of tooling so it works in vscode (eg biome)
  • improved VSCode configuration + setting.example.json (to avoid overwriting local settings)

Screenshots

home:
image
items:
image
settings:
image

add item:
image

mobile view:
image
image

@peter-cognicode peter-cognicode changed the title upgrade backend and frontend to latest Big upgrade: ChakraUI v3, Navbar header, Fastapi service & repository structure, unittest db isolation, and more! Jan 15, 2025
@peter-cognicode peter-cognicode changed the title Big upgrade: ChakraUI v3, Navbar header, Fastapi service & repository structure, unittest db isolation, and more! Big upgrade: ChakraUI v3, Fastapi service & repository structure, Navbar header, backend unittest db isolation, and more! Jan 15, 2025
@peter-cognicode peter-cognicode changed the title Big upgrade: ChakraUI v3, Fastapi service & repository structure, Navbar header, backend unittest db isolation, and more! Big upgrade: ChakraUI v3, Fastapi service & repository structure, better navbar header, backend unittest db isolation, and more! Jan 15, 2025
@peter-cognicode peter-cognicode force-pushed the upgrade-backend-frontend branch 5 times, most recently from 97d7183 to f23cc0c Compare January 15, 2025 21:21
@peter-cognicode peter-cognicode force-pushed the upgrade-backend-frontend branch from f23cc0c to 4760ede Compare January 15, 2025 21:38
@tiangolo
Copy link
Member

Thanks for your interest! ☕

This PR has many changes for different things. It would be necessary to split it into different PRs for each individual topic that needs to be reviewed, tweaked, and latter accepted or rejected. But if everything is together in a single PR it's not possible to handle each subject individually. 🥲

One of the big changes here is the migration to Chakra UI v3, this was handled in this other PR: #1496. We already had it in the backlog with a plan to handle it, ensure the styles kept consistent, etc.

For the other changes, apart from being in individual PRs, it might also be better to start with a discussion with your ideas to see if I would want to have them in the project before you invest too much time in working on them.

For now I'll pass on this one, but if you want, feel free to create new discussions or PRs with individual ideas. 🤓 🍰

@tiangolo tiangolo closed this Feb 17, 2025
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