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/#26/404 not found page #27

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Histopathology Viewer

### Setup
- Install MySQL, and create credentials as mentioned below
```
SQL_HOST = "localhost"
SQL_USER = "Histuser"
SQL_PASSWORD = "password"
SQL_DATABASE = "Histdata"
```
- Run `create_schema.sql` from `server/db_setup`

## Sub Components

- [Client](./Readme_Assets/Client/Client.md)
- [Server](./Readme_Assets/Server/Server.md)
32 changes: 32 additions & 0 deletions Readme_Assets/Client/Client.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Client
- This Repository Refers to the Frontend of the Web-App
- In `client/` Run the Following Command to Install the Dependencies
```
npm install --no-lockfile --legacy-peer-deps
```
---


### Running the Frontend
```
npm start
```
---

### Directory Structure
![Directory Structure](./Images/Directory_Structure.png)
---

### HV Upload Pipeline
![Upload Pipeline](./Images/HV_Upload_Pipeline.png)
- The User can Upload `.tiff` `.tif` `.png` `.jpeg` `.jpg` files to the HV Platform.

### Storing the Images in MinIO Database
- The `.png` `.jpeg` `.jpg` files are directly stored in the MinIO Database without any processing done on them.
- The `.tiff` `.tif` files are broken down into Batches of Smaller Images which are then stored into the MinIO Database.

### Accessing the Thumbnails of Images
- The `.png` `.jpeg` `.jpg` files are directly accessed from the MinIO Database.
- For the `.tiff` `.tif` files, the Smaller Images are retrieved in Batches which are then Reconstructed in the Frontend and Displayed to the User. The Images are Continously Retireved and Constructed as per the Depth of the Image.
---

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions Readme_Assets/Server/Server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Server
- This Repository Refers to the Backend of the Web-App
- In `server/` Run the Following Command to Install the Dependencies
```
npm install --no-lockfile --legacy-peer-deps
```
---
### Running the Backend
```
npx nodemon server.js
```
---
4 changes: 3 additions & 1 deletion client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import CustomToastContainer from './components/CustomToastContainer/CustomToastC
import Viewer from './components/Viewer/Viewer'
import Login from './components/Login/Login'
import './App.css'
import NavBar from './components/Viewer/components/NavBar/NavBar';
import NavBar from './components/NavBar/NavBar';
import PageNotFound from './components/PageNotFound/PageNotFound';

function App() {
let tokenId = null
Expand Down Expand Up @@ -69,6 +70,7 @@ function App() {
<Routes>
<Route exact path='/' element={isLoggedIn ? <Viewer logout={logoutUser} /> : <Navigate replace to="/login" />}/>
<Route exact path='/login' element={isLoggedIn ? <Navigate replace to="/" /> : <Login checkUser={checkUser} />} />
<Route path='/*' element={<PageNotFound />}/>
</Routes>
<CustomToastContainer />
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
import React from 'react'
import './NavBar.css'
import { useNavigate } from 'react-router-dom'

function NavBar(props) {

const navigate = useNavigate()

function handleClick() {
props.logout()
}

function handleHome() {
navigate('/')
}

return (
<div className='navbar'>
<div id='ihub-logo' ></div>
<div id='ihub-logo' onClick={handleHome}></div>
<p id='heading'>HISTOPATHOLOGY VIEWER</p>
<button id="logout-btn" onClick={handleClick}>Logout</button>
</div>
Expand Down
46 changes: 46 additions & 0 deletions client/src/components/PageNotFound/PageNotFound.css
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets use tailwind for css here

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.section{
text-align: center;
padding: 4rem 2rem;
}

.section .error{
font-size: 150px;
color: #006CA5;
text-shadow:
1px 1px 1px #02367B,
2px 2px 1px #02367B,
3px 3px 1px #02367B,
4px 4px 1px #02367B,
5px 5px 1px #02367B,
6px 6px 1px #02367B,
7px 7px 1px #02367B,
8px 8px 1px #02367B,
25px 25px 8px rgba(0,0,0, 0.2);
}

.page{
margin: 2rem 0;
font-family: 'Open Sans', sans-serif;
font-size: 20px;
font-weight: 600;
color: #444;
}

#home-btn {
background: #F54821;
border: 0;
border-style: none;
border-radius: 0.25rem;
color: white;
padding-left: 1rem;
padding-right: 1rem;
padding-bottom: 0.5rem;
padding-top: 0.5rem;
font-family: 'Open Sans', sans-serif;
outline: 2px solid transparent;
outline-offset: 2px;
cursor: pointer;
font-weight: bold;
width: 200px;
margin-right: 10px;
}
22 changes: 22 additions & 0 deletions client/src/components/PageNotFound/PageNotFound.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react'
import './PageNotFound.css'
import {useNavigate } from 'react-router-dom'

function PageNotFound() {

const navigate = useNavigate()

function handleClick() {
navigate('/')
}

return (
<div class='section'>
<h1 class='error'>404</h1>
<p class='page'>The page you are looking for is not found</p>
<button id='home-btn' onClick={handleClick}> Back to Home </button>
</div>
)
}

export default PageNotFound