Giter VIP home page Giter VIP logo

der-spielplatz's Introduction

Der Spielplatz

This is an example Hammer app. In order to figure out what Hammer should be like, we're first developing a simple app with the technology stack we want and seeing how it feels. Eventually, the things we learn here will be codified in the Hammer "architectural style" and a set of command line tools will help generate various things you need during a Hammer development cycle.

Getting Started

Setup

We use Yarn as our package manager. To get the dependencies installed, just do this in the root directory:

yarn install

ORM: Prisma Photon

You can generate the JavaScript client with:

yarn workspace api generate

The generated client will be placed in api/node_modules/@generated/photon

Initial DB setup

Create and migrate a local SQLite database:

cd api
yarn prisma2 lift up
cd ..

Seeds

Prisma will offer a solution in the future, but in the meantime I've created api/seed.js which creates a few users, some documents and comments.

yarn babel-node api/seed.js

Fire it up!

yarn start

Browse to localhost:8910 to see the web app. Lambda functions run on localhost:8911 but are proxied to localhost:8910/.netlify/functions/*.

Development

Running prisma dev will watch for changes to your datamodel and will automatically apply migrations to your database and update the generated Photon (ORM) client.

cd api
yarn prisma2 dev

Migrations: Prisma Lift

The data model is defined in: api/datamodel.prisma. When you modify the data model you generate a migaration with:

cd api
yarn prisma2 lift save
cd ..

To apply the migration run:

cd api
yarn prisma2 lift up
cd ..

This will create (or modify) a SQLite database in api/db/dev.db

der-spielplatz's People

Contributors

peterp avatar mojombo 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.