5 Using Blackbox AI to generate base code

 

This chapter covers

  • Establishing and managing persistent user sessions in Flask-based applications
  • 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, and finding the right balance between AI-generated code and human judgment and logic is key to purposeful development.

We will walk through developing our HAM radio practice exam web app. I’ll focus on using Blackbox AI to generate code and accelerate development. However, I will also 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 cooperation between human expertise and AI. We use the tools to accelerate development through suggestions, while providing context, direction, and corrections. This approach will produce code that surpasses what AI could achieve alone, while also accelerating development compared to human-only workflow. 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

Summary