Fillout API Test

This repository contains a test project for Fillout, consisting of an API that simulates querying a database. The API has a single route that accepts a query through query parameters and returns filtered results based on the provided query. The details of the test can be found here.

Features

  • Simulated database query through an API endpoint
  • Filtering results based on query parameters

Prerequisites

  • Node.js (version 20)
  • pnpm (version 8.15)

Installation

  1. Clone the repository:

    git clone https://github.com/vinicastroo/fillout-test.git
    cd fillout-test
  2. Install the dependencies:

    pnpm i

Usage

  1. Start the server:

    pnpm run dev
  2. The API will be available at http://localhost:3333.

Example

Given a sample list of responses like this (this response doesn’t match the ones you have on the test account exactly):

{
	"responses": [
		{
			"questions": [
				{
					"id": "nameId",
					"name": "What's your name?",
					"type": "ShortAnswer",
					"value": "Timmy"
				},
				{
					"id": "birthdayId",
					"name": "What is your birthday?",
					"type": "DatePicker",
					"value": "2024-02-22T05:01:47.691Z"
				},
			],
			"submissionId": "abc",
			"submissionTime": "2024-05-16T23:20:05.324Z"
		},
	],
	"totalResponses": 1,
	"pageCount": 1
}

Input:

[
	{
		id: "nameId",
		condition: "equals",
		value: "Timmy",
	},
	{
		id: "birthdayId",
		condition: "greater_than",
		value: "2024-02-23T05:01:47.691Z"
	}
]

Output

No responses are returned, because even though Timmy matches the name, but the birthday is not greater than the one in our filter.