GithubHelp home page GithubHelp logo

arv / replicache-sample-todo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rocicorp/replicache-sample-todo

0.0 1.0 0.0 146 KB

Sample Replicache integration that implements a Todo service

Home Page: https://replicache-sample-todo.now.sh

Go 100.00%

replicache-sample-todo's Introduction

Replicache TODO Sample

This repository contains a complete Relicache sample that implements a basic mobile Todo app.

Server

The server is in the serve directory. It's a Zeit Now app in Go.

Persistence is against AWS Aurora (MySQL flavor).

Development

  1. Install zeit now
  2. run now login to get zeit credentials
  3. Get the Rocicorp AWS credentials and put them in (.aws/credentials) on your machine
  4. Add .env file to the root of this repository containing:
    REPLICANT_AWS_ACCESS_KEY_ID=<access key from .aws/credentials>
    REPLICANT_AWS_SECRET_ACCESS_KEY=<secret access key from .aws/credentials>
    REPLICANT_SAMPLE_TODO_ENV=dev_<your Rocicorp username>
    FCM_SERVER_KEY=<Firebase Cloud Messaging Server Key>
    
    For Rocicorp's internal values, see "passwords" in Google Drive.
  5. Run unit tests with no parallelism go test -p 1 ./.... Note: tests depend on RDS and are therefore flaky.
  6. Run now dev

Deploy

Just commit to origin/master, it is auto-deployed.

Alternately, you can deploy to your own staging environment with:

now deploy

Schema

The schema we run against is managed in schema.go. Whenever it is changed, the db is dropped and re-created.

We don't currently attempt to migrate data between versions.

Client

# Login
curl -d '{"email":"[email protected]"}' https://replicache-sample-todo.now.sh/serve/login

# Create a TODO
# If the List ID is unknown, it is implicity created.
curl -H 'Authorization: <userid>' \
  -d '{"id": 1, "listID": 1, "text": "Take out the trash", "complete": true, "order": 0.5}' \
  https://replicache-sample-todo.now.sh/serve/todo-create

# Get current Client View
curl -H 'Authorization: <userid>' https://replicache-sample-todo.now.sh/serve/client-view

replicache-sample-todo's People

Contributors

aboodman avatar phritz avatar arv avatar

Watchers

James Cloos 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.