Files
yohoho/README.md
Benjamin Sigonneau 449a4a7d75 Add unit and integration tests
I won't be lying, Claude Code was extremely helpful to write those
tests, although it had a lot of issues with properly using in-memory
SQLite (db and integration tests) and with parsing responses
(integration test).
2026-02-01 06:00:12 +01:00

2.0 KiB

Yohoho - A take-home assignment for HolidayPirates

This is my take on the take-home assignment I was given for the Backend Engineer position at HolidayPirates.

The goal is to implement a very small REST API in Clojure. That API provides two endpoints :

  • POST /items: creates an item
  • GET /items: returns the list of items

Running and testing

This project uses Leiningen. Assuming you already have Leiningen installed, running the API should be as easy as cloning the repo and issuing lein run. By default, the server listens on port 3000. To explore the API using Swagger UI, you can head to http://localhost:3000/doc.

To run the unit and integration tests: lein test

Structure

The source code lies in /src/yohoho and is structured as follows:

  • app.clj: ring app and main entrypoint
  • config.clj: configuration (database and HTTP server)
  • db.clj: functions that directly interact with the database
  • handlers.clj: route handlers
  • helpers.clj: the infamous file that holds function that are useful but couldn't fit anywhere else
  • routes.clj: API routes
  • schemas.cls: Malli schemas used for validation

Library choices

  • reitit: for handling routes
  • jetty: web server
  • muuntaja: JSON handling
  • next.jdbc: database interface (SQLite)
  • malli: validation

The following links proved more than useful when working on this assignment: