Skip to main content

Posts

FastAPI Tutorial for Beginners: Build a Complete CRUD App From Scratch

Most of my channel is Java and Spring Boot. For this video I wanted a break, so I built something in Python that a complete beginner can finish in one sitting: a to-do app with a real REST API, a real database and a web page on top. It comes to three files and under 130 lines of Python. This post is the written companion to the video. Every code block below is copied from the project, and I ran every request in it against that code before publishing. If you prefer to read, you can build the whole thing from this page. If you prefer to watch, the video is right here. What you'll build A to-do list where you can add a task, tick it off, rename it and delete it. The page talks to an API you write yourself, and the API saves everything in a database, so your tasks are still there after a restart. FastAPI also gives you a free interactive docs page at /docs where you can test every endpoint from the browser. File Its one job index.html The to-do page, styled with Bootstrap. I...
Recent posts

Keycloak with Spring Boot – Full Course | OAuth2, JWT & Role-Based Security

Every serious backend eventually has to answer two questions for every request: who is this? and what are they allowed to do? You can build login, password reset, token issuing, SSO and role management yourself, but it is hard, slow and very easy to get wrong. Or you can hand the whole job to Keycloak and keep your Spring Boot code focused on the business logic. This article is the written companion to my full Keycloak + Spring Boot course on YouTube. We go from zero to a working, role-secured REST API: install Keycloak, set up a realm, client, roles and users, move Keycloak off its default H2 database onto PostgreSQL, test the OpenID Connect endpoints in Postman, and finally protect Spring Boot endpoints with JWTs and Spring Security. Source code: All the code is on GitHub: sprashantofficial/KeycloakSpringBootApp . The complete course is also on Udemy . What We Are Building Two servers run side by side: Keycloak on localhost:8080 and our Spring Boot API on localhost:8082 . ...