Skip to content

martinscooper/url-shortener

Repository files navigation

URL shortener

Stack

  • Backend: nodejs + express
  • Frontend: pure html + js
  • Database: mongodb
  • Cache: redis
  • Queue: bull.js
  • Node version: v20.12.2 (must accept --node-env parameter)

Stress test

node stress_test.js

Express server

Local

Single server:

npm run start 

Cluser mode: starts as many severs as cpus available.

npm run cluster

Production

Single pod:

docker build -t image-name .
docker push image-name
kubectl apply deployment/express-deployment

NodePort service to make the pod accesible from outside of the cluster:

kubectl apply deployment/express-service

Redis

Used as a cache for hash-url search and as a queue for visit count storage.

Local

redis-server

Production

Single redis pod:

kubectl apply deployment/redis-deployment

Helm chart

helm install my-redis bitnami/redis

Mongodb

Using a free Atlas cluster.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages