Skip to content

Commit

Permalink
feat: Implement gene search functionality and gene information page (#11
Browse files Browse the repository at this point in the history
) (#14)
  • Loading branch information
gromdimon authored Aug 30, 2023
1 parent c3884a4 commit 644a2d4
Show file tree
Hide file tree
Showing 54 changed files with 11,917 additions and 3,081 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/__tests__/**
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/__tests__/*.json filter=lfs diff=lfs merge=lfs -text
8 changes: 8 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: 'true'

- name: Set up Python 3.10
uses: actions/setup-python@v4
Expand All @@ -48,6 +50,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: 'true'

- name: Set up Python 3.10
uses: actions/setup-python@v4
Expand Down Expand Up @@ -84,6 +88,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: 'true'

- name: Set up node 20.x
uses: actions/setup-node@v3
Expand All @@ -106,6 +112,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: 'true'

- name: Set up node 20.x
uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion backend/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions backend/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

import httpx
from dotenv import load_dotenv
from fastapi import FastAPI, Query
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi.staticfiles import StaticFiles
from starlette.background import BackgroundTask
from starlette.requests import Request
from starlette.responses import JSONResponse, RedirectResponse, Response, StreamingResponse
from starlette.responses import RedirectResponse, Response, StreamingResponse

# Load environment
env = os.environ
Expand Down Expand Up @@ -52,7 +52,7 @@ async def reverse_proxy(request: Request) -> Response:
backend_url = None

if url.path.startswith("/proxy/annonars"):
backend_url = BACKEND_PREFIX_ANNONARS + url.path.replace("/proxy/annonars", "/annos")
backend_url = BACKEND_PREFIX_ANNONARS + url.path.replace("/proxy/annonars", "")
elif url.path.startswith("/proxy/mehari"):
backend_url = BACKEND_PREFIX_MEHARI + url.path.replace("/proxy/mehari", "")
elif url.path.startswith("/proxy/viguno"):
Expand Down
4 changes: 2 additions & 2 deletions backend/tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import pytest
from app import main
from requests_mock import Mocker
from starlette.testclient import TestClient

#: Host name to use for the mocked backend.
Expand All @@ -18,6 +17,7 @@
@pytest.fixture
def non_mocked_hosts() -> typing.List[str]:
"""List of hosts that should not be mocked.
We read the host from ``client``.
"""
return [client._base_url.host]
Expand All @@ -28,7 +28,7 @@ async def test_proxy_annonars(monkeypatch, httpx_mock):
"""Test proxying to annonars backend."""
monkeypatch.setattr(main, "BACKEND_PREFIX_ANNONARS", f"http://{MOCKED_BACKEND_HOST}")
httpx_mock.add_response(
url=f"http://{MOCKED_BACKEND_HOST}/annos/{MOCKED_URL_TOKEN}",
url=f"http://{MOCKED_BACKEND_HOST}/{MOCKED_URL_TOKEN}",
method="GET",
text="Mocked response",
)
Expand Down
36 changes: 36 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,39 @@
<script type="module" src="/src/main.ts"></script>
</body>
</html>

<style>
#app {
margin: 0;
padding: 0;
display: flex;
justify-content: center; /* Center horizontally */
align-items: center; /* Center vertically */
min-height: 100vh; /* Ensure the content takes up at least the full viewport height */
font-weight: normal;
}

a,
.green {
text-decoration: none;
color: rgb(111, 100, 210);
transition: 0.4s;
}

@media (min-width: 1024px) {
body {
display: flex;
justify-content: center; /* Center horizontally */
align-items: center; /* Center vertically */
min-height: 100vh; /* Ensure the body takes up at least the full viewport height */
}

#app {
display: grid;
grid-template-columns: 1fr;
width: 100%; /* Take up the full available width */
max-width: none; /* Remove max-width to utilize full width */
align-items: center; /* Center horizontally */
}
}
</style>
Loading

0 comments on commit 644a2d4

Please sign in to comment.