Skip to content

Commit

Permalink
docs: better local development instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
davwheat committed Jul 6, 2024
1 parent 9313af4 commit 58ee9b5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
36 changes: 28 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,41 @@ The folder for audio files can be found at `audio/`.
the National Rail Journey Planner.
- _For example, Brighton should be `BTN.mp3`._

### Website contributions
### Running the website locally

This site is created with the React Framework using Gatsby. If you're not familiar with React or Gatsby, you may want to research them before
contributing.
You'll need to install [Node.js](https://nodejs.org/en) and the [Yarn package manager](https://yarnpkg.com/getting-started/install) as
prerequisites.

**Set up dev environment:**
When you've cloned the repository, install the required dependencies with Yarn:

```
git clone https://github.com/davwheat/rail-announcements
```bash
yarn install
yarn start
```

**Before committing your changes, format your code:**
Then you can start the three (yes, three) development services:

```bash
# In one terminal, run (for the website):
yarn run develop

# When this says "You can now view rail-announcements in the browser.", open a new terminal and run (for the live trains API):
yarn run develop:workers

# Finally, open a new terminal and run (to serve the audio files):
yarn run serve-audio
```

You'll be able to access the website at [http://local.davw.network:8787](http://local.davw.network:8787). `local.davw.network` is a domain that
will always resolve to your local machine, and is used to ensure that the website works correctly with the audio files and backend API during
local development.

### Website contributions

This site is created with the React Framework using Gatsby. If you're not familiar with React or Gatsby, you may want to research them before
contributing.

**Before committing your changes, format your code:**

```bash
yarn run format
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"scripts": {
"develop": "gatsby develop",
"develop:workers": "wrangler pages dev --proxy 8000",
"develop:workers": "wrangler pages dev --proxy 8000 --port 8087",
"start": "gatsby develop",
"build": "gatsby build",
"build:ci": "cross-env NODE_ENV=production gatsby build --verbose && (yarn run sentry:sourcemaps || true)",
Expand Down

0 comments on commit 58ee9b5

Please sign in to comment.