Separate server and client code
authorAdam Dullage <redacted>
Tue, 12 Dec 2023 18:28:20 +0000 (18:28 +0000)
committerAdam Dullage <redacted>
Tue, 12 Dec 2023 18:28:20 +0000 (18:28 +0000)
51 files changed:
.dockerignore
.gitignore
Dockerfile
README.md
client/api.js [moved from flatnotes/src/api.js with 100% similarity]
client/assets/android-chrome-192x192.png [moved from flatnotes/src/assets/android-chrome-192x192.png with 100% similarity]
client/assets/android-chrome-512x512.png [moved from flatnotes/src/assets/android-chrome-512x512.png with 100% similarity]
client/assets/apple-touch-icon.png [moved from flatnotes/src/assets/apple-touch-icon.png with 100% similarity]
client/assets/browserconfig.xml [moved from flatnotes/src/assets/browserconfig.xml with 100% similarity]
client/assets/favicon-16x16.png [moved from flatnotes/src/assets/favicon-16x16.png with 100% similarity]
client/assets/favicon-32x32.png [moved from flatnotes/src/assets/favicon-32x32.png with 100% similarity]
client/assets/favicon.ico [moved from flatnotes/src/assets/favicon.ico with 100% similarity]
client/assets/mstile-144x144.png [moved from flatnotes/src/assets/mstile-144x144.png with 100% similarity]
client/assets/mstile-150x150.png [moved from flatnotes/src/assets/mstile-150x150.png with 100% similarity]
client/assets/mstile-310x150.png [moved from flatnotes/src/assets/mstile-310x150.png with 100% similarity]
client/assets/mstile-310x310.png [moved from flatnotes/src/assets/mstile-310x310.png with 100% similarity]
client/assets/mstile-70x70.png [moved from flatnotes/src/assets/mstile-70x70.png with 100% similarity]
client/assets/safari-pinned-tab.svg [moved from flatnotes/src/assets/safari-pinned-tab.svg with 100% similarity]
client/autolinkParsers.js [moved from flatnotes/src/autolinkParsers.js with 100% similarity]
client/classes.js [moved from flatnotes/src/classes.js with 100% similarity]
client/colours.scss [moved from flatnotes/src/colours.scss with 100% similarity]
client/components/App.js [moved from flatnotes/src/components/App.js with 100% similarity]
client/components/App.vue [moved from flatnotes/src/components/App.vue with 100% similarity]
client/components/LoadingIndicator.vue [moved from flatnotes/src/components/LoadingIndicator.vue with 100% similarity]
client/components/Login.vue [moved from flatnotes/src/components/Login.vue with 100% similarity]
client/components/Logo.vue [moved from flatnotes/src/components/Logo.vue with 100% similarity]
client/components/NavBar.vue [moved from flatnotes/src/components/NavBar.vue with 100% similarity]
client/components/NoteViewerEditor.vue [moved from flatnotes/src/components/NoteViewerEditor.vue with 100% similarity]
client/components/RecentlyModified.vue [moved from flatnotes/src/components/RecentlyModified.vue with 100% similarity]
client/components/SearchInput.vue [moved from flatnotes/src/components/SearchInput.vue with 100% similarity]
client/components/SearchResults.vue [moved from flatnotes/src/components/SearchResults.vue with 100% similarity]
client/constants.js [moved from flatnotes/src/constants.js with 100% similarity]
client/eventBus.js [moved from flatnotes/src/eventBus.js with 100% similarity]
client/global.scss [moved from flatnotes/src/global.scss with 100% similarity]
client/helpers.js [moved from flatnotes/src/helpers.js with 100% similarity]
client/index.html [moved from flatnotes/src/index.html with 100% similarity]
client/index.js [moved from flatnotes/src/index.js with 100% similarity]
client/site.webmanifest [moved from flatnotes/src/site.webmanifest with 100% similarity]
client/toastui-editor-overrides.scss [moved from flatnotes/src/toastui-editor-overrides.scss with 100% similarity]
client/tokenStorage.js [moved from flatnotes/src/tokenStorage.js with 100% similarity]
entrypoint.sh
package.json
pyproject.toml
server/auth.py [moved from flatnotes/auth.py with 100% similarity]
server/config.py [moved from flatnotes/config.py with 100% similarity]
server/error_responses.py [moved from flatnotes/error_responses.py with 100% similarity]
server/flatnotes.py [moved from flatnotes/flatnotes.py with 100% similarity]
server/helpers.py [moved from flatnotes/helpers.py with 100% similarity]
server/logger.py [moved from flatnotes/logger.py with 100% similarity]
server/main.py [moved from flatnotes/main.py with 98% similarity]
server/models.py [moved from flatnotes/models.py with 100% similarity]

index 0f76a247492b78a8b21b9bc329a09edb439fca88..f0ad064859c2c089466cb4132151f303de40fa29 100644 (file)
@@ -7,6 +7,7 @@
 !Pipfile.lock
 !package.json
 !package-lock.json
