Code Monkey home page Code Monkey logo

benu's Introduction

Benu

Menu, but better

This is a Next.js project bootstrapped with create-next-app, and deployed on Vercel.

It uses shadowwalker/next-pwa for two purposes:

  • Add to home screen in iOS (only works in Safari)
  • Offline availability (there might still be a delay unless you turn on airplane mode)

Quick Start

Clone the repository and npm ci or npm install.

Edge Functions

src/pages/api/handler.ts is an Edge Function in Vercel.

There is a limit of 500,000 "execution units" (50 ms of CPU time).

Cache

The Cache-Control header is set in src/pages/api/handler.ts.

You can customize browser and Vercel caching by setting the relevant headers.

PWA-level caching is set in cache.js.

Note on Vercel caching: you'll only see cache misses in the logs; head over to DevTools to see cache hits.

benu's People

Contributors

doabell avatar dependabot[bot] avatar

Watchers

 avatar

benu's Issues

Slow cold start

Initial API response takes seconds.

This is probably the API and not the DB, but needs to be confirmed.

Possible solutions:

  • Move to KV (unknown impact) self-maintain DB structure (date, dining halls, etc.)
  • Fetch directly from upstream API (IP leak concerns?) CORS
  • Switch to Edge Functions (weird minipass error)

Menu items not showing

Upstream API has drinks for Wilson Cafe, but the app shows "No Data".

Cannot verify for dining halls - wait until September.

The upstream API seems stable, no structural changes; The Grille works fine.

Additionally, document any special treatment for menus that don't change often (I don't think there is one, but needs verifying).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.