Skip to content

Commit 6dec8eb

Browse files
committed
Merge branch 'main' into adding-tests
2 parents 50b9b65 + 3c5d811 commit 6dec8eb

86 files changed

Lines changed: 1382 additions & 320 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules
2+
.angular
3+
.git
4+
dist
5+
.vscode
6+
npm-debug.log
7+
# Add these for TinaCMS
8+
.tina/__generated__
9+
.tina/out

.github/workflows/deploy.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Deploy to S3
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- prod
8+
9+
permissions:
10+
id-token: write
11+
contents: read
12+
13+
jobs:
14+
deploy:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 20
23+
cache: npm
24+
25+
- name: Determine version
26+
id: version
27+
run: |
28+
PROD_VERSION=$(curl -sf https://reactome.org/ContentService/data/database/version)
29+
echo "prod_version=$PROD_VERSION" >> "$GITHUB_OUTPUT"
30+
31+
if [ "${{ github.ref_name }}" = "prod" ]; then
32+
VERSION=$PROD_VERSION
33+
else
34+
VERSION=$((PROD_VERSION + 1))
35+
fi
36+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
37+
echo "Deploying to version $VERSION"
38+
39+
- name: Install dependencies
40+
run: npm ci
41+
42+
- name: Build
43+
run: |
44+
npx ng build reactome-cytoscape-style
45+
npx ng build reactome --configuration production --base-href /${{ steps.version.outputs.version }}/website/
46+
47+
- name: Configure AWS credentials
48+
uses: aws-actions/configure-aws-credentials@v4
49+
with:
50+
role-to-assume: ${{ vars.AWS_ROLE }}
51+
aws-region: us-east-1
52+
53+
- name: Deploy to S3
54+
run: |
55+
aws s3 sync dist/reactome/browser/ \
56+
s3://${{ vars.S3_BUCKET }}/${{ steps.version.outputs.version }}/website/ \
57+
--delete
58+
59+
- name: Invalidate CloudFront cache
60+
run: |
61+
aws cloudfront create-invalidation \
62+
--distribution-id E2WMIF8KN88WPK \
63+
--paths "/${{ steps.version.outputs.version }}/website/*"

.github/workflows/prettier.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: autofix.ci
22
on:
33
pull_request:
4-
push:
54

65
permissions:
76
contents: write
@@ -30,6 +29,17 @@ jobs:
3029
echo "No files to format"
3130
fi
3231
33-
- uses: autofix-ci/action@v1
34-
with:
35-
commit-message: "Apply Prettier format"
32+
- name: Commit formatted changes
33+
run: |
34+
git config user.name "github-actions[bot]"
35+
git config user.email "github-actions[bot]@users.noreply.github.com"
36+
37+
if [ -n "$(git status --porcelain)" ]; then
38+
# Check out the PR branch to avoid detached HEAD
39+
git checkout ${{ github.head_ref }}
40+
git add --all
41+
git commit -m "chore: Apply Prettier formatting"
42+
git push origin ${{ github.head_ref }}
43+
else
44+
echo "No formatting changes to commit"
45+
fi

Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM node:22
2+
3+
WORKDIR /app
4+
5+
# 1. Install Global Tools
6+
RUN npm install -g @angular/cli@19 tsx
7+
8+
# 2. Copy Package files
9+
COPY package*.json ./
10+
11+
# 3. Inject the Host/Poll flags directly into the package.json scripts
12+
# This prevents the "Invalid Option: --host" error
13+
RUN sed -i 's/ng serve/ng serve --host 0.0.0.0 --poll 2000/g' package.json
14+
15+
# 4. Install Dependencies
16+
RUN npm install --legacy-peer-deps --ignore-scripts
17+
18+
# 5. Copy the rest of the code
19+
COPY . .
20+
21+
# Expose the ports
22+
EXPOSE 4200
23+
EXPOSE 4001
24+
25+
# We use "npm run dev:serve" but pass the flags through the -- separator
26+
CMD npx tsx projects/website-angular/src/scripts/generate-index.ts && \
27+
npx tinacms dev --rootPath projects/website-angular -c "ng serve --host 0.0.0.0 --poll 2000 --disable-host-check"

README.md

Lines changed: 17 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,31 @@
11
# Reactome
22

3-
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.1.2.
3+
REACTOME is an open-source, open access, manually curated and peer-reviewed pathway database.
44

5-
## Development server
6-
7-
To start a local development server, run:
8-
9-
```bash
10-
ng serve
11-
```
12-
13-
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
14-
15-
## Code scaffolding
16-
17-
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
5+
## Local Development Server
6+
To setup a local environment
187

198
```bash
20-
ng generate component component-name
9+
npm install --legacy-peer-deps
10+
npm start
2111
```
2212

23-
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
24-
25-
```bash
26-
ng generate --help
27-
```
13+
## Usage
14+
Reactome has a wide range of features, to explore more of Reactome or get more information visit [the documentation page](https://reactome.org/documentation) or see the ````/documentation```` folder in the root directory.
2815

29-
## Building
16+
## Configuration
3017

31-
To build the project run:
18+
The application configuration is centralized in TypeScript files under `projects/website-angular/src/config/`. Key configurations include:
3219

33-
```bash
34-
ng build
35-
```
36-
37-
This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
38-
39-
## Running unit tests
40-
41-
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
42-
43-
```bash
44-
ng test
45-
```
46-
47-
## Running end-to-end tests
48-
49-
For end-to-end (e2e) testing, run:
50-
51-
```bash
52-
ng e2e
53-
```
20+
- `config.ts`: App-level settings like version, base URLs, and feature flags.
21+
- `environments.ts`: Environment-specific settings (development, production, etc.).
22+
- `api-routes.ts`: API endpoint URLs derived from the current environment.
23+
- `features.ts`: Feature flags for toggling functionality.
24+
- `external-links.ts`: External links, including dynamically constructed release notes.
5425

55-
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
26+
To update configuration values, edit the respective TS files. For environment-specific builds, consider using Angular's file replacements in `angular.json`.
5627

5728
## Additional Resources
5829

59-
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
30+
## LICENSE
31+
[Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)

angular.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
},
6969
{
7070
"type": "anyComponentStyle",
71-
"maximumWarning": "4kB",
72-
"maximumError": "8kB"
71+
"maximumWarning": "8kB",
72+
"maximumError": "16kB"
7373
}
7474
],
7575
"outputHashing": "all"
@@ -172,8 +172,8 @@
172172
},
173173
{
174174
"type": "anyComponentStyle",
175-
"maximumWarning": "4kB",
176-
"maximumError": "8kB"
175+
"maximumWarning": "8kB",
176+
"maximumError": "16kB"
177177
}
178178
],
179179
"outputHashing": "all"
@@ -420,5 +420,8 @@
420420
}
421421
}
422422
}
423+
},
424+
"cli": {
425+
"analytics": "50c0c135-7597-4d12-af2a-c2f05c84c5b1"
423426
}
424427
}

