diff --git a/.gitignore b/.gitignore index ed7057e..4d3e5c7 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,8 @@ deps/src/ docs/build/ docs/site/ Manifest.toml -*.DS_Store +!app/Manifest.toml +.DS_Store out build draft \ No newline at end of file diff --git a/CITATION.bib b/CITATION.bib new file mode 100644 index 0000000..e69de29 diff --git a/Project.toml b/Project.toml index a0a3057..faf0b46 100644 --- a/Project.toml +++ b/Project.toml @@ -14,24 +14,12 @@ TidierStrings = "248e6834-d0f8-40ef-8fbb-8e711d883e9c" Transformers = "21ca0261-441d-5938-ace7-c90938fde4d4" [compat] -CSV = "0.10" DataFrames = "1.6" DataStructures = "0.18" -HTMLTables = "0.4" Graphviz_jll = "2.50" LinearAlgebra = "1" Poppler_jll = "24.6" Statistics = "1" TidierStrings = "0.2" Transformers = "0.3" -XLSX = "0.10" julia = "1" - -[extras] -CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" -HTMLTables = "b1afcece-b80e-4563-b90e-36b4cc56d3fa" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" -XLSX = "fdbf4ff8-1666-58a4-91e7-1b58723a45e0" - -[targets] -test = ["Test", "CSV", "HTMLTables", "XLSX"] diff --git a/README.md b/README.md index 6a0950d..fe21a23 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,27 @@
- +