-!flatnotes/**
+!client/**
+!server/**
 !entrypoint.sh
 !.htmlnanorc
index fb14dd3a37e3938afd9ee73227ccfcdcd4ed9474..b1e8c8bd1fba6d9bc3f22875455f45c7fee96cb5 100644 (file)
@@ -244,7 +244,6 @@ dist
 .yarn/install-state.gz
 .pnp.*
 
-
 # Custom
 .vscode/
 data/
index 5c1e040adcbdd3d2d8ddf3060aec69580dafbce0..0ef0d20d44a9d2aa08eb2bfbe494a8c684be5dea 100644 (file)
@@ -13,7 +13,7 @@ RUN apt update && apt install -y npm
 COPY package.json package-lock.json .htmlnanorc ./
 RUN npm ci
 
-COPY flatnotes/src ./flatnotes/src
+COPY client ./client
 RUN npm run build
 
 # Runtime Container
@@ -40,8 +40,8 @@ WORKDIR ${APP_PATH}
 COPY LICENSE Pipfile Pipfile.lock ./
 RUN pipenv install --deploy --ignore-pipfile --system
 
-COPY flatnotes ./flatnotes
-COPY --from=build ${BUILD_DIR}/flatnotes/dist ./flatnotes/dist
+COPY server ./server
+COPY --from=build ${BUILD_DIR}/client/dist ./client/dist
 
 VOLUME /data
 EXPOSE 8080/tcp
index 506f1f64f8528b42c9b8bf8b4fe5e347c0a91d1c..366535bd2477eef4982b5f3c699e265c50ba0419 100644 (file)
--- a/README.md
+++ b/README.md
@@ -97,7 +97,7 @@ services:
     restart: unless-stopped
 ```
 
-See the [Environment Variables](https://github.com/Dullage/flatnotes/wiki/Environment-Variables) article in the wiki for a full list of configuration options.
+See the [Environment Variables](https://github.com/dullage/flatnotes/wiki/Environment-Variables) article in the wiki for a full list of configuration options.
 
 
 ## Roadmap
similarity index 100%
rename from flatnotes/src/api.js
rename to client/api.js
similarity index 100%
rename from flatnotes/src/classes.js
rename to client/classes.js
similarity index 100%
rename from flatnotes/src/eventBus.js
rename to client/eventBus.js
similarity index 100%
rename from flatnotes/src/global.scss
rename to client/global.scss
similarity index 100%
rename from flatnotes/src/helpers.js
rename to client/helpers.js
similarity index 100%
rename from flatnotes/src/index.html
rename to client/index.html
similarity index 100%
rename from flatnotes/src/index.js
rename to client/index.js
index b317c95b5b7a1c6b836a9b62e9822d947df48f7c..0fe7a8e189dc9cbe7e6d71ee2ee395f8aa5ecbf4 100644 (file)
@@ -10,7 +10,7 @@ echo "  - The note directory inside the Docker container has moved from /app/dat
 flatnotes_command="python -m \
                   uvicorn \
                   main:app \
-                  --app-dir flatnotes \
+                  --app-dir server \
                   --host 0.0.0.0 \
                   --port 8080 \
                   --proxy-headers \
index e954a576a65e9ffef98e6834e389bc05377bc062..53049447be5d0b0de02bc5acb52eba007a363ef0 100644 (file)
@@ -2,11 +2,11 @@
   "name": "flatnotes",
   "version": "3.6.1",
   "description": "A database-less note taking web app that utilises a flat folder of markdown files for storage.",
-  "main": "flatnotes/src/index.html",
+  "main": "client/index.html",
   "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1",
-    "build": "parcel build flatnotes/src/index.html --out-dir flatnotes/dist",
-    "watch": "parcel flatnotes/src/index.html --out-dir flatnotes/dist"
+    "build": "parcel build client/index.html --out-dir client/dist",
+    "watch": "parcel client/index.html --out-dir client/dist"
   },
   "author": "Adam Dullage",
   "license": "MIT",
index 3988ba424875a3e225666e296f5ef59d2c0698a7..0600eef59cd36793fed37678ef91c767b2560cfc 100644 (file)
@@ -1,4 +1,4 @@
 [tool.isort]
 profile = "black"
 line_length = 79
-src_paths = ["flatnotes"]
+src_paths = ["server"]
similarity index 100%
rename from flatnotes/auth.py
rename to server/auth.py
similarity index 100%
rename from flatnotes/config.py
rename to server/config.py
similarity index 100%
rename from flatnotes/flatnotes.py
rename to server/flatnotes.py
similarity index 100%
rename from flatnotes/helpers.py
rename to server/helpers.py
similarity index 100%
rename from flatnotes/logger.py
rename to server/logger.py
similarity index 98%
rename from flatnotes/main.py
rename to server/main.py
index 8c569f0cd9913814496466857f5ada5ff3235b11..7e93c3eded323b29dfc33fc344aa232a603e17a7 100644 (file)
@@ -100,7 +100,7 @@ if config.auth_type not in [AuthType.NONE, AuthType.READ_ONLY]:
 @app.get("/new", include_in_schema=False)
 @app.get("/note/{title}", include_in_schema=False)
 def root(title: str = ""):
-    with open("flatnotes/dist/index.html", "r", encoding="utf-8") as f:
+    with open("client/dist/index.html", "r", encoding="utf-8") as f:
         html = f.read()
     return HTMLResponse(content=html)
 
@@ -257,4 +257,4 @@ def get_attachment(filename: str):
     return FileResponse(filepath)
 
 
-app.mount("/", StaticFiles(directory="flatnotes/dist"), name="dist")
+app.mount("/", StaticFiles(directory="client/dist"), name="dist")
similarity index 100%
rename from flatnotes/models.py
rename to server/models.py
git clone https://git.99rst.org/PROJECT