Skip to content

Instantly share code, notes, and snippets.

@chris-hailstorm
Last active April 5, 2020 14:46
Show Gist options
  • Save chris-hailstorm/5d2c70dd3cb318305cf428a25a365431 to your computer and use it in GitHub Desktop.
Save chris-hailstorm/5d2c70dd3cb318305cf428a25a365431 to your computer and use it in GitHub Desktop.
test-2

aw-hammer -- ActiveWrite 2.0 in Redwood framework

Getting Started

Setup

After cloning:

yarn install

Running

nvm use 12.14.1
yarn rw dev

Your browser should open automatically to http://localhost:8910 to see the web app.

Lambda functions run on http://localhost:8911 - proxied to http://localhost:8910/api/functions/*.

Developing

Database

To create a local SQLite database (and apply any unapplied migrations):

yarn rw db up

This will read the schema definition in api/prisma/schema.prisma and its migration steps, and generate a SQLite DB in api/prisma/dev.db. You can start over (in dev mode) by deleting the dev.db file any time the app isn't running.

When you make changes to the schema, run yarn rw db save to generate the latest migration milestone, run yarn rw db up to migrate the DB to the latest design, and run yarn rw db generate to rebuild the GraphQL client.

The data provider doesn't have to be sqlite; that's just the dev default.

Publishing

TBD

If you used yarn link to reference a local version of a package normally installed from an npm repo, be sure to do yarn unlink before publishing. The automated processes in CI/CD layer won't have your local package.

import TagsLayout from 'src/layouts/TagsLayout'
import NewTag from 'src/components/NewTag'

const NewTagPage = () => {
  return (
    <TagsLayout>
      <NewTag />
    </TagsLayout>
  )
}

export default NewTagPage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment