Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Capstone project: a Lua package for your portfolio

Objectives: LO-6.1–6.3, LO-11.1–11.4, LO-12.1, LO-12.3, and the objectives of the idea you choose, which the table below lists
When: a proposal after Module 11, a milestone after Module 13, and the release after Module 14, as the suggested pace places them
Checking your work: the course’s project checker, and the checklists and rubric below
Time: about 25 hours: about 2 for the proposal, 10 more by the milestone, and 13 more for the release

The capstone project is a Lua package that you design, build, and release as version 1.0.0, finished well enough to show an employer. It is of intermediate size: it uses what Modules 1–12 teach, from tables and patterns to packaging and measuring, and it needs no C. The Lua projects showed that you can meet a handout’s specification. A portfolio project shows how you work: how you scope a problem, test it, document it, and measure it. So this brief asks for the quality of PA5, plus what a stranger needs to trust and use your code: a clear README.md, a license, a changelog, a tagged release, and continuous integration (CI), which runs your checks on every change you push.

Choose an idea

Pick one of these ideas, or propose your own of a similar size. Each lists the objectives it practices beyond the ones every project does, and a hot path worth measuring.

IdeaWhat it doesObjectives it addsA hot path to measure
A log analyzerA command that reads web-server access logs, filters the lines by status, path, or time, and prints the busiest paths and the share of each status codeLO-4.2, LO-10.1, LO-10.2Parsing each line
A template engineA module that renders text templates with {{name}} fields, sections that repeat for each item of a list, and HTML escaping, without ever running a template as Lua codeLO-4.2, LO-5.2, LO-10.3Rendering one template many times, before and after compiling it once into closures
A configuration readerA module that reads INI files into tables, checks them against a schema of types and defaults, and reports every error with its line numberLO-2.4, LO-4.2, LO-6.1, LO-10.3Reading a file of many thousands of lines
A Markdown-subset converterA command that turns headings, paragraphs, emphasis, lists, inline code, and links into HTML, and escapes everything elseLO-4.2, LO-4.4, LO-10.1Converting a long document, and how the output is built
A collections libraryA module of data structures built with metatables: a priority queue on a binary heap, a least-recently-used (LRU) cache, and a set with +, -, and __tostringLO-3.4, LO-7.1, LO-7.2, LO-8.1Pushing and popping the heap, against sorting a list after every push

An idea of your own works if it has a small core you can finish in about 10 hours, that busted can test, and a loop that runs often enough to measure. Avoid ideas whose core needs something the course didn’t teach, such as a network protocol or a graphical interface.

What every project includes

Continuous integration

GitHub Actions runs a workflow, a YAML file in .github/workflows/, on GitHub’s machines whenever you push. This one builds the course’s Lua 5.4.8 and LuaRocks with hererocks, installs busted and luacheck, and runs both. Save it as .github/workflows/check.yml, and add bin to the luacheck line if your project has commands:

# Run the linter and the tests on every push and pull request.
name: "check"

on:
  push:
  pull_request:

permissions:
  contents: read

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
        with:
          python-version: "3.12"
      - name: "Build Lua 5.4.8 and LuaRocks 3.13.0"
        run: |
          pip install hererocks==0.25.1
          hererocks .lua -l "https://github.com/lua/[email protected]" -r "https://github.com/luarocks/[email protected]" --no-readline
      - name: "Install busted and luacheck"
        run: |
          .lua/bin/luarocks install busted 2.3.0-1
          .lua/bin/luarocks install luacheck 1.2.0-1
      - name: "Lint"
        run: .lua/bin/luacheck src spec
      - name: "Test"
        run: .lua/bin/busted --lpath='./src/?.lua'

Each uses: line names an action by the hash of one exact commit, with its version in a comment, so the workflow runs the same code every time. The build passes --no-readline because GitHub’s ubuntu-latest machines don’t have the readline headers. Readline only adds line editing to the interactive lua prompt, which the workflow never uses. Add .lua/ to your .gitignore, so a local run of the same commands doesn’t commit the built Lua.

Checking your project

Run the course’s checker before each checkpoint. It builds a copy of your project and runs every tool, as a reviewer would:

python courses/lua101/tools/check_project.py path/to/your/project --lpath='./src/?.lua'

It prints ok or FAIL for each check: the rockspec’s lint and build, luacheck, StyLua, lua-language-server, the tests, and each file’s coverage.

Checkpoints

CheckpointWhenWhat you have
ProposalAfter Module 11PROPOSAL.md, one page
MilestoneAfter Module 13The core, working, tested, packaged, and checked by CI
ReleaseAfter Module 14Version 1.0.0, tagged, with everything in “What every project includes”

The proposal

One page, PROPOSAL.md, with these sections:

  1. What it does, in two or three sentences, who would use it, and which idea it follows.

  2. Its interface: the modules and functions, or the commands, with one example of use each.

  3. How you will test it, including the failures you will test.

  4. The hot path you expect to measure, and why you expect it to matter.

  5. Risks: what you don’t know yet how to do, and your fallback if it doesn’t work.

Before you build, check that the core fits in about 10 hours, that every public function or command has an example, that the test plan includes failures, and that the hot path runs often enough to measure. If not, cut the core down until it does.

The milestone

The release

Everything in “What every project includes”, with the tag v1.0.0 on the commit you release. Then ask someone who hasn’t seen the project to install it and run your README.md’s example, using only the README.md. Whatever stops them is the next thing to fix.

Publishing it

A portfolio project needs a place where others can see it, usually a public repository on GitHub. Publishing is your choice. Before you make the repository public, check that it holds no secrets, no one’s personal data, and nothing you don’t have the right to share, and that every piece of code you adapted is cited with its license. Point the rockspec’s source.url at the repository, and its source.tag at v1.0.0, as Module 11 shows.

Going further

These extensions are optional. Each takes one of the last modules further, and makes the project stand out, but none is needed for a finished capstone.

Rubric

Score your release with this rubric. The course has no grades: the levels show how close each part is to ready for a portfolio.

CriterionPortfolio-readyAlmost thereNot yet
FunctionDoes what PROPOSAL.md promised, or what a change recorded in CHANGELOG.md promisedOne promise missing or brokenSeveral missing
Tests and coverageTests for every public function, edge, and failure; every line never run is tested or explainedGaps in the failures or the edgesFew tests
Package and toolingBuilds as a rock, and every tool reports nothingOne tool reports somethingDoesn’t build
PerformanceA measured hot path, a change justified by how Lua works, and times before and after, with conditions and runsA speed-up without a method, or a method without a speed-upMissing
DesignClear modules with one job each, failures reported by Lua’s conventions, and LuaCATS on every public functionWorks, but hard to follow in placesHard to follow throughout
README.mdA stranger can install the package and run its example from the README.md alone, and the design notes explain real trade-offsComplete, but unclear in placesMissing installation, an example, or the design notes
ReleaseLICENSE, CHANGELOG.md, the tag v1.0.0, and CI passing on the tagged commitOne of the four missingTwo or more missing

Policies

The course’s policies apply. Generative AI tools are allowed in the capstone project, with disclosure: your README.md must say which tools you used, for which parts, and how you checked what they produced. A portfolio is a claim about your own work, so be exact about what you wrote. Write your own project, and cite any code you adapted, with its license.