Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: combine the website and data-catalog directories under the brc-analytics project (#16) #28

Merged
merged 2 commits into from
Sep 5, 2024
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 data-catalog/.env → .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NEXT_PUBLIC_SITEMAP_DOMAIN='https://brc-analytics.dev.clevercanary.com'
NEXT_PUBLIC_BASE_PATH='/data'
SITEMAP_EXCLUDE='/export*,/login'
NEXT_PUBLIC_BASE_PATH=''
SITEMAP_EXCLUDE='/export*,/login'
3 changes: 1 addition & 2 deletions data-catalog/.eslintignore → .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
**/node_modules/*
**/out/*
**/.next/*

/out

venv
File renamed without changes.
6 changes: 0 additions & 6 deletions .github/workflows/run-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ jobs:
with:
node-version: "20.10.0"
- run: |
cd ./website
npm ci
npm run check-format
npm run lint
npx tsc --noEmit
cd ../data-catalog
npm ci
npm run check-format
npm run lint
Expand Down
34 changes: 33 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
# dependencies
/node_modules

.idea/
# next.js
/.next/

# misc
.DS_Store
*.pem

# debug
npm-debug.log*

# env files
/.env*.local
/.env.development
/.env.production

# typescript
*.tsbuildinfo

# editors
/.vscode
.idea

# nvm
.nvmrc

# favicons
/public/favicons/*

# Build Dir
/out

# python
venv
45 changes: 18 additions & 27 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,24 @@

echo '🏗️👷 Checking your project before committing'

for app in "website" "data-catalog"
do
echo "\nChecking $app"
# Check Prettier
npm run check-format ||
(
echo '🤔 Prettier Check Failed. Run npx prettier --write . try commit again.';
false;
)

cd "./$app"

# Check Prettier
npm run check-format ||
(
echo '🤔 Prettier Check Failed. Run npx prettier --write . try commit again.';
false;
)

# Check ESLint
npm run lint ||
(
echo '🤔 ESLint Check Failed. Make the required changes listed above, add changes and try to commit again.'
false;
)

# Check TypeScript
npx tsc --noEmit ||
(
echo 'TypeScript compile failed';
# Check ESLint
npm run lint ||
(
echo '🤔 ESLint Check Failed. Make the required changes listed above, add changes and try to commit again.'
false;
)
echo 'TypeScript compile succeeded!'
)

cd ..
done
# Check TypeScript
npx tsc --noEmit ||
(
echo 'TypeScript compile failed';
false;
)
echo 'TypeScript compile succeeded!'
2 changes: 1 addition & 1 deletion data-catalog/.prettierignore → .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
node_modules

# build
/out
out

# python
venv
File renamed without changes.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
# brc-analytics
# brc-analytics

# BRC Analytics Data Catalog

## Building the data source files

Create a Python virtual environment and install requirements:

```shell
python3 -m venv ./venv
source ./venv/bin/activate
pip install -r ./files/requirements.txt
```

Then run the script:

```shell
python3 ./files/build-genomes-files.py
```

The environment can be deactivated by running `deactivate`, and re-activated by running `source ./venv/bin/activate`
again.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ButtonPrimary } from "@databiosphere/findable-ui/lib/components/common/Button/components/ButtonPrimary/buttonPrimary";
import { ROUTES } from "../../../../../../routes/constants";
import { Button } from "@mui/material";
import { ROUTES } from "../../../../../../../routes/constants";
import {
Head,
Headline,
Expand Down Expand Up @@ -27,7 +27,9 @@ export const SectionHero = (): JSX.Element => {
annotations and functional insights into disease-causing organisms
and their carriers
</Subhead>
<ButtonPrimary href={ROUTES.GET_STARTED}>Get Started</ButtonPrimary>
<Button color="hero" href={ROUTES.GENOMES} variant="contained">
Get Started
</Button>
</SubHeadlinePositioner>
</SubHeadline>
</SectionLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
} from "@databiosphere/findable-ui/lib/components/Links/common/entities";
import { Button, Tooltip } from "@mui/material";
import Router from "next/router";
import { ROUTES } from "../../../../../../../routes/contants";
import { ROUTES } from "../../../../../../../routes/constants";
import { BRCDataCatalogGenome } from "../../../../../../apis/catalog/brc-analytics-catalog/common/entities";
import { AnalyzeGenomeIcon } from "../../../../../common/CustomIcon/components/AnalyzeGenomeIcon/analyzeGenomeIcon";
import { ViewGenomeIcon } from "../../../../../common/CustomIcon/components/ViewGenomeIcon/viewGenomeIcon";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ export {
BackPageContentSideColumn,
BackPageContentSingleColumn,
} from "@databiosphere/findable-ui/lib/components/Layout/components/BackPage/backPageView.styles";
export { Logo } from "@databiosphere/findable-ui/lib/components/Layout/components/Header/components/Content/components/Logo/logo";
export { Link } from "@databiosphere/findable-ui/lib/components/Links/components/Link/link";
export { BasicCell } from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/BasicCell/basicCell";
export { AnalysisMethod } from "./Entity/components/AnalysisMethod/analysisMethod";
export { AnalysisPortals } from "./Entity/components/AnalysisPortals/analysisPortals";
export { DetailViewHero } from "./Layout/components/Detail/components/DetailViewHero/detailViewHero";
export { Branding } from "./Layout/components/Footer/components/Branding/branding";
export { AnalyzeGenome } from "./Table/components/TableCell/components/AnalyzeGenome/analyzeGenome";
5 changes: 3 additions & 2 deletions website/app/config/config.ts → app/config/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { setConfig } from "@databiosphere/findable-ui/lib/config/config";
import { SiteConfig } from "@databiosphere/findable-ui/lib/config/entities";
import brcAnalyticsSiteLocal from "../../site-config/brc-analytics-site/local/config";
import brcAnalyticsLocal from "../../site-config/brc-analytics/local/config";

const CONFIGS: { [k: string]: SiteConfig } = {
"brc-analytics-site-local": brcAnalyticsSiteLocal,
"brc-analytics-local": brcAnalyticsLocal,
};

let appConfig: SiteConfig | null = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,25 @@ import { Components, Theme } from "@mui/material";
*/
export const MuiButton = (theme: Theme): Components["MuiButton"] => {
return {
styleOverrides: {
containedPrimary: {
boxShadow: `0px 1px 0px 0px rgba(0, 0, 0, 0.08), 0px -1px 0px 0px rgba(0, 0, 0, 0.20) inset`,
// TODO(cc): update theme MuiButton "active" state.
// eslint-disable-next-line sort-keys -- disabling key order for readability
"&:active": {
backgroundColor: theme.palette.primary.main,
boxShadow: `0px -1px 0px 0px rgba(0, 0, 0, 0.20) inset`,
},
// TODO(cc): update theme MuiButton "hover" state.
"&:hover": {
backgroundColor: theme.palette.primary.main,
variants: [
{
props: { color: "hero", variant: "contained" },
style: {
boxShadow: `0px 1px 0px 0px rgba(0, 0, 0, 0.08), 0px -1px 0px 0px rgba(0, 0, 0, 0.20) inset`,
color: theme.palette.common.white,
// eslint-disable-next-line sort-keys -- disabling key order for readability
"&:hover": {
backgroundColor: theme.palette.hero.main,
boxShadow: `0px 1px 0px 0px rgba(0, 0, 0, 0.08), 0px -1px 0px 0px rgba(0, 0, 0, 0.20) inset`,
},
// eslint-disable-next-line sort-keys -- disabling key order for readability
"&:active": {
backgroundColor: theme.palette.hero.main,
boxShadow: "none",
},
},
},
},
],
};
};

Expand Down
23 changes: 23 additions & 0 deletions app/theme/common/palette.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { PaletteColorOptions } from "@mui/material";

/**
* Palette "Hero"
*/
enum HERO {
LIGHT = "#28285B",
MAIN = "#28285B",
}

/**
* Color constants
*/
export const heroLight = HERO.LIGHT;
export const heroMain = HERO.MAIN;

/**
* Palette Option "Hero"
*/
export const hero: PaletteColorOptions = {
light: heroLight,
main: heroMain,
};
4 changes: 4 additions & 0 deletions website/app/theme/theme.ts → app/theme/theme.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createTheme, Theme } from "@mui/material";
import { deepmerge } from "@mui/utils";
import * as C from "./common/components";
import * as P from "./common/palette";

/**
* Returns BRC customized theme.
Expand All @@ -14,6 +15,9 @@ export function mergeAppTheme(theme: Theme): Theme {
MuiButton: C.MuiButton(theme),
MuiCssBaseline: C.MuiCssBaseline(theme),
},
palette: {
hero: P.hero,
},
})
);
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {
Value,
} from "@databiosphere/findable-ui/lib/components/common/KeyValuePairs/keyValuePairs";
import { ComponentProps } from "react";
import { ROUTES } from "../../../../../routes/contants";
import { ROUTES } from "../../../../../routes/constants";
import { BRCDataCatalogGenome } from "../../../../apis/catalog/brc-analytics-catalog/common/entities";
import * as C from "../../../../components/index";
import * as C from "../../../../components";
import { GENOME_BROWSER } from "./constants";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#!/usr/bin/env bash

# Exit immediately if a command exits with a non-zero status
set -e

echo \"Deleting ./out/\"
rm -rf ./out

# install node version 20.10.0
n 20.10.0
npm ci
export NEXT_PUBLIC_BASE_PATH=""


# Build the website
# Build catalog
npm run build:local

export BUCKET=s3://tik-brc-analytics.dev/
export SRCDIR=out/

aws s3 sync $SRCDIR $BUCKET --delete --profile excira
aws cloudfront create-invalidation --distribution-id E1OF5ESEGD5VAG --paths "/*" --profile excira
aws cloudfront create-invalidation --distribution-id E1OF5ESEGD5VAG --paths "/*" --profile excira
36 changes: 0 additions & 36 deletions data-catalog/.gitignore

This file was deleted.

19 changes: 0 additions & 19 deletions data-catalog/README.md

This file was deleted.

Loading
Loading