3
1 Comment

What's your CRUD workflow?

Hey indies. So when starting a new project, a decent amount of my backend work goes towards creating the CRUD api for my models.

I was wondering how you guys approach building your CRUD apis, and how long it takes you to get from zero to /api/v1.

Feel free to elaborate on any of the following:

  • Do you spec the api beforehand using OpenAPI?
  • Do you use generators or code by hand?
  • Do you adhere to any standard spec like JSON:API?
  • Do you handle security and testing early or late?
  • Do you have a go to error response structure?
  • Are there any packages you can't live without?
posted to Icon for group Developers
Developers
on July 31, 2023
  1. 1

    Hi Mosaab, what kind of backend framework are you using? I mainly use Django with Django Rest Framework (DRF). For straightforward CRUD APIs, DRF has fast way of building the APIs.

    I personally don't spec with Open API before hand for my personal projects because I am comfortable to change them if something doesn't work. But if I am working in a team with a FE developer, I would definitely do it. At least I would map out a loose response structure and discuss with the FE dev.

    I have not used any code generators but I am interested to try them out if you have any recommendations.

    Testing, Authorization and Authentication is handled early on. Django has good extensibility when it comes to easily customizing auth.

    I do have a goto response structure, a json with "detail", "error_code" and "status". I have a little function processing all responses, and I check for exceptions in that.

    I am really dependant on Django at this point. Especially with its ORM and general ease of use. I do want to explore something like FastAPI to get a different perspective. I am also learning Golang, so that will be something I am looking forward to when it comes to implementing APIs in Go.

    What kind of application are you building?

Trending on Indie Hackers
From building client websites to launching my own SaaS — and why I stopped trusting GA4! User Avatar 38 comments The “Open → Do → Close” rule changed how I build tools User Avatar 31 comments I built a tool that turns CSV exports into shareable dashboards User Avatar 24 comments I lost €50K to non-paying clients... so I built an AI contract tool. Now at 300 users, 0 MRR. User Avatar 23 comments Everyone is Using AI for Vibe Coding, but What You Really Need is Vibe UX User Avatar 23 comments Learning Rails at 48: Three Weeks from Product Owner to Solo Founder User Avatar 19 comments