Web application for exploring Czech vehicle registration data. The project is built with Next.js, Prisma, PostgreSQL, Redis and Elasticsearch.
Create a .env file in the project root. At minimum it should define your database credentials:
POSTGRES_USER=your_user
POSTGRES_PASSWORD=your_password
POSTGRES_DB=registrations
These variables are consumed by the entrypoint script and Docker services to configure connections to PostgreSQL, Redis and Elasticsearch.
Build and start the entire stack (Next.js app, PostgreSQL, Redis, Elasticsearch and Nginx proxy):
docker-compose up --build
The application will be available at http://localhost:3000.
Install dependencies and start the development server:
yarn install
yarn dev
The dev script wraps next dev with the project entrypoint.sh so environment variables are loaded from .env.
The db directory provides command-line utilities for downloading source CSVs, creating tables and indices, and syncing data into PostgreSQL and Elasticsearch.
cd db
yarn start <command> [args]
Commands from src/index.js:
download– fetch CSV data defined indownload/mapping.json, import each table and refresh indicesimport <tableName>– importdata/<tableName>.csvinto PostgreSQLindices <create|refresh>– create database indexes or refresh themtable <tableName>– create a table from headers inschemas/<tableName>query "<SQL>"– run arbitrary SQLelastic <create|sync> [startId]– create the Elasticsearch index or sync data starting from an optional IDvisits– create thevisitstracking table
If you prefer to run these helpers in an isolated container:
./build-infra.sh # builds the infra-image from ./db
./run-infra.sh <command> [args]
run-infra.sh attaches the container to the registrations-server_app_network, loads variables from .env, and mounts ./data so the commands can access downloaded CSVs and your database.
To create a production build and serve it locally:
yarn build
yarn start
Docker helper scripts such as build-nextjs-runner.sh and docker-compose.prod.yml are provided for containerized deployment.