Skip to content

Commit

Permalink
docs(readme): revise README
Browse files Browse the repository at this point in the history
  • Loading branch information
robertu7 committed Jul 31, 2020
1 parent bd8c05c commit 37dd44d
Showing 1 changed file with 2 additions and 32 deletions.
34 changes: 2 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

- Install dependencies: `npm i`
- Environment variables: `cp .env.local.example .env.local`
- (Optional) Run `npm run gen:type` or `npm run gen:watch`
- Run `npm run gen:type` or `npm run gen:watch`
- Run `npm run dev`, then go to `http://localhost:3000/`

### Build and run production server

`npm run build && npm run start`

### Start local dev with docker
### Start local dev with Docker

- Environment variables: `cp .env.local.example .env.local`
- Set command alias: `source bin/dc-alias`
Expand Down Expand Up @@ -44,30 +44,6 @@
- `docker pull 903380195283.dkr.ecr.ap-southeast-1.amazonaws.com/matters-web:latest`
- `docker tag 903380195283.dkr.ecr.ap-southeast-1.amazonaws.com/matters-web:latest matters-web:latest`

## Routing

We customized routes with Express in `server.ts` and disabled [fs routing](https://github.com/zeit/next.js#disabling-file-system-routing).

Note that we need to specify `href` (the path inside pages directory + query string) and `as` (the path that will be renderer on browser URL bar) props in `<Link>` component.

For instances:

```jsx
// Home
<Link href="/Home" as="/">

// All Authors
<Link href="/Authors" as="/authors">

// User Comments
<Link href="/User/Comments?username=matty" as="/@matty/comments">

// Tag Detail
<Link href="/TagDetail?id=RHJhZnQ6MQ==" as="/tags/RHJhZnQ6MQ==">
```

See [next.js docs](https://github.com/zeit/next.js#routing) for more details.

## Conventions

[Matters Design System](https://paper.dropbox.com/doc/Matters-Design-System--AXX9x2tuPldQFCWTN0Mt~_itAQ-klFuV5yv3ZlqpqHL0w0kU)
Expand Down Expand Up @@ -128,12 +104,6 @@ See `.vscode/settings.json`

For vim users, you might want to see `.vim/.vimrc` (using vim-plug).

## Release a new version

1. Update `CHANGELOG.md`
2. Update `version` field of `package.json`
3. Create a new release and tag in [GitHub Releases](https://github.com/thematters/matters-web/releases)

## Troubleshooting

1. If `styled-jsx` is installed in both `next` and our own `package.json`, the built-in `styled-jsx` SSR of Next.js will fail. See [#533](https://github.com/zeit/styled-jsx/issues/533).

0 comments on commit 37dd44d

Please sign in to comment.