ericmoritz / catalog

My toy Haskell catalog service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Catalog service

This is an example catalog service. It will provide a RESTful API to catalog https://schema.org/CreativeWork objects. It is very basic but requires enough functionality to resemble a modern service.

Domain Model

CreativeWork

The data model will simply be a https://schema.org/CreativeWork with the following fields:

This API will be as follows:

  • GET /works/
  • POST /works/{id}
  • DELETE /works/{id}
  • PUT /works/{id}
  • GET /works/{id}

People

The data model of people is a https://schema.org/Person with the following fields:

This API will be as follows:

  • GET /people/
  • POST /people/
  • DELETE /people/{id}
  • PUT /people/{id}
  • GET /people/{id}

Project layout

  • Entity/CreativeWork - Provides the domain types for the works
  • Entity/Author - Provides the domain types for the authors
  • Repository/CreativeWork - Provides the repository interface for works
  • Repository/CreativeWork/Postgres - Provides the repository implementation for Postgres
  • Repository/CreativeWork/Mock - Provides the mock repository implementation for testing
  • Repository/Person - Provides the repository interface for authors
  • Repository/Person/Postres - Provides the repository implementation for Postgres
  • Repository/Person/Mock - Provides the mock repository implementation for testing
  • Transport/HTTP - Defines the RESTful HTTP interface to the CreativeWork and Author services

Testing

In order to test this service I will have to figure out how to swap the repositories with mocks when testing.

Resources:

I have no idea

About

My toy Haskell catalog service

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Haskell 100.0%