Setting Up the Basic HTML Structure for the AI Short Story Generator
Introduction and Overview
Welcome to the first lesson of our course on building a Short Story Generation Web Application with Flask. In this lesson, we will focus on setting up the basic HTML structure for our application. This foundational step is crucial as it lays the groundwork for the entire web application. By the end of this lesson, you will have a well-structured HTML document that serves as the backbone for our AI Short Story Generator. Let's dive in and start building!
App File Structure
Before we start building the HTML for our story generation interface, let's take a moment to understand how our Flask application is organized. A clear file structure helps us stay organized as our project grows in complexity.
Here's the structure we'll be working with:
Folder Responsibilities
- controllers/: Defines Flask routes and handles incoming requests.
- services/: Contains the logic for formatting prompts and generating stories using AI.
- models/: Deals with story storage and loading of prompt templates.
- templates/ and static/: Support the front-end UI with HTML, CSS, and JavaScript.
- data/: Holds reusable text templates to guide consistent story generation prompts.
- generated_stories/: Where all generated stories are saved for viewing in the history tab.
With this structure in mind, you'll find it easier to understand where each part of the code lives as we build out the HTML and connect it to our Flask backend.
