Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
steps:
# get the latest version of the repository
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
uses: actions/checkout@v6
- uses: actions/setup-node@v6

# get current date and time for build
- name: Set current date and time as an environment variable
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: "Documentation: Spell Check Documentation"
uses: codespell-project/actions-codespell@master
with:
Expand All @@ -38,7 +38,7 @@ jobs:
working-directory: ./src/client
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install and Build 🔧
Expand All @@ -52,7 +52,7 @@ jobs:
needs: storybook
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
Expand All @@ -61,7 +61,7 @@ jobs:
source: ./docs
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v4

# deployment job
deploy:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# .github/workflows/frontend.yml
name: BUG Frontend
permissions:
contents: read
on:
push:
branches:
- "**"
paths-ignore:
- "**/README.md"
- "docs/**"
pull_request:
branches:
- "main"
paths-ignore:
- "**/README.md"
- "docs/**"

jobs:
frontend:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
name: Frontend Build & Test using Node.js ${{ matrix.node-version }}
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: cd src/client && npm test
- run: cd src/client && npm run build --if-present
2 changes: 1 addition & 1 deletion .github/workflows/versioning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
ls -la ./
# get the latest version of the repository
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
# bump the backend version
- name: "Backend: Automated Version Bump"
uses: "phips28/gh-action-bump-version@master"
Expand Down
11 changes: 3 additions & 8 deletions docs/pages/development/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ All the information you need to get started developing BUG modules can be found

First off you'll need to get a development instance up and running. Both production and development versions of BUG run in a docker container.

The development version has live mount and runs `nodemon` and `create-react-app` meaning the app reloads on each file save for both the frontend and backend. You develop on your development machine's filesystem and the files are mounted into the running bug container.
The development version has live mount and runs `nodemon` and `vite` meaning the app reloads on each file save for both the frontend and backend. You develop on your development machine's filesystem and the files are mounted into the running bug container.

Running BUG for production? You probably want [these instructions](/bug/pages/installation) instead.

Expand All @@ -20,25 +20,20 @@ Running BUG for production? You probably want [these instructions](/bug/pages/in
For development on your local machine with docker (recommended)

1. To begin you'll need to install the [Docker Desktop](https://www.docker.com/products/docker-desktop/) and the latest LTS version of [Node.js](https://nodejs.dev/en) on your development machine.
1. Check your Docker and Node.js installations are working using the commands `docker -v` and `node -v`. You should see some sensible version numbers. At least `20.x.x` for Docker and at least `16.x.x` for Node.js.
1. Check your Docker and Node.js installations are working using the commands `docker -v` and `node -v`. You should see some sensible version numbers. At least `26.x.x` for Docker and at least `20.x.x` for Node.js.
1. Next, clone the BUG repository using `git clone https://github.com/bbc/bug`
1. Change directory to the `./src` folder of the repository.
1. Run `npm i`. This installs all the backend dependencies locally.
1. Change directory to the `./src/client` folder.
1. Run `npm i --legacy-peer-deps` to install all the frontend dependencies locally.
1. Change directory to the root folder of the repository. This will be the same level as the `docker-compose.yml` file in the repository.
1. Spin up your development instance with `docker-compose up -d`. It may take around 5 minutes for the development build of the frontend react app to become available. You can view the live logs from the main BUG container `bug` using the command `docker logs --tail 1000 -f bug`.
1. Get developing. If you're using the default ports, the web interface will be available on port 3000, the API on port 3101 and the GUI view of the MongoDB database on port 3202.

You can change many of the port parameters and logging locations by setting environment variables in the `docker-compose.yml` file in the root directory.

When developing in docker, changes will automatically be reflected inside the container using volume mounts and nodemon to reload. Please make sure to `npm install` on your local machine before spinning up the compose project.
When developing in docker, changes will automatically be reflected inside the container using volume mounts and nodemon to reload. Make sure to `npm install` on your local machine before spinning up the compose project.

Microsoft's [Visual Studio Code](https://code.visualstudio.com/) has been used for most of BUG's development. Other IDE's are available, however Visual Studio Code paired with the official Docker extension found in the extension's store is really useful for outputting logs and visualising the orchestration.

## Troubleshooting

- If you experience errors during the `npm i` process using `npm i --legacy-peer-deps` may help.
- The `-d` in the command `docker compose -d` deataches the process from the terminal running the container in the background.
- If you're getting Docker related 'permission denied' errors, make sure you've run the Docker [post-installation steps](https://docs.docker.com/engine/install/linux-postinstall/) on Linux.
- If you're developing on a linux OS you may see errors on the main bug container logs regarding file write permission. This can be solved by giving the docker group read write permissions on the repository directory.
Expand Down
Loading