5 Using BlackboxAI to Generate Base Code

 

This chapter covers

  • Creating and managing persistent user sessions in a Flask application
  • Implementing database functionality to track question sets
  • Crafting effective prompts for troubleshooting technical errors
  • Applying separation of concerns to improve application architecture
  • Building a session-based user interface for practice tests

Let’s continue our exploration of generative AI tools by building a real web application. Learning to use these tools effectively is an art. Finding the right balance is key - utilizing AI to generate initial code and suggestions, while applying human judgment and logic.

We will walk through developing our Ham Radio practice exam web app. I want to focus on using BlackboxAI to generate code and accelerate development. However, I will intervene at key points to refine the architecture, ensure separation of concerns, inject our own code, and override AI suggestions when needed.

The goal is to demonstrate effective human and AI collaboration. We want the tools to accelerate development through suggestions, while we (the humans) provide context, direction, and corrections. This will produce higher quality code than AI alone could achieve, and it should produce it faster than we would without AI. Let’s continue our journey.

5.1 Application Development with Generative AI tools

5.2 Setting Up the Development Environment

5.3 Developing Core Features

5.3.1 Creating the Database

5.3.2 Connecting to Our Database

5.3.3 Calling our database from the frontend

5.3.4 Refactoring our Questions Class

5.3.5 Modifying our Entry Point (App.py)

5.3.6 Pulling a Set of Questions

5.3.7 Creating a Test Session in the Database

5.3.8 Creating Code for the Test Session

5.3.9 Generating a Question Set

5.3.10 Verifying our Test Session was Created.

5.3.11 Conclusion

5.4 Summary