Skip to content

Commit

Permalink
Merge pull request #65 from amosproj/feat/upload-of-pdf-documents
Browse files Browse the repository at this point in the history
Feat/upload of pdf documents
  • Loading branch information
nikolas-rauscher authored May 21, 2024
2 parents af40f5c + bd7e305 commit 3a46855
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 7 deletions.
1 change: 1 addition & 0 deletions Project/frontend/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_BACKEND_HOST= 'http://localhost:8000'
2 changes: 2 additions & 0 deletions Project/frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ dist-ssr
*.njsproj
*.sln
*.sw?
.vite/*

48 changes: 45 additions & 3 deletions Project/frontend/package-lock.json

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

7 changes: 5 additions & 2 deletions Project/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "frontend",
"name": "Graph Masters frontend",
"private": true,
"version": "0.0.0",
"type": "module",
Expand All @@ -10,10 +10,13 @@
"preview": "vite preview"
},
"dependencies": {
"filepond-plugin-file-validate-type": "^1.2.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"react-filepond": "^7.1.2"
},
"devDependencies": {
"@types/node": "^20.12.12",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.2.22",
"@typescript-eslint/eslint-plugin": "^7.2.0",
Expand Down
7 changes: 7 additions & 0 deletions Project/frontend/src/components/App/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,11 @@ body {
.logo {
height: 300px;
padding: 1.5em;
}

.main_wrapper {
display: flex;
flex-direction: column;
align-items: center;
gap: 20px;
}
8 changes: 6 additions & 2 deletions Project/frontend/src/components/App/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import logo from "../../assets/team-logo.svg";
import Upload from "../Upload";


import "./index.css";

function App() {
return (
<>
<main className="main_wrapper">

<header>
<h2>AMOS Project SS24 - Knowledge Graph Extractor</h2>
</header>
<img className="logo" src={logo} alt="" />
</>
<Upload />
</main>
);
}

Expand Down
3 changes: 3 additions & 0 deletions Project/frontend/src/components/Upload/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.upload_wrapper {
width: 500px;
}
24 changes: 24 additions & 0 deletions Project/frontend/src/components/Upload/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

import { FilePond, registerPlugin } from 'react-filepond'

import 'filepond/dist/filepond.min.css'
import "./index.css";
import FilePondPluginFileValidateType from 'filepond-plugin-file-validate-type';
// Register the plugin
registerPlugin(FilePondPluginFileValidateType);


function Upload() {
return <section className="upload_wrapper">
<FilePond
allowMultiple={false}
server={`${import.meta.env.VITE_BACKEND_HOST}/api/upload`}
name="file"
labelIdle='Drag & Drop your files or <span class="filepond--label-action">Browse</span>'
acceptedFileTypes={["application/pdf"]}
credits={false}
/>
</section>
}

export default Upload;

0 comments on commit 3a46855

Please sign in to comment.