Lab 2 - Building Scalable and Efficient FastAPI Applications
Solutions
Overview
In this lab, guide your students through setting up their development environment and creating foundational API endpoints using FastAPI for managing clients and their marketing campaigns (or pharmaceutical trials).
These exercises are designed to build proficiency in constructing robust APIs for various industries. Encourage students to ask questions and explore as they progress through their coding journey.
May the code be with them! 🌟 ## Goals
You will help students achieve the following:
Asynchronous Programming: Improve performance when handling multiple client requests by implementing asynchronous programming techniques.
CRUD Routes: Create routes for managing clients and their marketing campaigns, allowing for full Create, Read, Update, and Delete operations.
Database Integration: Integrate a database to store client and campaign information, ensuring reliable and structured data management.
Dependency Injection: Apply dependency injection to maintain modularity and facilitate easier testing and maintenance of the code.
Testing with
pytest
: Write comprehensive tests usingpytest
to verify that client and campaign operations work as expected.Client Data Security: Secure sensitive client data by implementing authentication and authorization mechanisms.
Performance Optimization: Utilize performance optimization techniques to ensure the API remains efficient under high loads.
Marketing Agency API
Healthcare Management API
This project is optional and intended for students who feel comfortable taking on an additional challenge.
The full project solution folder will be available soon