Skip to content

7 min read

American Corners

Capstone: build your project

What the capstone is for

Everything so far has been practice for this: one project of your own that ties the course together. The goal is not to build something large or impressive. It is to show that you can take an idea, organise it with the tools you have learned, and finish it. A small project that works and that you understand fully is worth far more than an ambitious one left half-built.

Your capstone has two parts that you already have the skills for: an object-oriented program that models some information with classes and objects, and a simple web page that presents it. Keeping the project small is the real skill here. Choose something you could describe to a friend in one sentence.

Choosing a project you can finish

The best capstone ideas come from something you actually know. If you can list the pieces of information involved and the handful of things you want to do with them, it is a good candidate. A few honest, finishable examples:

  • A personal library, where each book has a title, a number of pages and whether you have read it.
  • A recipe box, where each recipe has a name, a list of ingredients and a number of servings.
  • A simple budget, where each entry has a description, an amount and a category.

Notice the shape they share. Each one is a collection of similar items, and each item has a few clear attributes. That shape maps cleanly onto a class, which is exactly why it makes a good project. Pick one, or invent your own in the same mould, and write down in one sentence what it does before you write any code.

The object-oriented part

Start with the program, because it holds the thinking. Define a class for your item, give it the attributes that matter, and add a method or two for the things you want to do. Here is the skeleton for the personal-library idea.

class Book:
    def __init__(self, title, pages):
        self.title = title
        self.pages = pages
        self.read = False

    def mark_read(self):
        self.read = True

library = [
    Book("The Long Road", 320),
    Book("Winter Notes", 180),
]
library[0].mark_read()

That is the heart of the project: a Book class with clear attributes and a method, and a list holding several Book objects. Everything else builds on this. If your class models the thing well and you can create objects and change them, the hard part is done.

The web page part

Now present it. You do not need the web page to talk to the Python program automatically; for a capstone it is enough to show the same information as a real page you have styled. Take the objects your program produces and lay them out with the HTML and CSS you learned, then add a small touch of JavaScript for interactivity if you have time.

<h1>My library</h1>
<ul>
  <li>The Long Road - read</li>
  <li>Winter Notes - not yet</li>
</ul>

Style it with a short CSS file, and if you want one interactive touch, a button that reveals or hides the books you have already read is a natural fit for the DOM work from the last lesson. Small and finished beats large and broken.

Planning it as milestones

The way projects fail is by being attempted all at once. Break yours into milestones you can complete and check off one at a time, and do them in order.

  1. Write the class and create a few objects. Run it and confirm the objects hold the right data.
  2. Add the method or two you need, and test that they change an object as expected.
  3. Build the plain HTML page that lists your items.
  4. Add a CSS file to style it.
  5. If time allows, add one small piece of JavaScript interactivity.

Tip

Finish each milestone before starting the next, and make sure it actually runs before moving on. A working project at milestone three is a real result you can present; a project stuck between five half-done ideas is not. Stop at whatever milestone leaves you something complete.

By the end you will have something modest and entirely yours: a program that models an idea with objects, and a page that shows it off. That is the whole course in one piece of work, and it is genuinely something to be proud of.

Check yourself

  1. The capstone joins an object-oriented program with a web page. For a project idea of your own, what would the class be, and what two or three attributes would each object have?
  2. Why is it better to break the project into ordered milestones and finish each before the next, rather than building all the parts at once?
  3. You run low on time after building and styling the page. Based on the advice here, is it wiser to add a rushed extra feature or to stop, and why?

Where this lesson comes from

Built from

  • Data Structures and Algorithms: capstone project

alphaPlan courses are built from taught programmes rather than invented for the web. Where a claim rests on an outside standard or a reported case, it is named above so you can check it rather than take our word for it.

This course was developed by alphaPlan Center from programs delivered in partnership with the American Corners network.

Found something unclear, outdated or improvable? Suggest an improvement