docker-compose.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
services:
2+
app:
3+
build: .
4+
ports:
5+
- "4200:4200"
6+
- "4001:4001"
7+
volumes:
8+
- .:/app
9+
- /app/node_modules
10+
# This ensures the nested tina folder is visible to the watcher
11+
- ./projects/website-angular/tina:/app/projects/website-angular/tina
12+
environment:
13+
- NG_CLI_ANALYTICS=false
14+
- NODE_ENV=development
15+
stdin_open: true
16+
tty: true
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# PathwayBrowser
2+
[Userguide](http://localhost:4200/documentation/userguide/pathway-browser)
3+
Dev docs loading...
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Adding Components to Reactome
2+
## What is a Component
3+
"Components are the main building blocks of Angular applications. Each component represents a part of a larger web page. Organizing an application into components helps provide structure to your project, clearly separating code into specific parts that are easy to maintain and grow over time." - [Angular Docs](https://angular.dev/essentials/components)
4+
5+
## How to Add one
6+
To add a component to this project use the following command
7+
````
8+
ng generate component <Component name and path here>
9+
````
10+
and edit the files it generates to your hearts content. You will then be able to use the component wherever you want in the HTML files.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Adding a Page to Reactome
2+
The first thing to consider here is whether or not your page needs custom angular functionality. If the pages will be comprised of only text, images and video, a TinaCMS page will suffice and you can follow the TinaCMS tutorial instead.
3+
4+
To create a new angular page follow these steps
5+
1. Generate a new component (this will be your page)
6+
Follow the tutorial in adding-components
7+
2. Add the route for your page in ````projects/website-angular/src/app/app.routes.ts````
8+
Your "route" is what makes your page show up at the correct address in the browser.
9+
3. Edit your page to your hearts content.
10+
This step will require a bit more creativity and Angular experience. I can't be sure what kind of page you are creating so do your best to get the functionality your need with the power of the internet on your side. I believe in you!

0 commit comments

Comments
 (0)