Merge pull request 'feature/move-to-svelte' (#1) from feature/move-to-svelte into main

Reviewed-on: lukas/server-admin-panel#1
This commit was merged in pull request #1.
This commit is contained in:
2026-02-14 22:48:50 +01:00
434 changed files with 4564 additions and 52124 deletions

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
*.pdf filter=lfs diff=lfs merge=lfs -text

4
.gitignore vendored
View File

@@ -9,3 +9,7 @@ pkg
!.idea/runConfigurations/ !.idea/runConfigurations/
!.idea/inspectionProfiles/ !.idea/inspectionProfiles/
*.iml *.iml
.cache/
compile_commands.json
*.db

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "modules/cpp-libraries"]
path = modules/cpp-libraries
url = ssh://git@192.168.1.101:2222/lukas/cpp-libraries.git

6
.vscode/launch.json vendored
View File

@@ -2,10 +2,10 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "Debug Server Admin Panel", "name": "Debug Shadowrun Server",
"type": "cppdbg", "type": "lldb",
"request": "launch", "request": "launch",
"program": "${workspaceFolder}/build/lf-server-admin-panel", "program": "${workspaceFolder}/build/shadowrun-server",
"args": [], "args": [],
"stopAtEntry": false, "stopAtEntry": false,
"cwd": "${workspaceFolder}", "cwd": "${workspaceFolder}",

View File

@@ -99,5 +99,6 @@
"typeinfo": "cpp", "typeinfo": "cpp",
"valarray": "cpp", "valarray": "cpp",
"variant": "cpp" "variant": "cpp"
} },
"C_Cpp.errorSquiggles": "disabled"
} }

17
.vscode/tasks.json vendored
View File

@@ -9,6 +9,23 @@
"problemMatcher": [ "problemMatcher": [
"$gcc" "$gcc"
] ]
},
{
"label": "build release",
"type": "shell",
"command": "cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build",
"group": "build",
"problemMatcher": [
"$gcc"
]
},
{
"label": "build Frontend",
"type": "shell",
"command": "npm run build",
"options": {
"cwd": "frontend"
}
} }
] ]
} }

View File

