Let's build a screenshot API

This page summarizes the projects mentioned and recommended in the original post on dev.to

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • LocalStack

    đź’» A fully functional local AWS cloud stack. Develop and test your cloud & Serverless apps offline

    Later you can use any S3 compatible storage because the code I write will still work, but for testing purposes on my local machine, I will use LocalStack:

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • hugo-quick-start

    Hugo Quick Start on Render

    The main upside is cost-effectiveness, but managing VPS is still painful which can be solved with PaaS like Heroku, Render, or similar.

  • puppeteer

    JavaScript API for Chrome and Firefox

    Playwright seems to be a superior library for working with headless browsers than Puppeteer, but I will go with Puppeteer.

  • Playwright

    Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

    Playwright seems to be a superior library for working with headless browsers than Puppeteer, but I will go with Puppeteer.

  • kamal

    Deploy web apps anywhere.

    Or you can use [https://kamal-deploy.org/] and GitHub actions for automating at least deploys, but there are still will be issues that you will need to solve.

  • hono

    Web framework built on Web Standards

    Hono—a simple and fast framework for processing HTTP requests.

  • easylist

    EasyList filter subscription (EasyList, EasyPrivacy, EasyList Cookie, Fanboy's Social/Annoyances/Notifications Blocking List)

    import { ScreenshotOptions } from "./schema"; import puppeteer, { Page } from "puppeteer"; import { PuppeteerBlocker } from "@cliqz/adblocker-puppeteer"; import fetch from "cross-fetch"; let blocker: PuppeteerBlocker | null = null; async function blockCookieBanners(page: Page) { if (!blocker) { blocker = await PuppeteerBlocker.fromLists(fetch, [ // the list of the cookie banners to block from the https://easylist.to/ website "https://secure.fanboy.co.nz/fanboy-cookiemonster.txt", ]); } await blocker.enableBlockingInPage(page); } export async function render( options: ScreenshotOptions ): Promise<{ url: string }> { const browser = await puppeteer.launch(); const page = await browser.newPage(); if (options.block_cookie_canners) { await blockCookieBanners(page); } await page.setViewport({ width: options.viewport_width, height: options.viewport_height, deviceScaleFactor: options.device_scale_factor, }); await page.goto(options.url); const encodedScreenshot = await page.screenshot({ type: "jpeg", encoding: "base64", fullPage: options.full_page, }); await browser.close(); return { url: `data:image/jpeg;base64,${encodedScreenshot}` }; }

  • coolify

    An open-source & self-hostable Heroku / Netlify / Vercel alternative.

    Heroku and similar providers can simplify the server management issues, but you can use something much better that can combine both cost efficiency and ease of deployment—Coolify:

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Sometimes things simply don't work

    3 projects | dev.to | 23 Apr 2024
  • Scraping Using Python in Step by step approach

    2 projects | dev.to | 20 Jul 2023
  • Rustify some puppeteer code

    6 projects | dev.to | 27 Jun 2024
  • Building a Netflix show recommender using Crawlee and React

    4 projects | dev.to | 19 Jun 2024
  • HTML to PDF renderers: A simple comparison

    4 projects | dev.to | 26 Mar 2024