π Building a Full-Stack Web Application with FastAPI
In this section, we will leverage the power of FastAPI to build a complete full-stack web application.
The application we will develop is a Todo application, similar to the RESTful API projects we previously created. However, this time we will take things a step further by implementing a fully functional user interface, allowing users and clients to interact directly with the application through a web browser.
π₯οΈ Adding a User Interface
Unlike earlier projects that focused purely on backend APIs, this project will include a frontend interface. This will allow users to:
View their tasks
Create new Todo items
Update existing tasks
Manage their personal task list
By integrating both the backend and frontend, we will create a complete web application experience.
π Implementing Secure Authentication
Security is an essential part of modern web applications. In this project, we will implement a secure authentication system using:
Bcrypt β for securely hashing user passwords
JWT (JSON Web Tokens) β for authentication and user verification
This ensures that user credentials are protected and that only authenticated users can access their own data.
πͺ Using Cookies for Authentication
In previous projects, we transmitted JWT tokens through JSON responses.
In this application, we will take a slightly different approach.
Instead of sending JWT tokens through JSON, we will:
Store the JWT token inside browser cookies
Allow the frontend application to automatically include the token with requests
Improve the overall authentication flow for the user interface
This approach more closely resembles how real-world web applications manage authentication.
π What to Expect in This Section
This section is larger and more advanced than previous ones. However, by the end of it, you will have built a fully functional full-stack web application.
You may also notice that the project structure and code organization will look slightly different from earlier projects in this course.
Do not worry β everything will be explained step by step, ensuring that you clearly understand how the entire system works.
π¬ Next Steps
In the next video, we will begin creating and setting up the full-stack application code that will power our Todo application.
This is where the real development journey begins.
π Summary
In this section, we will:
Build a full-stack Todo web application
Add a complete user interface
Implement secure authentication with Bcrypt and JWT
Store authentication tokens using browser cookies
Learn a slightly different project structure and workflow
By the end of this section, you will have the skills to build real-world full-stack applications using FastAPI.