feature/move-to-svelte #1

Merged
lukas merged 19 commits from feature/move-to-svelte into main 2026-02-14 22:48:51 +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/inspectionProfiles/
*.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",
"configurations": [
{
"name": "Debug Server Admin Panel",
"type": "cppdbg",
"name": "Debug Shadowrun Server",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/build/lf-server-admin-panel",
"program": "${workspaceFolder}/build/shadowrun-server",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",

View File

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

17
.vscode/tasks.json vendored
View File

@@ -9,6 +9,23 @@
"problemMatcher": [
"$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(TARGET_NAME lf-server-admin-panel )
set(TARGET_NAME shadowrun-server )
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -20,57 +20,41 @@ if(NOT CMAKE_BUILD_TYPE IN_LIST SUPPORTED_BUILD_TYPES)
endif()
# Copy 'static' and 'templates' directories to build directory
file(GLOB_RECURSE STATIC_FILES "${CMAKE_SOURCE_DIR}/static/*")
file(GLOB_RECURSE TEMPLATE_FILES "${CMAKE_SOURCE_DIR}/templates/*")
file(GLOB_RECURSE ASSETS_FILES "${CMAKE_SOURCE_DIR}/assets/*")
file(GLOB_RECURSE FRONTEND_FILES "${CMAKE_SOURCE_DIR}/frontend/build/*")
foreach(file IN LISTS STATIC_FILES)
file(RELATIVE_PATH rel_path "${CMAKE_SOURCE_DIR}" "${file}")
configure_file("${file}" "${CMAKE_BINARY_DIR}/${rel_path}" COPYONLY)
endforeach()
foreach(file IN LISTS TEMPLATE_FILES)
foreach(file IN LISTS FRONTEND_FILES)
file(RELATIVE_PATH rel_path "${CMAKE_SOURCE_DIR}" "${file}")
configure_file("${file}" "${CMAKE_BINARY_DIR}/${rel_path}" COPYONLY)
endforeach()
add_compile_options(-Wno-deprecated-declarations)
add_compile_options(-Wno-deprecated-literal-operator)
# Use Crow from system include (installed via yay -S crow + asio)
include_directories(/usr/include src src/htmx src/shadowrun src/database src/login)
include_directories(
modules/cpp-libraries/include/
src
src/shadowrun
src/database
src/login
)
add_executable(${TARGET_NAME}
modules/cpp-libraries/src/sqlite3.c
modules/cpp-libraries/src/monocypher.c
src/main.cpp
src/utils.hpp
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.h
src/json.hpp
src/database/database.cpp
src/database/database.hpp
src/database/sqlite_orm.h
# 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.hpp
src/shadowrun/ShadowrunDb.cpp
@@ -79,12 +63,36 @@ add_executable(${TARGET_NAME}
# login
src/login/login.cpp
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
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
```
## Svelte
Inside the fronend directory
### Install
```
npm install -D @sveltejs/adapter-static
```
### Build
```
npm run build
```
## Make Package
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
```
## 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