Capstone projects

This part of the JavaScript course is three programs built lesson by lesson, each one growing from a single file into a folder with tests. The task tracker starts with the model and the storage, adds the commands that read process.argv, and ends with a help text, a review of the eight files and a run that includes the tests and the linter. The search engine tokenizes a text, builds an inverted index and ranks the documents it finds. The third project puts that index behind an node:http server and packages the command so that npx can run it. The last lesson looks at what to build next.

12.1 Capstone projects: three programs, built step by step the three projects and their lesson ranges, the folder layout of each, and the four commands that run one step Open 12.2 Capstone A: the task model a Task class with an id, a title and a done flag, the TaskError of a bad field, complete() that returns a copy, and the JSON round trip through toJSON and fromJSON Open 12.3 Capstone A: the task file the version and tasks of the format, a missing file as an empty list, the temp file renamed over the target, and the two messages of a broken file Open 12.4 Capstone A: commands from process.argv add, list, done and remove parsed into one action object, the next id from the highest one, the file loaded and saved around each command, and the status of a task that is not there Open 12.5 Capstone A: tests for the model and the storage node:test and node:assert/strict, a temporary folder per test, the four refusals of the constructor, a missing file and a failing test read line by line Open 12.6 Capstone A: help, usage and the summary line the usage text as lines joined by a newline, the status 2 for a wrong call, the summary line after a change, and three statuses in one session Open 12.7 Capstone A: the tracker in one listing the eight files of the tracker, what each one owns, what changed since lesson 12.2, and a session with the file, the tests and the linter in one run Open 12.8 Capstone B: the tokenizer project B starts: lower-case, a split on everything that is not a letter, a Set of stop words, and a check over a sentence, an empty text and a text of digits Open 12.9 Capstone B: the inverted index three documents, a build loop that keeps one entry per term and one id per document, postings for a word that is there and one that is not, and the map as plain data Open 12.10 Capstone B: ranking the results the candidates the index gives, the count of a query term in a document, a sort by score with the id as the tie break, and four queries with their real order Open 12.11 Capstone B: the index as one module the createSearch facade, twelve tests over the tokenizer and the search, and a check that asserts a fixed answer instead of timing anything Open 12.12 Capstone C: the index over HTTP a copy of the search folder, node:http with one route, a JSON answer with the query, the count and the hits, a 400 and a 404, and a server on port 0 that probes itself Open 12.13 Capstone C: packaging the command the handler moved into a module, the bin and files fields of the manifest, npm pack --dry-run over seven files, and npx running the command from the folder Open 12.14 Where the course ends and what to build next the three projects in one table, the twelve parts of the course, the tests and the lint of the final state, and the directions that follow: a corpus, a database, a page and a published package Open

Lessons