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.
- Simulated database query through an API endpoint
- Filtering results based on query parameters
- Node.js (version 20)
- pnpm (version 8.15)
-
Clone the repository:
git clone https://github.com/vinicastroo/fillout-test.git cd fillout-test
-
Install the dependencies:
pnpm i
-
Start the server:
pnpm run dev
-
The API will be available at
http://localhost:3333
.
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
}
[
{
id: "nameId",
condition: "equals",
value: "Timmy",
},
{
id: "birthdayId",
condition: "greater_than",
value: "2024-02-23T05:01:47.691Z"
}
]
No responses are returned, because even though Timmy matches the name, but the birthday is not greater than the one in our filter.