Skip to content

Screenshot capturer micro-service designed to handle more than 1000 requests/second.

License

Notifications You must be signed in to change notification settings

AdamMomen/taken

Repository files navigation

Taken 📷

Taken is a Website screenshot taker which takes the url as input and provide the image of the website. An event driven arthitecture is used to handle up a load of 1k requests per second.

Technologies Used

  • TypeScript
  • Nodejs
  • Postgres
  • Typeorm
  • Redis
  • BullMQ
  • SocketIO

Getting Started

  • Change connection settings in typeorm.config.json file located in root project directory
npm install
# or
yarn install

npm run build
# or
yarn build


# Normal start: one server
npm start
#or
yarn start


# Deployment Start: Cluster
npm run start:cluster
#or
yarn start:cluster

How?

  • Each request will be registered in redis job queue
  • Workers process and serve the job asynchronously from the queue
  • A workers is operating a squence of service:
    • Image Capture: uses puppeteer as core as headless driver driver for screenshoting
    • Image Save: uses Postgress database to save the image binary in bytea
  • Displaying the image in a html template on get request
  • Load test has been tested using k6 with 1500 virtual user requesting the server in the save time
  • It could Run as of clustered pool of server workers ensuring our app is a bullet proof!

About

Screenshot capturer micro-service designed to handle more than 1000 requests/second.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published