Where do we go from here?
You should now have a basic understanding of API design and main concepts. Of course, studying this chapter’s code will deepen your understanding and likely provoke questions. Here are some suggestions if you wish to learn more on the subject:
- Learn FastAPI well. The website offers tutorials both for beginners and advanced programmers. They are quite thorough and cover much more than we could ever include in a single chapter.
- Using the source code from this chapter, enhance the API by adding advanced searching and filtering capabilities. Try implementing a more sophisticated authentication system and exploring the use of background tasks, sorting, and pagination. You could also expand the admin section by adding other endpoints only for admin users.
- Amend the endpoint that books a ticket so that it checks that there are free seats on the train. Each train specifies how many first- and second-class cars there are, as well as the...