-Julia package and [web application](https://prisma-jl.onrender.com) built with [`Solid.js`](https://www.solidjs.com/) and [`Oxygen.jl`](https://github.com/OxygenFramework/Oxygen.jl) for generating checklists and flow diagrams based on [the 2020 **P**referred **R**eporting **I**tems for **S**ystematic **R**eviews and **M**eta-**A**nalyses (PRISMA) statement (Page et al., 2021).](https://doi.org/10.1186/s13643-021-01626-4) +Julia package and [web application](https://prisma-jl.onrender.com) powered by [`Solid.js`](https://www.solidjs.com/) and [`Oxygen.jl`](https://github.com/OxygenFramework/Oxygen.jl) for generating checklists and flow diagrams based on [the 2020 **P**referred **R**eporting **I**tems for **S**ystematic **R**eviews and **M**eta-**A**nalyses (PRISMA) statement (Page et al., 2021).](https://doi.org/10.1186/s13643-021-01626-4) -:arrow_down: **Installation:** use this command in the Julia REPL: `using Pkg; Pkg.add("PRISMA")` +**Features:** -:book: **Documentation:** Documentation Stable Documentation Dev +- natural language processing (NLP) of manuscript PDFs to generate completed 2020 PRISMA checklists. +- highly customizable 2020 PRISMA flow diagrams generated from study data. +- Interactive web app that requires zero programming knowledge. -:books: **References:** +**Installation:** use this command in the Julia REPL: `using Pkg; Pkg.add("PRISMA")` + +**Documentation:** Documentation Stable Documentation Dev + +**Citing:** Please consider citing PRISMA.jl and giving the GitHub repository a star, if possible. + +The citation information may be found in the [`CITATION.bib`](CITATION.bib) file within the repository + +**References:** > Bezanson, J., Edelman, A., Karpinski, S., & Shah, V. B. (2017). Julia: A fresh approach to numerical computing. SIAM Review, 59(1), 65–98. https://doi.org/10.1137/141000671 diff --git a/app/Dockerfile b/app/Dockerfile new file mode 100644 index 0000000..33a55ee --- /dev/null +++ b/app/Dockerfile @@ -0,0 +1,5 @@ +FROM julia:1.10 +WORKDIR /app +COPY . . +RUN julia --project -e "using Pkg; Pkg.instantiate()" +ENTRYPOINT [ "julia", "--project", "src/app.jl" ] \ No newline at end of file diff --git a/app/Manifest.toml b/app/Manifest.toml new file mode 100644 index 0000000..e69de29 diff --git a/app/backend/Project.toml b/app/Project.toml similarity index 79% rename from app/backend/Project.toml rename to app/Project.toml index bcbc0bb..16533fe 100644 --- a/app/backend/Project.toml +++ b/app/Project.toml @@ -4,6 +4,8 @@ DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" HTMLTables = "b1afcece-b80e-4563-b90e-36b4cc56d3fa" HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" JSONTables = "b9914132-a727-11e9-1322-f18e41205b0b" +JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" +NodeJS = "47edcb42-4c32-5a88-959f-defineb9c2f8b290" Oxygen = "df9a0d86-3283-4920-82dc-4555fc0d1d8b" PRISMA = "7b67a8d2-c4f5-4933-b91c-0fc427024db5" @@ -13,6 +15,8 @@ DataFrames = "1" HTMLTables = "0.4" HTTP = "1" JSONTables = "1" +JSON3 = "1" +NodeJS = "2" Oxygen = "1" PRISMA = "0.0.5" julia = "1" \ No newline at end of file diff --git a/app/backend/Dockerfile b/app/backend/Dockerfile deleted file mode 100644 index 65ed84e..0000000 --- a/app/backend/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM julia:1.10 - -COPY app.jl . - -RUN julia -e 'using Pkg; Pkg.add(["CSV","DataFrames","HTMLTables","HTTP","JSONTables","Oxygen","PRISMA"])' - -CMD julia app.jl diff --git a/app/frontend/src/app.tsx b/app/frontend/app.tsx similarity index 100% rename from app/frontend/src/app.tsx rename to app/frontend/app.tsx diff --git a/app/frontend/src/assets/css/app.css b/app/frontend/assets/css/app.css similarity index 100% rename from app/frontend/src/assets/css/app.css rename to app/frontend/assets/css/app.css diff --git a/app/frontend/src/assets/css/checklist.css b/app/frontend/assets/css/checklist.css similarity index 100% rename from app/frontend/src/assets/css/checklist.css rename to app/frontend/assets/css/checklist.css diff --git a/app/frontend/src/assets/css/flow_diagram.css b/app/frontend/assets/css/flow_diagram.css similarity index 100% rename from app/frontend/src/assets/css/flow_diagram.css rename to app/frontend/assets/css/flow_diagram.css diff --git a/app/frontend/src/assets/css/footer.css b/app/frontend/assets/css/footer.css similarity index 100% rename from app/frontend/src/assets/css/footer.css rename to app/frontend/assets/css/footer.css diff --git a/app/frontend/src/assets/css/header.css b/app/frontend/assets/css/header.css similarity index 100% rename from app/frontend/src/assets/css/header.css rename to app/frontend/assets/css/header.css diff --git a/app/frontend/src/assets/css/home.css b/app/frontend/assets/css/home.css similarity index 100% rename from app/frontend/src/assets/css/home.css rename to app/frontend/assets/css/home.css diff --git a/app/frontend/src/assets/css/notfound.css b/app/frontend/assets/css/notfound.css similarity index 100% rename from app/frontend/src/assets/css/notfound.css rename to app/frontend/assets/css/notfound.css diff --git a/app/frontend/public/favicon.ico b/app/frontend/assets/favicon.ico similarity index 100% rename from app/frontend/public/favicon.ico rename to app/frontend/assets/favicon.ico diff --git a/app/frontend/src/assets/fonts/LICENSE.txt b/app/frontend/assets/fonts/LICENSE.txt similarity index 100% rename from app/frontend/src/assets/fonts/LICENSE.txt rename to app/frontend/assets/fonts/LICENSE.txt diff --git a/app/frontend/src/assets/fonts/README.txt b/app/frontend/assets/fonts/README.txt similarity index 100% rename from app/frontend/src/assets/fonts/README.txt rename to app/frontend/assets/fonts/README.txt diff --git a/app/frontend/src/assets/fonts/RobotoSlab-Black.ttf b/app/frontend/assets/fonts/RobotoSlab-Black.ttf similarity index 100% rename from app/frontend/src/assets/fonts/RobotoSlab-Black.ttf rename to app/frontend/assets/fonts/RobotoSlab-Black.ttf diff --git a/app/frontend/src/assets/fonts/RobotoSlab-Bold.ttf b/app/frontend/assets/fonts/RobotoSlab-Bold.ttf similarity index 100% rename from app/frontend/src/assets/fonts/RobotoSlab-Bold.ttf rename to app/frontend/assets/fonts/RobotoSlab-Bold.ttf diff --git a/app/frontend/src/assets/fonts/RobotoSlab-ExtraBold.ttf b/app/frontend/assets/fonts/RobotoSlab-ExtraBold.ttf similarity index 100% rename from app/frontend/src/assets/fonts/RobotoSlab-ExtraBold.ttf rename to app/frontend/assets/fonts/RobotoSlab-ExtraBold.ttf diff --git a/app/frontend/src/assets/fonts/RobotoSlab-ExtraLight.ttf b/app/frontend/assets/fonts/RobotoSlab-ExtraLight.ttf similarity index 100% rename from app/frontend/src/assets/fonts/RobotoSlab-ExtraLight.ttf rename to app/frontend/assets/fonts/RobotoSlab-ExtraLight.ttf diff --git a/app/frontend/src/assets/fonts/RobotoSlab-Light.ttf b/app/frontend/assets/fonts/RobotoSlab-Light.ttf similarity index 100% rename from app/frontend/src/assets/fonts/RobotoSlab-Light.ttf rename to app/frontend/assets/fonts/RobotoSlab-Light.ttf diff --git a/app/frontend/src/assets/fonts/RobotoSlab-Medium.ttf b/app/frontend/assets/fonts/RobotoSlab-Medium.ttf similarity index 100% rename from app/frontend/src/assets/fonts/RobotoSlab-Medium.ttf rename to app/frontend/assets/fonts/RobotoSlab-Medium.ttf diff --git a/app/frontend/src/assets/fonts/RobotoSlab-Regular.ttf b/app/frontend/assets/fonts/RobotoSlab-Regular.ttf similarity index 100% rename from app/frontend/src/assets/fonts/RobotoSlab-Regular.ttf rename to app/frontend/assets/fonts/RobotoSlab-Regular.ttf diff --git a/app/frontend/src/assets/fonts/RobotoSlab-SemiBold.ttf b/app/frontend/assets/fonts/RobotoSlab-SemiBold.ttf similarity index 100% rename from app/frontend/src/assets/fonts/RobotoSlab-SemiBold.ttf rename to app/frontend/assets/fonts/RobotoSlab-SemiBold.ttf diff --git a/app/frontend/src/assets/fonts/RobotoSlab-Thin.ttf b/app/frontend/assets/fonts/RobotoSlab-Thin.ttf similarity index 100% rename from app/frontend/src/assets/fonts/RobotoSlab-Thin.ttf rename to app/frontend/assets/fonts/RobotoSlab-Thin.ttf diff --git a/app/frontend/src/assets/fonts/RobotoSlab-VariableFont_wght.ttf b/app/frontend/assets/fonts/RobotoSlab-VariableFont_wght.ttf similarity index 100% rename from app/frontend/src/assets/fonts/RobotoSlab-VariableFont_wght.ttf rename to app/frontend/assets/fonts/RobotoSlab-VariableFont_wght.ttf diff --git a/app/frontend/src/assets/svgs/atoz.svg b/app/frontend/assets/svgs/atoz.svg similarity index 100% rename from app/frontend/src/assets/svgs/atoz.svg rename to app/frontend/assets/svgs/atoz.svg diff --git a/app/frontend/src/assets/svgs/check.svg b/app/frontend/assets/svgs/check.svg similarity index 100% rename from app/frontend/src/assets/svgs/check.svg rename to app/frontend/assets/svgs/check.svg diff --git a/app/frontend/src/assets/svgs/circle-x.svg b/app/frontend/assets/svgs/circle-x.svg similarity index 100% rename from app/frontend/src/assets/svgs/circle-x.svg rename to app/frontend/assets/svgs/circle-x.svg diff --git a/app/frontend/src/assets/svgs/cloud.svg b/app/frontend/assets/svgs/cloud.svg similarity index 100% rename from app/frontend/src/assets/svgs/cloud.svg rename to app/frontend/assets/svgs/cloud.svg diff --git a/app/frontend/src/assets/svgs/double-left.svg b/app/frontend/assets/svgs/double-left.svg similarity index 100% rename from app/frontend/src/assets/svgs/double-left.svg rename to app/frontend/assets/svgs/double-left.svg diff --git a/app/frontend/src/assets/svgs/double-right.svg b/app/frontend/assets/svgs/double-right.svg similarity index 100% rename from app/frontend/src/assets/svgs/double-right.svg rename to app/frontend/assets/svgs/double-right.svg diff --git a/app/frontend/src/assets/svgs/down.svg b/app/frontend/assets/svgs/down.svg similarity index 100% rename from app/frontend/src/assets/svgs/down.svg rename to app/frontend/assets/svgs/down.svg diff --git a/app/frontend/src/assets/svgs/download.svg b/app/frontend/assets/svgs/download.svg similarity index 100% rename from app/frontend/src/assets/svgs/download.svg rename to app/frontend/assets/svgs/download.svg diff --git a/app/frontend/src/assets/svgs/edit.svg b/app/frontend/assets/svgs/edit.svg similarity index 100% rename from app/frontend/src/assets/svgs/edit.svg rename to app/frontend/assets/svgs/edit.svg diff --git a/app/frontend/src/assets/svgs/github.svg b/app/frontend/assets/svgs/github.svg similarity index 100% rename from app/frontend/src/assets/svgs/github.svg rename to app/frontend/assets/svgs/github.svg diff --git a/app/frontend/src/assets/svgs/left.svg b/app/frontend/assets/svgs/left.svg similarity index 100% rename from app/frontend/src/assets/svgs/left.svg rename to app/frontend/assets/svgs/left.svg diff --git a/app/frontend/src/assets/svgs/logo.svg b/app/frontend/assets/svgs/logo.svg similarity index 100% rename from app/frontend/src/assets/svgs/logo.svg rename to app/frontend/assets/svgs/logo.svg diff --git a/app/frontend/src/assets/svgs/magnifying-glass.svg b/app/frontend/assets/svgs/magnifying-glass.svg similarity index 100% rename from app/frontend/src/assets/svgs/magnifying-glass.svg rename to app/frontend/assets/svgs/magnifying-glass.svg diff --git a/app/frontend/src/assets/svgs/moon.svg b/app/frontend/assets/svgs/moon.svg similarity index 100% rename from app/frontend/src/assets/svgs/moon.svg rename to app/frontend/assets/svgs/moon.svg diff --git a/app/frontend/src/assets/svgs/reset.svg b/app/frontend/assets/svgs/reset.svg similarity index 100% rename from app/frontend/src/assets/svgs/reset.svg rename to app/frontend/assets/svgs/reset.svg diff --git a/app/frontend/src/assets/svgs/right.svg b/app/frontend/assets/svgs/right.svg similarity index 100% rename from app/frontend/src/assets/svgs/right.svg rename to app/frontend/assets/svgs/right.svg diff --git a/app/frontend/src/assets/svgs/square-check.svg b/app/frontend/assets/svgs/square-check.svg similarity index 100% rename from app/frontend/src/assets/svgs/square-check.svg rename to app/frontend/assets/svgs/square-check.svg diff --git a/app/frontend/src/assets/svgs/square.svg b/app/frontend/assets/svgs/square.svg similarity index 100% rename from app/frontend/src/assets/svgs/square.svg rename to app/frontend/assets/svgs/square.svg diff --git a/app/frontend/src/assets/svgs/sun.svg b/app/frontend/assets/svgs/sun.svg similarity index 100% rename from app/frontend/src/assets/svgs/sun.svg rename to app/frontend/assets/svgs/sun.svg diff --git a/app/frontend/src/assets/svgs/trash.svg b/app/frontend/assets/svgs/trash.svg similarity index 100% rename from app/frontend/src/assets/svgs/trash.svg rename to app/frontend/assets/svgs/trash.svg diff --git a/app/frontend/src/assets/svgs/x.svg b/app/frontend/assets/svgs/x.svg similarity index 100% rename from app/frontend/src/assets/svgs/x.svg rename to app/frontend/assets/svgs/x.svg diff --git a/app/frontend/src/assets/svgs/ztoa.svg b/app/frontend/assets/svgs/ztoa.svg similarity index 100% rename from app/frontend/src/assets/svgs/ztoa.svg rename to app/frontend/assets/svgs/ztoa.svg diff --git a/app/frontend/src/components/footer.tsx b/app/frontend/components/footer.tsx similarity index 100% rename from app/frontend/src/components/footer.tsx rename to app/frontend/components/footer.tsx diff --git a/app/frontend/src/components/header.tsx b/app/frontend/components/header.tsx similarity index 100% rename from app/frontend/src/components/header.tsx rename to app/frontend/components/header.tsx diff --git a/app/frontend/src/index.tsx b/app/frontend/index.tsx similarity index 100% rename from app/frontend/src/index.tsx rename to app/frontend/index.tsx diff --git a/app/frontend/src/pages/checklist.tsx b/app/frontend/pages/checklist.tsx similarity index 99% rename from app/frontend/src/pages/checklist.tsx rename to app/frontend/pages/checklist.tsx index 8e67c18..bdbe157 100644 --- a/app/frontend/src/pages/checklist.tsx +++ b/app/frontend/pages/checklist.tsx @@ -76,7 +76,7 @@ export default function Checklist() { formData.append("file", file()); try { const response = await fetch( - "https://prisma-jl-api.onrender.com/checklist/generate", + "https://prisma-jl.onrender.com/api/checklist/generate", { method: "POST", body: formData, @@ -249,7 +249,7 @@ export default function Checklist() { })); try { const response = await fetch( - "https://prisma-jl-api.onrender.com/checklist/export", + "https://prisma-jl.onrender.com/api/checklist/export", { method: "POST", headers: { "Content-Type": "application/json" }, diff --git a/app/frontend/src/pages/flow_diagram.tsx b/app/frontend/pages/flow_diagram.tsx similarity index 99% rename from app/frontend/src/pages/flow_diagram.tsx rename to app/frontend/pages/flow_diagram.tsx index cc27361..f7ee00b 100644 --- a/app/frontend/src/pages/flow_diagram.tsx +++ b/app/frontend/pages/flow_diagram.tsx @@ -371,7 +371,7 @@ export default function FlowDiagram() { async function getFlowDiagram() { try { const response = await fetch( - "https://prisma-jl-api.onrender.com/flow_diagram/generate", + "https://prisma-jl.onrender.com/api/flow_diagram/generate", { method: "POST", headers: { "Content-Type": "application/json" }, @@ -414,7 +414,7 @@ export default function FlowDiagram() { async function downloadFlowDiagram() { try { const response = await fetch( - "https://prisma-jl-api.onrender.com/flow_diagram/export", + "https://prisma-jl.onrender.com/api/flow_diagram/export", { method: "POST", headers: { "Content-Type": "application/json" }, diff --git a/app/frontend/src/pages/home.tsx b/app/frontend/pages/home.tsx similarity index 100% rename from app/frontend/src/pages/home.tsx rename to app/frontend/pages/home.tsx diff --git a/app/frontend/src/pages/notfound.tsx b/app/frontend/pages/notfound.tsx similarity index 100% rename from app/frontend/src/pages/notfound.tsx rename to app/frontend/pages/notfound.tsx diff --git a/app/frontend/index.html b/app/index.html similarity index 81% rename from app/frontend/index.html rename to app/index.html index e8a40dd..ec5be8c 100644 --- a/app/frontend/index.html +++ b/app/index.html @@ -4,7 +4,7 @@ - + PRISMA.jl @@ -14,7 +14,7 @@
- + \ No newline at end of file diff --git a/app/frontend/package-lock.json b/app/package-lock.json similarity index 92% rename from app/frontend/package-lock.json rename to app/package-lock.json index d90a351..65de1ed 100644 --- a/app/frontend/package-lock.json +++ b/app/package-lock.json @@ -1,10 +1,9 @@ { - "name": "prisma-app", + "name": "app", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "prisma-app", "license": "MIT", "dependencies": { "@solidjs/router": "^0.14.1", @@ -871,9 +870,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.19.2.tgz", - "integrity": "sha512-OHflWINKtoCFSpm/WmuQaWW4jeX+3Qt3XQDepkkiFTsoxFc5BpF3Z5aDxFZgBqRjO6ATP5+b1iilp4kGIZVWlA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.20.0.tgz", + "integrity": "sha512-TSpWzflCc4VGAUJZlPpgAJE1+V60MePDQnBd7PPkpuEmOy8i87aL6tinFGKBFKuEDikYpig72QzdT3QPYIi+oA==", "cpu": [ "arm" ], @@ -884,9 +883,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.19.2.tgz", - "integrity": "sha512-k0OC/b14rNzMLDOE6QMBCjDRm3fQOHAL8Ldc9bxEWvMo4Ty9RY6rWmGetNTWhPo+/+FNd1lsQYRd0/1OSix36A==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.20.0.tgz", + "integrity": "sha512-u00Ro/nok7oGzVuh/FMYfNoGqxU5CPWz1mxV85S2w9LxHR8OoMQBuSk+3BKVIDYgkpeOET5yXkx90OYFc+ytpQ==", "cpu": [ "arm64" ], @@ -897,9 +896,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.19.2.tgz", - "integrity": "sha512-IIARRgWCNWMTeQH+kr/gFTHJccKzwEaI0YSvtqkEBPj7AshElFq89TyreKNFAGh5frLfDCbodnq+Ye3dqGKPBw==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.20.0.tgz", + "integrity": "sha512-uFVfvzvsdGtlSLuL0ZlvPJvl6ZmrH4CBwLGEFPe7hUmf7htGAN+aXo43R/V6LATyxlKVC/m6UsLb7jbG+LG39Q==", "cpu": [ "arm64" ], @@ -910,9 +909,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.19.2.tgz", - "integrity": "sha512-52udDMFDv54BTAdnw+KXNF45QCvcJOcYGl3vQkp4vARyrcdI/cXH8VXTEv/8QWfd6Fru8QQuw1b2uNersXOL0g==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.20.0.tgz", + "integrity": "sha512-xbrMDdlev53vNXexEa6l0LffojxhqDTBeL+VUxuuIXys4x6xyvbKq5XqTXBCEUA8ty8iEJblHvFaWRJTk/icAQ==", "cpu": [ "x64" ], @@ -923,9 +922,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.19.2.tgz", - "integrity": "sha512-r+SI2t8srMPYZeoa1w0o/AfoVt9akI1ihgazGYPQGRilVAkuzMGiTtexNZkrPkQsyFrvqq/ni8f3zOnHw4hUbA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.20.0.tgz", + "integrity": "sha512-jMYvxZwGmoHFBTbr12Xc6wOdc2xA5tF5F2q6t7Rcfab68TT0n+r7dgawD4qhPEvasDsVpQi+MgDzj2faOLsZjA==", "cpu": [ "arm" ], @@ -936,9 +935,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.19.2.tgz", - "integrity": "sha512-+tYiL4QVjtI3KliKBGtUU7yhw0GMcJJuB9mLTCEauHEsqfk49gtUBXGtGP3h1LW8MbaTY6rSFIQV1XOBps1gBA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.20.0.tgz", + "integrity": "sha512-1asSTl4HKuIHIB1GcdFHNNZhxAYEdqML/MW4QmPS4G0ivbEcBr1JKlFLKsIRqjSwOBkdItn3/ZDlyvZ/N6KPlw==", "cpu": [ "arm" ], @@ -949,9 +948,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.19.2.tgz", - "integrity": "sha512-OR5DcvZiYN75mXDNQQxlQPTv4D+uNCUsmSCSY2FolLf9W5I4DSoJyg7z9Ea3TjKfhPSGgMJiey1aWvlWuBzMtg==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.20.0.tgz", + "integrity": "sha512-COBb8Bkx56KldOYJfMf6wKeYJrtJ9vEgBRAOkfw6Ens0tnmzPqvlpjZiLgkhg6cA3DGzCmLmmd319pmHvKWWlQ==", "cpu": [ "arm64" ], @@ -962,9 +961,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.19.2.tgz", - "integrity": "sha512-Hw3jSfWdUSauEYFBSFIte6I8m6jOj+3vifLg8EU3lreWulAUpch4JBjDMtlKosrBzkr0kwKgL9iCfjA8L3geoA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.20.0.tgz", + "integrity": "sha512-+it+mBSyMslVQa8wSPvBx53fYuZK/oLTu5RJoXogjk6x7Q7sz1GNRsXWjn6SwyJm8E/oMjNVwPhmNdIjwP135Q==", "cpu": [ "arm64" ], @@ -975,9 +974,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.19.2.tgz", - "integrity": "sha512-rhjvoPBhBwVnJRq/+hi2Q3EMiVF538/o9dBuj9TVLclo9DuONqt5xfWSaE6MYiFKpo/lFPJ/iSI72rYWw5Hc7w==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.20.0.tgz", + "integrity": "sha512-yAMvqhPfGKsAxHN8I4+jE0CpLWD8cv4z7CK7BMmhjDuz606Q2tFKkWRY8bHR9JQXYcoLfopo5TTqzxgPUjUMfw==", "cpu": [ "ppc64" ], @@ -988,9 +987,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.19.2.tgz", - "integrity": "sha512-EAz6vjPwHHs2qOCnpQkw4xs14XJq84I81sDRGPEjKPFVPBw7fwvtwhVjcZR6SLydCv8zNK8YGFblKWd/vRmP8g==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.20.0.tgz", + "integrity": "sha512-qmuxFpfmi/2SUkAw95TtNq/w/I7Gpjurx609OOOV7U4vhvUhBcftcmXwl3rqAek+ADBwSjIC4IVNLiszoj3dPA==", "cpu": [ "riscv64" ], @@ -1001,9 +1000,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.19.2.tgz", - "integrity": "sha512-IJSUX1xb8k/zN9j2I7B5Re6B0NNJDJ1+soezjNojhT8DEVeDNptq2jgycCOpRhyGj0+xBn7Cq+PK7Q+nd2hxLA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.20.0.tgz", + "integrity": "sha512-I0BtGXddHSHjV1mqTNkgUZLnS3WtsqebAXv11D5BZE/gfw5KoyXSAXVqyJximQXNvNzUo4GKlCK/dIwXlz+jlg==", "cpu": [ "s390x" ], @@ -1014,9 +1013,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.19.2.tgz", - "integrity": "sha512-OgaToJ8jSxTpgGkZSkwKE+JQGihdcaqnyHEFOSAU45utQ+yLruE1dkonB2SDI8t375wOKgNn8pQvaWY9kPzxDQ==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.20.0.tgz", + "integrity": "sha512-y+eoL2I3iphUg9tN9GB6ku1FA8kOfmF4oUEWhztDJ4KXJy1agk/9+pejOuZkNFhRwHAOxMsBPLbXPd6mJiCwew==", "cpu": [ "x64" ], @@ -1027,9 +1026,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.19.2.tgz", - "integrity": "sha512-5V3mPpWkB066XZZBgSd1lwozBk7tmOkKtquyCJ6T4LN3mzKENXyBwWNQn8d0Ci81hvlBw5RoFgleVpL6aScLYg==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.20.0.tgz", + "integrity": "sha512-hM3nhW40kBNYUkZb/r9k2FKK+/MnKglX7UYd4ZUy5DJs8/sMsIbqWK2piZtVGE3kcXVNj3B2IrUYROJMMCikNg==", "cpu": [ "x64" ], @@ -1040,9 +1039,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.19.2.tgz", - "integrity": "sha512-ayVstadfLeeXI9zUPiKRVT8qF55hm7hKa+0N1V6Vj+OTNFfKSoUxyZvzVvgtBxqSb5URQ8sK6fhwxr9/MLmxdA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.20.0.tgz", + "integrity": "sha512-psegMvP+Ik/Bg7QRJbv8w8PAytPA7Uo8fpFjXyCRHWm6Nt42L+JtoqH8eDQ5hRP7/XW2UiIriy1Z46jf0Oa1kA==", "cpu": [ "arm64" ], @@ -1053,9 +1052,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.19.2.tgz", - "integrity": "sha512-Mda7iG4fOLHNsPqjWSjANvNZYoW034yxgrndof0DwCy0D3FvTjeNo+HGE6oGWgvcLZNLlcp0hLEFcRs+UGsMLg==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.20.0.tgz", + "integrity": "sha512-GabekH3w4lgAJpVxkk7hUzUf2hICSQO0a/BLFA11/RMxQT92MabKAqyubzDZmMOC/hcJNlc+rrypzNzYl4Dx7A==", "cpu": [ "ia32" ], @@ -1066,9 +1065,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.19.2.tgz", - "integrity": "sha512-DPi0ubYhSow/00YqmG1jWm3qt1F8aXziHc/UNy8bo9cpCacqhuWu+iSq/fp2SyEQK7iYTZ60fBU9cat3MXTjIQ==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.20.0.tgz", + "integrity": "sha512-aJ1EJSuTdGnM6qbVC4B5DSmozPTqIag9fSzXRNNo+humQLG89XpPgdt16Ia56ORD7s+H8Pmyx44uczDQ0yDzpg==", "cpu": [ "x64" ], @@ -1079,9 +1078,9 @@ ] }, "node_modules/@solidjs/router": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/@solidjs/router/-/router-0.14.1.tgz", - "integrity": "sha512-GumQ4jbt5xDngLypAndC4EjapY/3DP0G8Az4YWEVQHdCtjHwB8IOm32eEBxE9lKpOffbtXV0r/0X0mofHJ1m5w==", + "version": "0.14.3", + "resolved": "https://registry.npmjs.org/@solidjs/router/-/router-0.14.3.tgz", + "integrity": "sha512-9p4k4zL2baK/1XRQALbFcaQ4IikjkWmxqYQtFqLzjONUejhL1uqJHtzxB4tZjmNqtRANVRnTDbJfzjvaD9k+pQ==", "peerDependencies": { "solid-js": "^1.8.6" } @@ -1233,9 +1232,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001646", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001646.tgz", - "integrity": "sha512-dRg00gudiBDDTmUhClSdv3hqRfpbOnU28IpI1T6PBTLWa+kOj0681C8uML3PifYfREuBrVjDGhL3adYpBT6spw==", + "version": "1.0.30001651", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz", + "integrity": "sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==", "dev": true, "funding": [ { @@ -1448,9 +1447,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.4.tgz", - "integrity": "sha512-orzA81VqLyIGUEA77YkVA1D+N+nNfl2isJVjjmOyrlxuooZ19ynb+dOlaDTqd/idKRS9lDCSBmtzM+kyCsMnkA==", + "version": "1.5.8", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.8.tgz", + "integrity": "sha512-4Nx0gP2tPNBLTrFxBMHpkQbtn2hidPVr/+/FTtcCiBYTucqc70zRyVZiOLj17Ui3wTO7SQ1/N+hkHYzJjBzt6A==", "dev": true }, "node_modules/entities": { @@ -1689,9 +1688,9 @@ "dev": true }, "node_modules/postcss": { - "version": "8.4.40", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.40.tgz", - "integrity": "sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q==", + "version": "8.4.41", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.41.tgz", + "integrity": "sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==", "dev": true, "funding": [ { @@ -1717,9 +1716,9 @@ } }, "node_modules/rollup": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.19.2.tgz", - "integrity": "sha512-6/jgnN1svF9PjNYJ4ya3l+cqutg49vOZ4rVgsDKxdl+5gpGPnByFXWGyfH9YGx9i3nfBwSu1Iyu6vGwFFA0BdQ==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.20.0.tgz", + "integrity": "sha512-6rbWBChcnSGzIlXeIdNIZTopKYad8ZG8ajhl78lGRLsI2rX8IkaotQhVas2Ma+GPxJav19wrSzvRvuiv0YKzWw==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -1732,22 +1731,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.19.2", - "@rollup/rollup-android-arm64": "4.19.2", - "@rollup/rollup-darwin-arm64": "4.19.2", - "@rollup/rollup-darwin-x64": "4.19.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.19.2", - "@rollup/rollup-linux-arm-musleabihf": "4.19.2", - "@rollup/rollup-linux-arm64-gnu": "4.19.2", - "@rollup/rollup-linux-arm64-musl": "4.19.2", - "@rollup/rollup-linux-powerpc64le-gnu": "4.19.2", - "@rollup/rollup-linux-riscv64-gnu": "4.19.2", - "@rollup/rollup-linux-s390x-gnu": "4.19.2", - "@rollup/rollup-linux-x64-gnu": "4.19.2", - "@rollup/rollup-linux-x64-musl": "4.19.2", - "@rollup/rollup-win32-arm64-msvc": "4.19.2", - "@rollup/rollup-win32-ia32-msvc": "4.19.2", - "@rollup/rollup-win32-x64-msvc": "4.19.2", + "@rollup/rollup-android-arm-eabi": "4.20.0", + "@rollup/rollup-android-arm64": "4.20.0", + "@rollup/rollup-darwin-arm64": "4.20.0", + "@rollup/rollup-darwin-x64": "4.20.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.20.0", + "@rollup/rollup-linux-arm-musleabihf": "4.20.0", + "@rollup/rollup-linux-arm64-gnu": "4.20.0", + "@rollup/rollup-linux-arm64-musl": "4.20.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.20.0", + "@rollup/rollup-linux-riscv64-gnu": "4.20.0", + "@rollup/rollup-linux-s390x-gnu": "4.20.0", + "@rollup/rollup-linux-x64-gnu": "4.20.0", + "@rollup/rollup-linux-x64-musl": "4.20.0", + "@rollup/rollup-win32-arm64-msvc": "4.20.0", + "@rollup/rollup-win32-ia32-msvc": "4.20.0", + "@rollup/rollup-win32-x64-msvc": "4.20.0", "fsevents": "~2.3.2" } }, @@ -1895,13 +1894,13 @@ "dev": true }, "node_modules/vite": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.5.tgz", - "integrity": "sha512-MdjglKR6AQXQb9JGiS7Rc2wC6uMjcm7Go/NHNO63EwiJXfuk9PgqiP/n5IDJCziMkfw9n4Ubp7lttNwz+8ZVKA==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.1.tgz", + "integrity": "sha512-1oE6yuNXssjrZdblI9AfBbHCC41nnyoVoEZxQnID6yvQZAFBzxxkqoFLtHUMkYunL8hwOLEjgTuxpkRxvba3kA==", "dev": true, "dependencies": { "esbuild": "^0.21.3", - "postcss": "^8.4.39", + "postcss": "^8.4.41", "rollup": "^4.13.0" }, "bin": { @@ -1921,6 +1920,7 @@ "less": "*", "lightningcss": "^1.21.0", "sass": "*", + "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" @@ -1938,6 +1938,9 @@ "sass": { "optional": true }, + "sass-embedded": { + "optional": true + }, "stylus": { "optional": true }, diff --git a/app/frontend/package.json b/app/package.json similarity index 93% rename from app/frontend/package.json rename to app/package.json index 276ab72..3a113cd 100644 --- a/app/frontend/package.json +++ b/app/package.json @@ -1,5 +1,4 @@ { - "name": "prisma-app", "scripts": { "start": "vite", "dev": "vite", diff --git a/app/backend/app.jl b/app/src/app.jl similarity index 59% rename from app/backend/app.jl rename to app/src/app.jl index 5c629ec..fdf720b 100644 --- a/app/backend/app.jl +++ b/app/src/app.jl @@ -1,29 +1,60 @@ -using CSV, DataFrames, HTMLTables, HTTP, JSONTables, Oxygen, PRISMA - -const ALLOWED_ORIGINS::Vector{Pair{String,String}} = [ - "Access-Control-Allow-Origin" => "*" -] - -const CORS_HEADERS::Vector{Pair{String,String}} = [ - ALLOWED_ORIGINS..., - "Access-Control-Allow-Methods" => "*", - "Access-Control-Allow-Headers" => "*" -] - -function corshandler(handle::Function)::Function - return function (request::HTTP.Request) - if HTTP.method(request) == "OPTIONS" - return HTTP.Response(200, CORS_HEADERS) - else - response::HTTP.Response = handle(request) - Base.append!(response.headers, ALLOWED_ORIGINS) - - return response - end +using CSV +using DataFrames +using HTMLTables +using HTTP +using JSONTables +using JSON3 +using NodeJS +using Oxygen +using PRISMA + +const FRONTEND_BUILD::String = joinpath(dirname(@__DIR__), "dist") + +function build_frontend()::Nothing + @info "Building frontend..." + + if isdir(FRONTEND_BUILD) + @info "Removing existing build directory..." + rm(FRONTEND_BUILD, force=true, recursive=true) + end + + if dirname(pwd()) != "app" + @info "Switching to app directory..." + cd("app") + end + + run(`$(NodeJS.npm_cmd()) install`) + run(`$(NodeJS.npm_cmd()) run build`) + + @info "Finished building frontend" + + return nothing +end + +function runapp(; kwargs...)::Nothing + build_frontend() + Oxygen.serve(; kwargs...) + + return nothing +end + +Oxygen.get("*") do + try + return Oxygen.html( + status=200, + Base.read(joinpath(FRONTEND_BUILD, "index.html"), String) + ) + catch error + return Oxygen.json( + status=500, + Dict{String,String}( + "error" => "error loading frontend: $error" + ) + ) end end -Oxygen.post("/checklist/generate") do req::HTTP.Request +Oxygen.post("api/checklist/generate") do req::HTTP.Request try paper::PRISMA.Checklist = PRISMA.checklist(req.body) @@ -33,26 +64,47 @@ Oxygen.post("/checklist/generate") do req::HTTP.Request clist, classes="checklist", css=false, editable=true, footer=false ) - return Oxygen.json(status=200, Dict{String,String}("title" => clist_title, "checklist" => clist_table)) + return Oxygen.json( + status=200, + Dict{String,String}( + "title" => clist_title, + "checklist" => clist_table + ) + ) catch error - return Oxygen.json(status=500, Dict{String,String}("error" => "error generating checklist: $error")) + return Oxygen.json( + status=500, + Dict{String,String}( + "error" => "error generating checklist: $error" + ) + ) end end -Oxygen.post("/checklist/export") do req::HTTP.Request +Oxygen.post("api/checklist/export") do req::HTTP.Request try checklists::JSON3.Object = Oxygen.json(req) csv_files::Dict{String,String} = Dict{String,String}() for checklist in checklists["checklists"] io::IO = IOBuffer() - CSV.write(io, HTMLTables.read(checklist["checklist"], DataFrame)) + df::DataFrame = HTMLTables.read(checklist["checklist"], DataFrame) + CSV.write(io, df) csv_files["$(checklist["title"]).csv"] = String(take!(io)) + close(io) end - return Oxygen.json(status=200, csv_files) + return Oxygen.json( + status=200, + csv_files + ) catch error - return Oxygen.json(status=500, Dict{String,String}("error" => "error exporting checklists: $error")) + return Oxygen.json( + status=500, + Dict{String,String}( + "error" => "error exporting checklists: $error" + ) + ) end end @@ -68,9 +120,9 @@ function bytes(fd::PRISMA.FlowDiagram, format::AbstractString)::Vector{UInt8} end end -Oxygen.post("/flow_diagram/generate") do req::HTTP.Request +Oxygen.post("api/flow_diagram/generate") do req::HTTP.Request try - flow_diagram_arguments = Oxygen.json(req) + flow_diagram_arguments::JSON3.Object = Oxygen.json(req) flow_diagram_dot::PRISMA.FlowDiagram = PRISMA.flow_diagram( DataFrame(JSONTables.jsontable(flow_diagram_arguments["data"])), @@ -99,17 +151,28 @@ Oxygen.post("/flow_diagram/generate") do req::HTTP.Request arrow_width = flow_diagram_arguments["arrow_width"] ) - flow_diagram_svg::Vector{UInt8} = bytes(flow_diagram_dot, "svg") - - return Oxygen.json(status=200, Dict{String,Vector{UInt8}}("flow_diagram" => flow_diagram_svg)) + return Oxygen.json( + status=200, + Dict{String,Vector{UInt8}}( + "flow_diagram" => bytes( + flow_diagram_dot, + "svg" + ) + ) + ) catch error - return Oxygen.json(status=500, Dict{String,String}("error" => "error generating flow diagram: $error")) + return Oxygen.json( + status=500, + Dict{String,String}( + "error" => "error generating flow diagram: $error" + ) + ) end end -Oxygen.post("/flow_diagram/export") do req::HTTP.Request +Oxygen.post("api/flow_diagram/export") do req::HTTP.Request try - flow_diagram_arguments = Oxygen.json(req) + flow_diagram_arguments::JSON3.Object = Oxygen.json(req) flow_diagram_dot::PRISMA.FlowDiagram = PRISMA.flow_diagram( DataFrame(JSONTables.jsontable(flow_diagram_arguments["data"])), @@ -138,12 +201,23 @@ Oxygen.post("/flow_diagram/export") do req::HTTP.Request arrow_width = flow_diagram_arguments["arrow_width"] ) - flow_diagram_bytes::Vector{UInt8} = bytes(flow_diagram_dot, flow_diagram_arguments["format"]) - - return Oxygen.json(status=200, Dict{String,Vector{UInt8}}("flow_diagram" => flow_diagram_bytes)) + return Oxygen.json( + status=200, + Dict{String,Vector{UInt8}}( + "flow_diagram" => bytes( + flow_diagram_dot, + flow_diagram_arguments["format"] + ) + ) + ) catch error - return Oxygen.json(status=500, Dict{String,String}("error" => "error generating flow diagram: $error")) + return Oxygen.json( + status=500, + Dict{String,String}( + "error" => "error generating flow diagram: $error" + ) + ) end end -Oxygen.serve(host="0.0.0.0", port=5050, middleware=[corshandler]) +runapp(host="0.0.0.0", port=5050, async=true) \ No newline at end of file diff --git a/app/frontend/tsconfig.json b/app/tsconfig.json similarity index 100% rename from app/frontend/tsconfig.json rename to app/tsconfig.json diff --git a/app/frontend/vite.config.ts b/app/vite.config.ts similarity index 85% rename from app/frontend/vite.config.ts rename to app/vite.config.ts index 9570e5c..51d87c5 100644 --- a/app/frontend/vite.config.ts +++ b/app/vite.config.ts @@ -4,4 +4,7 @@ import { defineConfig } from "vite"; export default defineConfig({ plugins: [solidPlugin(), solidSvg()], + build: { + assetsDir: "", + }, }); diff --git a/docs/make.jl b/docs/make.jl index 916f312..bed8c9f 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -13,7 +13,7 @@ makedocs( modules=[PRISMA], format=HTML(assets=["src/assets/bib.css", "src/assets/favicon.ico"]), sitename="PRISMA.jl", - authors="PRISMA.jl Contributors", + authors="Ceco Elijah Maples and contributors", pages=pages, plugins=[CitationBibliography(joinpath(dirname(@__FILE__), "src/assets/references.bib"), style=:authoryear)] ) diff --git a/docs/src/assets/figure.svg b/docs/src/assets/figure.svg deleted file mode 100644 index adaed53..0000000 --- a/docs/src/assets/figure.svg +++ /dev/null @@ -1,4685 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/src/assets/logo.svg b/logo.svg similarity index 100% rename from docs/src/assets/logo.svg rename to logo.svg diff --git a/test/Project.toml b/test/Project.toml new file mode 100644 index 0000000..5ff7237 --- /dev/null +++ b/test/Project.toml @@ -0,0 +1,15 @@ +[deps] +CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" +DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +HTMLTables = "b1afcece-b80e-4563-b90e-36b4cc56d3fa" +PRISMA = "7b67a8d2-c4f5-4933-b91c-0fc427024db5" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +XLSX = "fdbf4ff8-1666-58a4-91e7-1b58723a45e0" + +[compat] +CSV = "0.10" +DataFrames = "1" +HTMLTables = "0.4" +PRISMA = "0.0.5" +Test = "1" +XLSX = "0.10" \ No newline at end of file