This is the takehome project by Bilby.ai which implements tRPC and an ElasticSearch Database in a SvelteKit project to create a dashboard showing web traffic analytics of various countries.
-
Install dependencies with
npm install
(orpnpm install
oryarn
). -
Rename
.env.example
to.env
and add the env information from this link -
Start a development server:
npm run dev # or start the server and open the app in a new browser tab npm run dev -- --open
To run this project, you will need to add the following environment variables to your .env file
ELASTIC_SEARCH_CLOUD_ID
ELASTIC_SEARCH_API_KEY
ELASTIC_SEARCH_INDEX
In addition to the libraries provided in the initial repository, some essential libraries have been installed libraries have been installed
- shadcn-svelte - A tailwind component library for Svelte
- mode-watcher - A dark/light mode theme manager for Svelte.
- d3 - A data-visualization library for javascript.
- lucide-svelte - A library for icons.
- svelte-persisted-store - A svelte library to sync the stores with LocalStorage.
This project features a fullstack SvelteKit application with the following features -
- typesafe tRPC calls to the Elasticsearch database.
- Parsing of the Elasticsearch response in the backend.
- Heatmap generation using d3.js
- Persistent user preferences in LocalStorage.
- Dark and light mode support.
- Accessibility support using shadcn components.
trpc.uniqueVisitors.getUniqueVisitorsByCountry.query({initialDate, finalDate})
Parameter | Type | Description |
---|---|---|
initialDate |
string |
Required. Initial date in ISO 8601 format for the query |
finalDate |
string |
Required. Initial date in ISO 8601 format for the query |
Client: SvelteKit, Tailwind, Typescript, shadcn-svelte, lucide-icons, d3
Server: SvelteKit, Typescript, tRPC, Elasticsearch DB, DQL