-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from genomic-medicine-sweden/add-frontend-app
Add Base React App with Ant Design UI Library and React Router v6
- Loading branch information
Showing
23 changed files
with
2,529 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
test.py | ||
__pycache__/ | ||
*.csv | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Metagenomic Visualization | ||
|
||
Welcome to the **Meta Vis**. This application provides an interactive platform for visualizing results from metagenomic analysis. | ||
|
||
**Note**: This README is for the front-end application. | ||
|
||
The front-end is built using the following technologies: | ||
|
||
- **React**: A popular JavaScript library for building user interfaces, allowing for the creation of reusable components and a responsive user experience. | ||
- **Vite**: A modern build tool that offers fast development and optimized production builds, enhancing the development experience with instant hot module replacement and quick builds. | ||
- **TypeScript**: A statically typed superset of JavaScript that improves code quality and maintainability through type checking and advanced editor features. | ||
- **Ant Design (antd)**: A comprehensive design system and UI component library that provides a set of high-quality React components out-of-the-box, facilitating the creation of a consistent and professional user interface. | ||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import js from '@eslint/js' | ||
import globals from 'globals' | ||
import reactHooks from 'eslint-plugin-react-hooks' | ||
import reactRefresh from 'eslint-plugin-react-refresh' | ||
import tseslint from 'typescript-eslint' | ||
|
||
export default tseslint.config( | ||
{ ignores: ['dist'] }, | ||
{ | ||
extends: [js.configs.recommended, ...tseslint.configs.recommended], | ||
files: ['**/*.{ts,tsx}'], | ||
languageOptions: { | ||
ecmaVersion: 2020, | ||
globals: globals.browser, | ||
}, | ||
plugins: { | ||
'react-hooks': reactHooks, | ||
'react-refresh': reactRefresh, | ||
}, | ||
rules: { | ||
...reactHooks.configs.recommended.rules, | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
}, | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/meta-vis-logo.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Meta Vis</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "meta-vis", | ||
"private": false, | ||
"license": "MIT", | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc -b && vite build", | ||
"lint": "eslint .", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"react-router-dom": "^6.26.1" | ||
}, | ||
"devDependencies": { | ||
"@types/react-router-dom": "^5.3.3", | ||
"@ant-design/icons": "^5.4.0", | ||
"@eslint/js": "^9.9.0", | ||
"@types/react": "^18.3.3", | ||
"@types/react-dom": "^18.3.0", | ||
"@vitejs/plugin-react": "^4.3.1", | ||
"antd": "^5.20.5", | ||
"eslint": "^9.9.0", | ||
"eslint-plugin-react-hooks": "^5.1.0-rc.0", | ||
"eslint-plugin-react-refresh": "^0.4.9", | ||
"globals": "^15.9.0", | ||
"typescript": "^5.5.3", | ||
"typescript-eslint": "^8.0.1", | ||
"vite": "^5.4.1" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
import './App.css'; | ||
import { AppRouter } from './routes/AppRouter'; | ||
export const App = () => { | ||
return ( | ||
<AppRouter /> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.header { | ||
position: sticky; | ||
top: 0; | ||
z-index: 1; | ||
width: 100%; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.logo { | ||
margin-right: 50px; | ||
} | ||
|
||
.logo img { | ||
height: 50px; | ||
} | ||
|
||
.content { | ||
padding: 24px; | ||
min-height: calc(100vh - 108px); | ||
padding-bottom: 0; | ||
} | ||
|
||
.footer { | ||
text-align: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { Layout, Menu } from 'antd'; | ||
import { Link, Outlet, useLocation } from 'react-router-dom'; | ||
import './AppLayout.css'; | ||
|
||
const { Header, Content, Footer } = Layout; | ||
|
||
const appMenuItems = () => [ | ||
{ | ||
key: '/', | ||
label: <Link to="/">Home</Link>, | ||
}, | ||
{ | ||
key: '/about', | ||
label: <Link to="/about">About</Link>, | ||
} | ||
]; | ||
|
||
export const AppLayout = () => { | ||
const menuItems = appMenuItems(); | ||
const location = useLocation(); | ||
|
||
return ( | ||
<Layout> | ||
<Header className="header"> | ||
<div className="logo"> | ||
<img src="/meta-vis-logo.svg" alt="logo" /> | ||
</div> | ||
<Menu | ||
theme="dark" | ||
mode="horizontal" | ||
items={menuItems} | ||
style={{ flex: 1, minWidth: 0 }} | ||
defaultSelectedKeys={[location.pathname]} | ||
/> | ||
</Header> | ||
<Content className="content"> | ||
<div> | ||
<Outlet /> {/* This is where your routed components will be rendered */} | ||
</div> | ||
</Content> | ||
<Footer className="footer"> | ||
Meta Vis {new Date().getFullYear()} | ||
</Footer> | ||
</Layout> | ||
); | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { StrictMode } from 'react' | ||
import { createRoot } from 'react-dom/client' | ||
import {App} from './App.tsx' | ||
import './index.css' | ||
import 'antd/dist/reset.css'; | ||
|
||
|
||
createRoot(document.getElementById('root')!).render( | ||
<StrictMode> | ||
<App /> | ||
</StrictMode>, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const About = () => { | ||
return ( | ||
<div>About</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const Home = () => { | ||
return ( | ||
<div>Home</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { createBrowserRouter, createRoutesFromElements, Route, RouterProvider } from 'react-router-dom'; | ||
import { Home } from '../pages/Home'; | ||
import { About } from '../pages/About'; | ||
import { AppLayout } from '../appLayout/AppLayout'; | ||
|
||
|
||
const router = createBrowserRouter( | ||
createRoutesFromElements( | ||
<Route element={<AppLayout />}> | ||
<Route path="/" element={<Home />} /> | ||
<Route path="/about" element={<About />} /> | ||
<Route path="*" element={<div>404 Not Found</div>} /> | ||
</Route> | ||
) | ||
); | ||
|
||
|
||
export const AppRouter = () => { | ||
return <RouterProvider router={router} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference types="vite/client" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"useDefineForClassFields": true, | ||
"lib": ["ES2020", "DOM", "DOM.Iterable"], | ||
"module": "ESNext", | ||
"skipLibCheck": true, | ||
|
||
/* Bundler mode */ | ||
"moduleResolution": "bundler", | ||
"allowImportingTsExtensions": true, | ||
"isolatedModules": true, | ||
"moduleDetection": "force", | ||
"noEmit": true, | ||
"jsx": "react-jsx", | ||
|
||
/* Linting */ | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true | ||
}, | ||
"include": ["src"] | ||
} |
Oops, something went wrong.