Skip to content
Snippets Groups Projects
Commit 651b1f83 authored by Julien B.'s avatar Julien B.
Browse files

feat(front): web base for solidjs app

parent 3425fb9d
Branches main
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ from api.internal_services import neo4j, database
from api.internal_services.database import update_last_concept_index, get_last_concept_index
from api.internal_services.gpt import gpt_process
from api.internal_services.logger import logger
from api.internal_services.spacy import simple_parsing
from api.protos.inferer import inferer_pb2_grpc, inferer_pb2
is_using_GPT = True
......@@ -53,11 +54,14 @@ def annotation_process(job):
from api.internal_services.neo4j import driver, get_id_multi_tokens, get_id_single_tokens, create_concept_node, create_concept_relation
with (driver.session() as session):
for span in response:
if " " in span:
span['text'] = simple_parsing(span['text'])
if " " in span['text']:
word_ids = get_id_multi_tokens(span['text'], job.job_data['sentence_id'])
else:
word_ids = get_id_single_tokens(span['text'], job.job_data['sentence_id'])
logger.debug(f"{get_last_concept_index()} | {job.job_data['sentence_id']} | {span} | {word_ids}")
session.execute_write(
create_concept_node,
span['tag'],
......@@ -66,6 +70,7 @@ def annotation_process(job):
)
for word_id in word_ids:
logger.debug(f"creation relation entre : {word_id} et {get_last_concept_index()}")
session.execute_write(
create_concept_relation,
get_last_concept_index(),
......
node_modules
dist
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<link rel="shortcut icon" type="image/ico" href="/src/assets/favicon.ico" />
<title>ALA-Plateform</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script src="/src/index.jsx" type="module"></script>
</body>
</html>
{
"compilerOptions": {
"strict": true,
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "preserve",
"jsxImportSource": "solid-js",
"types": [
"vite/client",
"unplugin-icons/types/solid"
],
"noEmit": true,
"isolatedModules": true
}
}
This diff is collapsed.
{
"name": "vite-template-solid",
"version": "0.0.0",
"description": "",
"scripts": {
"start": "vite",
"dev": "vite",
"build": "vite build",
"serve": "vite preview"
},
"license": "MIT",
"devDependencies": {
"@iconify/json": "^2.2.241",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.41",
"solid-devtools": "^0.29.2",
"tailwindcss": "^3.4.10",
"unplugin-icons": "^0.19.2",
"vite": "^5.0.11",
"vite-plugin-solid": "^2.8.2"
},
"dependencies": {
"flowbite": "^2.5.1",
"solid-js": "^1.8.11"
}
}
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
import 'flowbite';
import Navbar from "~//components/navbar";
import Sidebar from "~//components/sidebar";
function App() {
return (
<div class="antialiased bg-gray-50 dark:bg-gray-900">
<Navbar/>
<Sidebar/>
<main class="p-4 h-auto pt-20">
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-4">
<div
class="border-2 border-dashed border-gray-300 rounded-lg dark:border-gray-600 h-32 md:h-64"
></div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-32 md:h-64"
></div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-32 md:h-64"
></div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-32 md:h-64"
></div>
</div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-96 mb-4"
></div>
<div class="grid grid-cols-2 gap-4 mb-4">
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-48 md:h-72"
></div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-48 md:h-72"
></div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-48 md:h-72"
></div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-48 md:h-72"
></div>
</div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-96 mb-4"
></div>
<div class="grid grid-cols-2 gap-4">
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-48 md:h-72"
></div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-48 md:h-72"
></div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-48 md:h-72"
></div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-48 md:h-72"
></div>
</div>
</main>
</div>
);
}
export default App;
\ No newline at end of file
front/src/assets/favicon.ico

14.7 KiB

import SolarHamburgerMenuLinear from '~icons/solar/hamburger-menu-linear'
import SolarBellLineDuotone from '~icons/solar/bell-line-duotone'
export default function Navbar() {
return (
<nav class="bg-white border-b border-gray-200 px-4 py-2.5 dark:bg-gray-800 dark:border-gray-700 fixed left-0 right-0 top-0 z-50">
<div class="flex flex-wrap justify-between items-center">
{/* navbar left */}
<div class="flex justify-start items-center">
<button
data-drawer-target="drawer-navigation"
data-drawer-toggle="drawer-navigation"
aria-controls="drawer-navigation"
class="p-2 mr-2 text-gray-600 rounded-lg cursor-pointer hover:text-gray-900 hover:bg-gray-100 focus:bg-gray-100 dark:focus:bg-gray-700 focus:ring-2 focus:ring-gray-100 dark:focus:ring-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
>
<SolarHamburgerMenuLinear />
<span class="sr-only">Toggle sidebar</span>
</button>
<a href="/" class="flex items-center justify-between mr-4">
{/* LOGO ICI */}
</a>
</div>
{/* navbar right */}
<div class="flex items-center lg:order-2">
<button
type="button"
data-dropdown-toggle="notification-dropdown"
class="p-2 mr-1 text-gray-500 rounded-lg hover:text-gray-900 hover:bg-gray-100 dark:text-gray-400 dark:hover:text-white dark:hover:bg-gray-700 focus:ring-4 focus:ring-gray-300 dark:focus:ring-gray-600"
>
<SolarBellLineDuotone />
<span class="sr-only">View notifications</span>
</button>
<div
class="hidden overflow-hidden z-50 my-4 max-w-sm text-base list-none bg-white rounded divide-y divide-gray-100 shadow-lg dark:divide-gray-600 dark:bg-gray-700 rounded-xl"
id="notification-dropdown"
>
<div class="block py-2 px-4 text-base font-medium text-center text-gray-700 bg-gray-50 dark:bg-gray-600 dark:text-gray-300">
Notifications
</div>
<div></div>
<a
href="#"
class="block py-2 text-md font-medium text-center text-gray-900 bg-gray-50 hover:bg-gray-100 dark:bg-gray-600 dark:text-white dark:hover:underline"
>
<div class="inline-flex items-center">
<svg
aria-hidden="true"
class="mr-2 w-4 h-4 text-gray-500 dark:text-gray-400"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M10 12a2 2 0 100-4 2 2 0 000 4z"></path>
<path
fill-rule="evenodd"
d="M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z"
clip-rule="evenodd"
></path>
</svg>
View all
</div>
</a>
</div>
<button
type="button"
class="flex mx-3 text-sm bg-gray-800 rounded-full md:mr-0 focus:ring-4 focus:ring-gray-300 dark:focus:ring-gray-600"
id="user-menu-button"
aria-expanded="false"
data-dropdown-toggle="dropdown"
>
<span class="sr-only">Open user menu</span>
<img
class="w-8 h-8 rounded-full"
src="https://flowbite.s3.amazonaws.com/blocks/marketing-ui/avatars/michael-gough.png"
alt="user photo"
/>
</button>
<div
class="hidden z-50 my-4 w-56 text-base list-none bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600 rounded-xl"
id="dropdown"
>
<div class="py-3 px-4">
<span class="block text-sm font-semibold text-gray-900 dark:text-white">
Neil Sims
</span>
<span class="block text-sm text-gray-900 truncate dark:text-white">
name@flowbite.com
</span>
</div>
<ul class="py-1 text-gray-700 dark:text-gray-300" aria-labelledby="dropdown">
<li>
<a
href="#"
class="block py-2 px-4 text-sm hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-400 dark:hover:text-white"
>
My profile
</a>
</li>
<li>
<a
href="#"
class="block py-2 px-4 text-sm hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-400 dark:hover:text-white"
>
Account settings
</a>
</li>
</ul>
<ul class="py-1 text-gray-700 dark:text-gray-300" aria-labelledby="dropdown">
<li>
<a
href="#"
class="flex items-center py-2 px-4 text-sm hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
>
<svg
class="mr-2 w-5 h-5 text-gray-400"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
d="M3.172 5.172a4 4 0 015.656 0L10 6.343l1.172-1.171a4 4 0 115.656 5.656L10 17.657l-6.828-6.829a4 4 0 010-5.656z"
clip-rule="evenodd"
></path>
</svg>
My likes
</a>
</li>
<li>
<a
href="#"
class="flex items-center py-2 px-4 text-sm hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
>
<svg
class="mr-2 w-5 h-5 text-gray-400"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M7 3a1 1 0 000 2h6a1 1 0 100-2H7zM4 7a1 1 0 011-1h10a1 1 0 110 2H5a1 1 0 01-1-1zM2 11a2 2 0 012-2h12a2 2 0 012 2v4a2 2 0 01-2 2H4a2 2 0 01-2-2v-4z"></path>
</svg>
Collections
</a>
</li>
<li>
<a
href="#"
class="flex justify-between items-center py-2 px-4 text-sm hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
>
<span class="flex items-center">
<svg
aria-hidden="true"
class="mr-2 w-5 h-5 text-primary-600 dark:text-primary-500"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
d="M12.395 2.553a1 1 0 00-1.45-.385c-.345.23-.614.558-.822.88-.214.33-.403.713-.57 1.116-.334.804-.614 1.768-.84 2.734a31.365 31.365 0 00-.613 3.58 2.64 2.64 0 01-.945-1.067c-.328-.68-.398-1.534-.398-2.654A1 1 0 005.05 6.05 6.981 6.981 0 003 11a7 7 0 1011.95-4.95c-.592-.591-.98-.985-1.348-1.467-.363-.476-.724-1.063-1.207-2.03zM12.12 15.12A3 3 0 017 13s.879.5 2.5.5c0-1 .5-4 1.25-4.5.5 1 .786 1.293 1.371 1.879A2.99 2.99 0 0113 13a2.99 2.99 0 01-.879 2.121z"
clip-rule="evenodd"
></path>
</svg>
Pro version
</span>
<svg
aria-hidden="true"
class="w-5 h-5 text-gray-400"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
clip-rule="evenodd"
></path>
</svg>
</a>
</li>
</ul>
<ul class="py-1 text-gray-700 dark:text-gray-300" aria-labelledby="dropdown">
<li>
<a
href="#"
class="block py-2 px-4 text-sm hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
>
Sign out
</a>
</li>
</ul>
</div>
</div>
</div>
</nav>
)
}
import SolarDocumentTextLinear from '~icons/solar/document-text-linear'
import SolarHelpOutline from '~icons/solar/help-outline'
import SolarHomeSmileBold from '~icons/solar/home-smile-bold'
export default function Sidebar() {
return (
<aside
class="fixed top-0 left-0 z-40 w-72 h-screen pt-14 transition-transform -translate-x-full bg-white border-r border-gray-200 dark:bg-gray-800 dark:border-gray-700"
aria-label="Sidenav"
id="drawer-navigation"
>
{/* top section */}
<div class="overflow-y-auto py-5 px-3 h-full bg-white dark:bg-gray-800">
<ul class="space-y-2">
<li>
<a
href="/"
class="flex items-center p-2 text-base font-medium text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group"
>
<SolarHomeSmileBold />
<span class="ml-3">My Home</span>
</a>
</li>
</ul>
<ul class="pt-5 mt-5 space-y-2 border-t border-gray-200 dark:border-gray-700">
<li>
<a
href="https://docs.crackito.io"
target="_blank"
class="flex items-center p-2 text-base font-medium text-gray-900 rounded-lg transition duration-75 hover:bg-gray-100 dark:hover:bg-gray-700 dark:text-white group"
>
<SolarDocumentTextLinear />
<span class="ml-3">Documentation</span>
</a>
</li>
<li>
<a
href="https://matrix.to/#/#ala-plateform:matrix.org"
target="_blank"
class="flex items-center p-2 text-base font-medium text-gray-900 rounded-lg transition duration-75 hover:bg-gray-100 dark:hover:bg-gray-700 dark:text-white group"
>
<SolarHelpOutline />
<span class="ml-3">Help</span>
</a>
</li>
</ul>
</div>
{/* bottom section*/}
<div class="hidden absolute bottom-0 left-0 justify-center p-4 space-x-4 w-full lg:flex bg-white dark:bg-gray-800 z-20">
</div>
</aside>
)
}
@tailwind base;
@tailwind components;
@tailwind utilities;
\ No newline at end of file
/* @refresh reload */
import { render } from 'solid-js/web';
import './index.css';
import App from './App';
const root = document.getElementById('root');
if (import.meta.env.DEV && !(root instanceof HTMLElement)) {
throw new Error(
'Root element not found. Did you forget to add it to your index.html? Or maybe the id attribute got misspelled?',
);
}
render(() => <App />, root);
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./src/**/*.{js,jsx,ts,tsx}",
"./node_modules/flowbite/**/*.js"
],
theme: {
extend: {
colors: {
primary: {
DEFAULT: '#0061FF',
50: '#B8D3FF',
100: '#A3C6FF',
200: '#7AADFF',
300: '#5294FF',
400: '#297AFF',
500: '#0061FF',
600: '#004CC7',
700: '#00368F',
800: '#002157',
900: '#000C1F',
950: '#000103'
},
},
},
fontFamily: {
body: [
'Inter',
'ui-sans-serif',
'system-ui',
'-apple-system',
'system-ui',
'Segoe UI',
'Roboto',
'Helvetica Neue',
'Arial',
'Noto Sans',
'sans-serif',
'Apple Color Emoji',
'Segoe UI Emoji',
'Segoe UI Symbol',
'Noto Color Emoji',
],
sans: [
'Inter',
'ui-sans-serif',
'system-ui',
'-apple-system',
'system-ui',
'Segoe UI',
'Roboto',
'Helvetica Neue',
'Arial',
'Noto Sans',
'sans-serif',
'Apple Color Emoji',
'Segoe UI Emoji',
'Segoe UI Symbol',
'Noto Color Emoji',
],
},
fontSize: {
xs: ['0.65rem', { lineHeight: '1rem' }],
sm: ['0.75rem', { lineHeight: '1.25rem' }],
base: ['0.875rem', { lineHeight: '1.5rem' }],
lg: ['1.9375rem', { lineHeight: '1.75rem' }],
xl: ['1.125rem', { lineHeight: '1.75rem' }],
},
},
plugins: [
require('flowbite/plugin')
],
}
import {defineConfig} from 'vite';
import solidPlugin from 'vite-plugin-solid';
import Icons from 'unplugin-icons/vite'
import path from 'path';
// import devtools from 'solid-devtools/vite';
export default defineConfig({
plugins: [
/*
Uncomment the following line to enable solid-devtools.
For more info see https://github.com/thetarnav/solid-devtools/tree/main/packages/extension#readme
*/
// devtools(),
solidPlugin(),
Icons({
compiler: 'solid'
}),
],
server: {
port: 3000,
},
build: {
target: 'esnext',
},
resolve: {
alias: {
'~/': path.resolve(__dirname, './src/'),
},
},
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment