Giter Club home page Giter Club logo

nowplaying's Introduction

Nowplaying

A demo app for Turso's embedded replicas running on AWS Lambda

Intro

This app tracks when users were last active, and what game they played. Users can update their info any time. Results are cached on disk in a libSQL database running in embedded replica mode.

Demo

The demo is hosted here: http://nowplaying.sarna.dev

Deploy your own Lambda

Here are the steps that should more or less work, assuming you have aws CLI installed and set up (and mind all the user-specific variables):

npm prune --omit=dev
zip -r nowplaying.zip .
aws lambda create-function --function-name nowplaying --zip-file fileb://nowplaying.zip --handler index.handler --runtime nodejs18.x --role $YOUR_AWS_ROLE
aws lambda update-function-configuration --function-name nowplaying --environment "Variables={LIBSQL_SYNC_URL=$YOUR_TURSO_DB_URL,LIBSQL_AUTH_TOKEN=$(turso db tokens create $YOUR_TURSO_DB_NAME)}"
# and for updating the code
aws lambda update-function-code --function-name nowplaying --zip-file fileb://nowplaying.zip

API

Fetch user data: GET https://your-lambda-url/

Update user data: GET https://your-lambda-url/?name=your-name&playing=game-you-are-playing

nowplaying's People

Contributors

psarna avatar

Watchers

 avatar

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.