Real-time auction engine powered by Kafka and MySQL/MariaDB.
Taurus is the core backend service responsible for authentication, auction management, and bid processing.
-
GET /ping
Health check endpoint. -
POST /register
Creates a new user in MySQL and sets a session cookie. -
POST /login
Validates user credentials and sets a session cookie. -
GET /dashboard
Authenticated endpoint that verifies the session. -
POST /create
Authenticated. Creates a new auction and inserts the initial bid inside a database transaction. -
GET /api/auction/:id
Returns auction details including:- Computed
currentPrice endTimeformatted in RFC3339
- Computed
-
POST /bid
Authenticated.- Validates bid amount
- Inserts bid into database
- Emits a bid event via WebSocket and Kafka
Pisces acts as a lightweight real-time gateway.
-
Kafka Consumer
- Subscribes to topic:
bids
- Subscribes to topic:
-
WebSocket Server
GET /wsupgrades the connection- Adds clients to a broadcast hub
Every Kafka message received is broadcast to all connected WebSocket clients.
Leo is the client application.
-
React + TypeScript + Vite
Fast, modern frontend development stack. -
TailwindCSS
Utility-first styling. -
Radix UI
Accessible, unstyled component primitives. -
Bun
Snappy runtime engine that does everything.
Install:
- Docker
- MySQL or MariaDB
Required ports:
9092โ Kafka3306โ MySQL/MariaDB
docker pull apache/kafka:4.2.0docker run -d \
--name kafka \
-p 9092:9092 \
apache/kafka:4.2.0Enter the container:
docker exec -it kafka bashCreate topic:
/opt/kafka/bin/kafka-topics.sh \
--create \
--topic bids \
--bootstrap-server localhost:9092 \
--partitions 3 \
--replication-factor 1Verify topic:
/opt/kafka/bin/kafka-topics.sh \
--list \
--bootstrap-server localhost:9092Use your system package manager.
sudo systemctl enable --now mariadb
sudo systemctl start mariadb
sudo systemctl status mariadb(Replace mariadb with mysql if using MySQL.)
Login:
mysql -u root -pInside MySQL:
CREATE DATABASE auction_engine;
SHOW DATABASES;
EXIT;From the project root:
mysql -u root -p auction_engine < schema.sqlLogin as root:
mysql -u root -pThen run:
CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON auction_engine.* TO 'user'@'localhost';
FLUSH PRIVILEGES;
EXIT;Create a .env file in the project root:
DB_DSN=user:password@tcp(127.0.0.1:3306)/auction_engine?parseTime=true
Replace:
userโ database userpasswordโ database password3306โ database port (default 3306)
Do not include brackets.
Do not commit .env to version control.
Good. Now we move from โnice architecture diagramโ to โactually runnable system.โ Revolutionary concept.
Youโve got:
tauras/โ Go backend APIPisces/โ Go Kafka + WebSocket gatewayleo/โ Bun + Vite frontend
Hereโs the section you append to your main README.md.
Make sure Kafka and the database are already running before starting the services.
Taurus is the core backend (Go).
cd taurasgo mod tidygo run main.goBy default, Taurus should start on:
http://localhost:8080
Pisces consumes Kafka and broadcasts over WebSockets.
cd Piscesgo mod tidygo run main.goPisces exposes:
GET /ws
WebSocket clients connect to:
ws://localhost:<pisces-port>/ws
Make sure Kafka is running before starting Pisces.
Leo is built with Bun + Vite.
cd leobun installbun run devFrontend will be available at:
http://localhost:5173
