https://github.com/eddie4k-code/sneakerstop
a PoC Sneaker Marketplace API built on event-driven architecture
https://github.com/eddie4k-code/sneakerstop
apache-kafka docker event-driven-architecture github-actions kubernetes microservices nginx open-telemetry python terraform typescript
Last synced: about 2 months ago
JSON representation
a PoC Sneaker Marketplace API built on event-driven architecture
- Host: GitHub
- URL: https://github.com/eddie4k-code/sneakerstop
- Owner: Eddie4k-code
- Created: 2024-04-23T22:29:35.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-26T22:42:15.000Z (7 months ago)
- Last Synced: 2025-04-04T04:43:46.657Z (about 2 months ago)
- Topics: apache-kafka, docker, event-driven-architecture, github-actions, kubernetes, microservices, nginx, open-telemetry, python, terraform, typescript
- Language: TypeScript
- Homepage:
- Size: 1.25 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: ReadMe.md
Awesome Lists containing this project
README
# Sneaker Marketplace PoC
P.S (This has been by far my favorite side project so far xD)
## Overview
This project is a proof of concept for a sneaker marketplace built on a microservices architecture, utilizing Kafka for event-driven communication between services. Docker and Kubernetes are employed for containerization and orchestration, with Terraform used for provisioning Kubernetes manifests.
## Architecture
The architecture of the system is based on microservices, each serving a specific function within the sneaker marketplace ecosystem. Kafka acts as the central event bus for communication between these services, enabling decoupling and scalability.
## Swagger API Documentation
This project uses Swagger for API documentation. You can access the Swagger UI for different services to explore and test the API endpoints.
- **Sneaker Service**: [http://localhost/api-docs/sneakers](http://localhost/api-docs/sneakers)
## What About Order of Events/Messages?
Kafka provides the ability to associate keys with messages. When a message in Kafka is sent with a key, all messages sharing the same key will always go to the same parition in a topic. This helps maintain proper ordering of messages. Without a key, messages are distributed in a round-robin fashion across paritions in a topic.## What About Duplicate Events?
### Idempotent
Within the Kafka Producers we have set `idempotent` to `true`. This configuration will help ensure that duplicate messages are not introduced due to events such as unexpected retries. When a producer sends a message, it will be assigned a Producer Id. The Kafka Broker will keep track of the largest PID-Sequence number combination sucessfully written, discarding lower sequence numbers.## CI/CD Workflow
### TODO ADD## Runbook
### Provision Infrastructure
#### Terraform Environment Variables
Generate a .tfvars file in the appropriate environment directory (dev, stage, prod) including the following variables -jwt_secret
stripe_secret#### Command
Within the root directory `make apply` will provision all needed infrastructure.### Tear-Down Infrastructure
Within the root directory `make destroy` will destroy all provisioned infrastructure.## Main Technologies Used
- Typescript
- Express
- Node.Js
- Kafka
- Docker
- Kubernetes (k8s)
- Terraform