Small booking api created in order to learn microservices
- 4 microservices (auth, notifications, payments, reservations)
- asynchronous messaging between microservices implemented using Kafka
- full auth with jwt tokens
- Kubernetes config
Typescript, Nestjs, Stripe, Docker, Kafka, PostgreSQL, Kubernetes, Helm
- Setup .env - see this
- Run
docker compose up -d
- Api
- localhost:3000 - reservations endpoint
- localhost:3001 - auth endpoint
- POST localhost:3001/auth/register - register
- POST localhost:3001/auth/login - login
- GET localhost:3001/auth/me - own account data
- POST localhost:3000/reservations/ - create reservation
- GET localhost:3000/reservations/ - view all reservations
Create .env file in top directory
Example env for local development with Docker (external tokens are left empty and to be filled by yourself)
KAFKAJS_NO_PARTITIONER_WARNING=1
DATABASE_URL="postgresql://postgres:postgres@postgres:5432/db?schema=public"
KAFKA_BROKERS="kafka:9094"
# Optional for kafka sasl credentials
#KAFKA_API_KEY=
#KAFKA_API_SECRET=
STRIPE_SECRET_KEY=
JWT_SECRET=supersecret
JWT_EXPIRATION=3600
# Email notifications
GOOGLE_OAUTH_CLIENT_ID=
GOOGLE_OAUTH_CLIENT_SECRET=
GOOGLE_OAUTH_REFRESH_TOKEN=
SMTP_USER=