🏎See how your favorite F1 team is progressing in the Constructors Championship

Overview

F1 Championship Stats 🏎

See how your favorite F1 team is progressing in the Constructors Championship using the PlanetScale serverless driver for JavaScript and edge functions.

CleanShot 2022-08-17 at 14 03 04@2x

How it works

All of the data for this application is returned through edge functions from various providers (Cloudflare Workers, Vercel Edge Functions, Netlify Edge Functions). Read more about the benefits of the PlanetScale serverless driver for JavaScript and the next generation of PlanetScale infrastruction in our latest blog post.

Each of these edge functions connects to a PlanetScale database via our serverless driver, @planetscale/database, and returns a JSON payload with F1 stats to render the page.

You can use these as examples for how to start using your PlanetScale database from an edge function.

The frontend application is a Next.js app running on Vercel.

Note: Before using @planetscale/database, make sure to enroll your database in the PlanetScale serverless driver for JavaScript beta (under your database's Settings > Beta features section).

Local development

To run the frontend (UI).

npm install
npm run dev

Visit http://localhost:3000 in your browser.

Edge functions

To learn more about how to run each function, visit the subdirectories for each:

Thank you ❤️

The F1 stats shown in this application are from the Ergast Developer API.

License

The project is available as open source under the terms of the Apache-2.0 license.

Comments
  • Add example of using @planetscale/database with Fastly Compute@Edge

    Add example of using @planetscale/database with Fastly Compute@Edge

    This requires having the Fastly CLI installed (https://developer.fastly.com/learning/tools/cli/#installing) in order to build, run locally, and deploy to Fastly

    opened by JakeChampion 14
  • Bump undici from 5.5.1 to 5.9.1 in /examples/cloudflare

    Bump undici from 5.5.1 to 5.9.1 in /examples/cloudflare

    Bumps undici from 5.5.1 to 5.9.1.

    Release notes

    Sourced from undici's releases.

    v5.9.1

    What's Changed

    New Contributors

    Full Changelog: https://github.com/nodejs/undici/compare/v5.8.2...v5.9.1

    v5.8.2

    ⚠️ Security Release ⚠️

    • CRLF Injection in Nodejs ‘undici’ via Content-Type GHSA-f772-66g8-q5h3 CVE-2022-35948
    • undici.request vulnerable to SSRF using absolute URL on pathname GHSA-8qr4-xgw6-wmr3 CVE-2022-35949

    What's Changed

    New Contributors

    Full Changelog: https://github.com/nodejs/undici/compare/v5.8.1...v5.8.2

    v5.8.1

    What's Changed

    New Contributors

    ... (truncated)

    Commits
    • 5890e16 5.9.1
    • ecae314 fix: don't timeout while waiting for client to send request (#1604)
    • fa9fd90 fix(File): respect typed array byteOffset and byteLength (#1601)
    • ae6f554 fix: add support for integrity option to Fetch (#1596)
    • deed628 fix(fetch): implement fully read body algorithm (#1597)
    • 0d1419c Fix array headers (#1598)
    • 52d1ce5 Bumped v5.8.2
    • 66165d6 Merge pull request from GHSA-f772-66g8-q5h3
    • 124f7eb Merge pull request from GHSA-8qr4-xgw6-wmr3
    • aef314c feat(webidl): better error message for ByteString converter (#1591)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump undici from 5.5.1 to 5.9.1

    Bump undici from 5.5.1 to 5.9.1

    ⚠️ Dependabot is rebasing this PR ⚠️

    Rebasing might not happen immediately, so don't worry if this takes some time.

    Note: if you make any changes to this PR yourself, they will take precedence over the rebase.


    Bumps undici from 5.5.1 to 5.9.1.

    Release notes

    Sourced from undici's releases.

    v5.9.1

    What's Changed

    New Contributors

    Full Changelog: https://github.com/nodejs/undici/compare/v5.8.2...v5.9.1

    v5.8.2

    ⚠️ Security Release ⚠️

    • CRLF Injection in Nodejs ‘undici’ via Content-Type GHSA-f772-66g8-q5h3 CVE-2022-35948
    • undici.request vulnerable to SSRF using absolute URL on pathname GHSA-8qr4-xgw6-wmr3 CVE-2022-35949

    What's Changed

    New Contributors

    Full Changelog: https://github.com/nodejs/undici/compare/v5.8.1...v5.8.2

    v5.8.1

    What's Changed

    New Contributors

    ... (truncated)

    Commits
    • 5890e16 5.9.1
    • ecae314 fix: don't timeout while waiting for client to send request (#1604)
    • fa9fd90 fix(File): respect typed array byteOffset and byteLength (#1601)
    • ae6f554 fix: add support for integrity option to Fetch (#1596)
    • deed628 fix(fetch): implement fully read body algorithm (#1597)
    • 0d1419c Fix array headers (#1598)
    • 52d1ce5 Bumped v5.8.2
    • 66165d6 Merge pull request from GHSA-f772-66g8-q5h3
    • 124f7eb Merge pull request from GHSA-8qr4-xgw6-wmr3
    • aef314c feat(webidl): better error message for ByteString converter (#1591)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Update all references to database-js

    Update all references to database-js

    At least bump them all to the same version, so they're consistent everywhere, which will make it easier to bump them all with a script or at least to grep.

    I also loosened the spec since there's no reason to be so strict.

    opened by mattrobenolt 1
  • Animation

    Animation

    Add some animations so it becomes more obvious things are happening when you change edge function

    https://user-images.githubusercontent.com/440926/185375855-983db4ff-23ee-49b4-b1bc-69a0f663a7c6.mov

    opened by ayrton 1
  • Update local CF instructions

    Update local CF instructions

    Makes wrangler X npx wrangler X because I think that's how most people will run it.

    Wrangler seems to ignore secrets in local mode so this adds instructions for updating the local environment.

    opened by jgreet 1
  • Parallelize data-fetching and insertions, cleanup TypeScript code

    Parallelize data-fetching and insertions, cleanup TypeScript code

    This pull request uses Promise.all to speed up the insertions of data and fetching, while also breaking things down into more semantic functions for the user and adding more explicit types where necessary. We also bump up the @planetscale/database package to its latest version and add our prettier configuration so it's nicely formatted.

    I paired on this with @dgraham.

    opened by iheanyi 0
  • Bump @fastly/js-compute from 0.5.1 to 0.5.3 in /examples/fastly

    Bump @fastly/js-compute from 0.5.1 to 0.5.3 in /examples/fastly

    Bumps @fastly/js-compute from 0.5.1 to 0.5.3.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Fetch Failed for db Client

    Fetch Failed for db Client

    Great work on this team!!

    Following the example here gives me "Fetch failed" error when I'm trying to do it in Next.js API routes:

    error - Error [TypeError]: fetch failed
        at Object.processResponse (evalmachine.<anonymous>:3033:34)
        at <unknown> (evalmachine.<anonymous>:3366:42)
        at <unknown> (node:internal/process/task_queues:141:7)
        at AsyncResource.runInAsyncScope (node:async_hooks:199:9)
        at AsyncResource.runMicrotask (node:internal/process/task_queues:138:8)
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
    

    However when I switched to the example in the blog post with import { connect } from "@planetscale/database"; it worked.

    opened by steven-tey 1
Owner
PlanetScale
The database for developers.
PlanetScale
A maybe slightly safer-ish wrapper around eval Function constructors

evalish A maybe slightly safer-ish wrapper around eval Function constructors Please maybe try something else first.. Please. evalish is a small helper

0no.co 22 Aug 21, 2022
See a banned user's profile, their friends, their favorite games, their followers etc.

Roblox-Banned-User-Viewer AKA BanView See a banned user's profile, their friends, their favorite games, their followers etc. Ever wondered how to view

SCR1PP3D 4 Nov 18, 2022
Veselin Petranchev 2 Oct 11, 2022
Team Empire offers an innovative and intuitive game based on puzzles solved by two players working in a team.

Team Empire offers an innovative and intuitive game based on puzzles solved by two players working in a team. The user can create an account to monitor their results and achievements. The whole idea of the product is to make the player think and develop his logical thinking.

Vocational school for computer programming and innovation 14 Aug 8, 2022
A SPW (Single Page Website) that can track your favorite books on your browser! Made with ES6 modules,JavaScript, HTML 5 and CSS 3.

awesome-books It is a project for Microverse's JavaScript Module to be done using pair-programming. Desktop Version Mobile Version In this website you

TOFANA SILVIA 10 Aug 22, 2022
A web app which help you to save you a list of your favorite books, they will be saved on your local storage to never loose them even if you close the page. Built wiht JavaScript

Awesome Books In this project I build a page to save a list of your favorites books, you can add new books, delete it and they will be saved in the lo

Williams Colmenares 9 Dec 17, 2022
Write "hello world" in your native language, code "hello world" in your favorite programming language!

Hello World, All languages! ?? ?? Write "hello world" in your native language, code "hello world" in your favorite language! #hacktoberfest2022 How to

Carolina Calixto 6 Dec 13, 2022
If you want to know more about your favorite TV show then you've come to the right place!

Ultimate Show Guide We want to introduce you this web page that will help you to manage all your favourite TV series from place. ??️ Desktop version H

William Morales 6 Jun 23, 2022
A hub of all Marvel comics featuring your favorite heroes created with NextJS.

A hub of all Marvel comics featuring your favorite heroes created with NextJS. marvel-hub.vercel.app Stack Front-end: NextJs, Jest, Styled Components

Felipe Barcelos 28 May 1, 2022
This project is a single-page application (SPA) about Booklist in which you can add your favorite books.

AWESOME BOOKS This website Awesome Books Library provides users a convenient way to keep track of their books or reading lists. Users can add and remo

Omar Salem 10 Feb 25, 2022
A simple to use Harmony Extension that notifies you, when your favorite streamers go live!

THE Twitch Extension for your Deno-based Harmony Discord Bot Notifies you if your favorite streamers go live Usage In order to use this extension it i

null 1 Apr 1, 2022
A list of EVM-based chains that also allows you to add chains to your favorite Web3 wallet

A list of EVM-based chains that also allows you to add chains to your favorite Web3 wallet. An alternative to the closing chainlist.org

Frederik Bolding 108 Jan 5, 2023
Save your favorite GitHub Repos/Profiles Live

Save your favorite GitHub Repos/Profiles Live Getting Started by Fork and clone this repository or simply git clone https://github.com/ttran293/useful

Thanh Nam Tran 3 May 2, 2022
Find your new favorite Scratch service.

Welcome to scratch-explorer ?? Like ocular and ScratchStats? You'll love some lesser-known sites like Itinerary and Aviate. Just browse the collection

null 8 Oct 3, 2022
Browse a list of your favorite movies and tv shows on the Steam-It Movie Database.

Preview Desktop view Stream-It The website allows users to browse a list of movies, like a movie, view and add comments to a movie Built With HTML and

Ben Kiarie 10 Sep 30, 2022
🏆 ETHAmsterdam 2022 Finalist 👐 Support your favorite projects with yield

Yieldgate Yield Gate is a new monetisation tool for anyone to start receiving donations, or to support their favourite public goods projects, creators

null 16 Dec 15, 2022
Cryptostat is a Node.js based CLI that gets you the real-time stats of your favorite cryptocurrency.

Cryptostat-CLI Cryptostat is a Node.js based CLI that gets you the real-time stats of your favorite cryptocurrency. Installation Use the npm package m

Kunal Rohitas 5 Dec 15, 2022
Awesome Books project with ES6 is an application that was built using Vanilla JavaScript with ES6 features like using arrow functions. This application allows you to keep records of your favorite books.

Javascript Project Awesome Books with ES6 Using Javascript to create a simple Awesome Books project. Populating the books list and then removing one b

Ghazanfar Ali 8 Sep 28, 2022
Less clicking, more creating. Navigate to your favorite actions on the websites you love with just one click.

Navigate to your favorite actions on the websites you love with just one click Web https://irtaza9.github.io/awesome-shortcuts/ Available Shortcuts Go

Irtaza Hussain 9 Aug 25, 2022