@@ -3,7 +3,7 @@ project(CrowHTMX)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(TARGET_NAME lf-server-admin-panel ) set(TARGET_NAME shadowrun-server )
set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -20,57 +20,41 @@ if(NOT CMAKE_BUILD_TYPE IN_LIST SUPPORTED_BUILD_TYPES)
endif() endif()
# Copy 'static' and 'templates' directories to build directory # Copy 'static' and 'templates' directories to build directory
file(GLOB_RECURSE STATIC_FILES "${CMAKE_SOURCE_DIR}/static/*") file(GLOB_RECURSE ASSETS_FILES "${CMAKE_SOURCE_DIR}/assets/*")
file(GLOB_RECURSE TEMPLATE_FILES "${CMAKE_SOURCE_DIR}/templates/*") file(GLOB_RECURSE FRONTEND_FILES "${CMAKE_SOURCE_DIR}/frontend/build/*")
foreach(file IN LISTS STATIC_FILES) foreach(file IN LISTS STATIC_FILES)
file(RELATIVE_PATH rel_path "${CMAKE_SOURCE_DIR}" "${file}") file(RELATIVE_PATH rel_path "${CMAKE_SOURCE_DIR}" "${file}")
configure_file("${file}" "${CMAKE_BINARY_DIR}/${rel_path}" COPYONLY) configure_file("${file}" "${CMAKE_BINARY_DIR}/${rel_path}" COPYONLY)
endforeach() endforeach()
foreach(file IN LISTS TEMPLATE_FILES) foreach(file IN LISTS FRONTEND_FILES)
file(RELATIVE_PATH rel_path "${CMAKE_SOURCE_DIR}" "${file}") file(RELATIVE_PATH rel_path "${CMAKE_SOURCE_DIR}" "${file}")
configure_file("${file}" "${CMAKE_BINARY_DIR}/${rel_path}" COPYONLY) configure_file("${file}" "${CMAKE_BINARY_DIR}/${rel_path}" COPYONLY)
endforeach() endforeach()
add_compile_options(-Wno-deprecated-declarations) include_directories(
add_compile_options(-Wno-deprecated-literal-operator) modules/cpp-libraries/include/
src
# Use Crow from system include (installed via yay -S crow + asio) src/shadowrun
include_directories(/usr/include src src/htmx src/shadowrun src/database src/login) src/database
src/login
)
add_executable(${TARGET_NAME} add_executable(${TARGET_NAME}
modules/cpp-libraries/src/sqlite3.c
modules/cpp-libraries/src/monocypher.c
src/main.cpp src/main.cpp
src/utils.hpp src/utils.hpp
src/utils.cpp src/utils.cpp
src/htmx/HtmxTable.cpp
src/htmx/HtmxTable.h
src/systemd.cpp
src/systemd.h
src/json.hpp
src/htmx/HtmxTableRow.cpp
src/htmx/HtmxTableRow.h
src/htmx/HtmxObject.cpp
src/htmx/HtmxObject.h
src/htmx_helper.cpp
src/htmx_helper.h
src/json_settings.cpp src/json_settings.cpp
src/json_settings.h src/json_settings.h
src/json.hpp
src/database/database.cpp src/database/database.cpp
src/database/database.hpp src/database/database.hpp
src/database/sqlite_orm.h
# Shadowrun # Shadowrun
src/shadowrun/HtmxShItemList.cpp
src/shadowrun/HtmxShItemList.hpp
src/shadowrun/HtmxShAttributeList.cpp
src/shadowrun/HtmxShAttributeList.hpp
src/shadowrun/HtmxShCondition.cpp
src/shadowrun/HtmxShCondition.hpp
src/shadowrun/ShadowrunCharacterForm.hpp
src/shadowrun/ShadowrunCharacterForm.cpp
src/shadowrun/ShadowrunApi.cpp src/shadowrun/ShadowrunApi.cpp
src/shadowrun/ShadowrunApi.hpp src/shadowrun/ShadowrunApi.hpp
src/shadowrun/ShadowrunDb.cpp src/shadowrun/ShadowrunDb.cpp
@@ -79,12 +63,36 @@ add_executable(${TARGET_NAME}
# login # login
src/login/login.cpp src/login/login.cpp
src/login/login.hpp src/login/login.hpp
src/login/loginDb.cpp
src/login/Session.cpp
src/login/SessionHandler.cpp
) )
target_compile_definitions(${TARGET_NAME} PRIVATE APPLICATION_NAME="${TARGET_NAME}") # warnings to ignore
target_compile_options(${TARGET_NAME} PRIVATE
$<$<COMPILE_LANGUAGE:CXX>:
-Wno-deprecated-literal-operator
-Wno-deprecated-declarations
>
)
target_link_libraries(${TARGET_NAME} pthread sqlite3 sodium) # relase compiler options
target_compile_options(${TARGET_NAME} PRIVATE
$<$<CONFIG:Release>:-O3>
$<$<CONFIG:Release>:-flto=auto>
)
# relase linker options
target_link_options(${TARGET_NAME} PRIVATE
$<$<CONFIG:Release>:-flto=auto>
)
target_compile_definitions(${TARGET_NAME} PRIVATE
APPLICATION_NAME="${TARGET_NAME}"
SQLITE_THREADSAFE=1
)
target_link_libraries(${TARGET_NAME} pthread)
# Optional: Print build type at configuration time # Optional: Print build type at configuration time
message(STATUS "Configuring build type: ${CMAKE_BUILD_TYPE}") message(STATUS "Configuring build type: ${CMAKE_BUILD_TYPE}")

View File

@@ -15,6 +15,19 @@ run : F5 or Run → Start Debugging
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
``` ```
## Svelte
Inside the fronend directory
### Install
```
npm install -D @sveltejs/adapter-static
```
### Build
```
npm run build
```
## Make Package ## Make Package
1. tar the source files to make it cleaner 1. tar the source files to make it cleaner
@@ -27,3 +40,10 @@ tar czf pkg/lf-server-admin-panel-0.1.1.tar.gz src/ static/ templates/ lf-server
``` ```
makepkg -f makepkg -f
``` ```
## Database
### Attributes
| Character Id | Attribute | Value |
###

3
assets/settings.json Normal file
View File

@@ -0,0 +1,3 @@
{
"httpPort" : 3010
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More