Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
225 commits
Select commit Hold shift + click to select a range
c0eb88e
Dumping all changes if @andreutu is interested
Maximus7474 Mar 23, 2026
03c2634
will see what this does
Maximus7474 Mar 23, 2026
3c91440
tweak(package): build script
Maximus7474 Mar 24, 2026
6bd0f1f
doc(db/migrate): added todo for migration handling
Maximus7474 Mar 24, 2026
dd4df69
refactor(db/migrations): have migrations stored within ts files not s…
Maximus7474 Mar 24, 2026
15f442e
rm: build.ts
Maximus7474 Mar 24, 2026
2d635fd
fix(package/scripts): build script
Maximus7474 Mar 24, 2026
ad24f75
Initial Commit - Fastify rebuild
Maximus7474 Mar 24, 2026
cca34c1
feat: biome js
Maximus7474 Mar 24, 2026
d70ad1d
chore: remove eslint
Maximus7474 Mar 24, 2026
8a6d4ab
feat: root editor config
Maximus7474 Mar 24, 2026
0dcc5ff
chore: biome cleanup
Maximus7474 Mar 24, 2026
a9c3f34
feat(packages): utils package
Maximus7474 Mar 24, 2026
d89bbc2
chore: rename packages/utils to packages/shared
Maximus7474 Mar 24, 2026
5cad42e
doc(README): high level project structure
Maximus7474 Mar 24, 2026
c09dc61
feat: added types/bun to root setup
Maximus7474 Mar 24, 2026
511259e
feat: build process
Maximus7474 Mar 24, 2026
de651d0
fix(apps/core): path for serving static files
Maximus7474 Mar 24, 2026
a5c3c2c
tweak(gitignore): ignore data directory
Maximus7474 Mar 24, 2026
48867a6
chore(core): apply migrations at file root
Maximus7474 Mar 24, 2026
ff5faaa
feat(core): implement version check
Maximus7474 Mar 24, 2026
1be050a
fix(packages/shared): package.json layout
Maximus7474 Mar 25, 2026
32c58d0
feat(shared/types): core config types
Maximus7474 Mar 25, 2026
c222f82
feat(apps/core): include @fxmanager/shared to devdependencies
Maximus7474 Mar 25, 2026
734a8ce
feat(core/common): config wrapper
Maximus7474 Mar 25, 2026
5f05f32
tweak(gitignore): refine ignoring of database files
Maximus7474 Mar 26, 2026
89ad0c7
refactor(packages/shared): split exports to sub modules
Maximus7474 Mar 26, 2026
0d0d1b0
refactor(shared): constants submodule
Maximus7474 Mar 26, 2026
446a9b6
refactor(shared): process manager types
Maximus7474 Mar 26, 2026
ec990b3
fix(core/tsconfig): extend base tsconfig
Maximus7474 Mar 26, 2026
5f1b4b8
chore(core/common): update type import from shared
Maximus7474 Mar 26, 2026
5cec2b9
feat(core/modules): initial process manager with base methods
Maximus7474 Mar 26, 2026
4712f30
chore(shared/constants): added player join/drop event names
Maximus7474 Mar 26, 2026
a11e88a
chore(shared/package): added @fxmanager/database to dev dependencies
Maximus7474 Mar 26, 2026
9b3a0b1
feat(shared/types): player types
Maximus7474 Mar 26, 2026
b4d75e4
feat(shared/types): api response types
Maximus7474 Mar 26, 2026
de4736f
feat(shared/types): game types
Maximus7474 Mar 26, 2026
640122c
chore(shared/types): link all files
Maximus7474 Mar 26, 2026
3af260b
feat(core/modules): added game manager
Maximus7474 Mar 26, 2026
e8d4d03
feat(core/modules): implemented output piping
Maximus7474 Mar 26, 2026
432bcf5
feat(core/modules): onExit method placeholder for process manager
Maximus7474 Mar 26, 2026
0413da8
feat(core): routing structure / logic
Maximus7474 Mar 26, 2026
b14c047
doc(core): added information on webserver endpoint groups
Maximus7474 Mar 29, 2026
86b7f1b
fix(shared/constants): odd logic
Maximus7474 Mar 29, 2026
ab2bc1a
feat(shared): security / permission types & data
Maximus7474 Mar 29, 2026
487b72e
fix(database/repos): incorrect imports for shared types
Maximus7474 Mar 29, 2026
21a2466
feat(apps): fxserver resource
Maximus7474 Mar 29, 2026
df8be86
doc(README): update project architecture
Maximus7474 Mar 29, 2026
3bc2980
tweak: README.md
Maximus7474 Mar 29, 2026
fc0c406
feat(ui/components): install various input components
andreutu Mar 29, 2026
38001e7
fix(packages/types): missing moderation types inferred from db schema
Maximus7474 Mar 30, 2026
f93df51
fix(packages/database): missing devdepency for types
Maximus7474 Mar 30, 2026
85d333a
fix(packages): circular dependency
Maximus7474 Mar 30, 2026
34aaac2
fix(resource/server): ApiError import path
Maximus7474 Mar 30, 2026
e5fa6e1
fix(build): build script execution
Maximus7474 Mar 30, 2026
ebe752f
fix(database): configuration of package to export types
Maximus7474 Mar 30, 2026
1943185
tweak(package): include scripts dir for biome formatting
Maximus7474 Mar 30, 2026
c4f0342
chore: big biome cleanup
Maximus7474 Mar 30, 2026
4bd5428
fix(database/repos): change type import for Ban & PlayerProfile for p…
Maximus7474 Mar 30, 2026
11ad188
feat(core/utils): added isFxManagerSetup helper
Maximus7474 Mar 30, 2026
c5919e4
feat(core): setting of setup flag to display setup process
Maximus7474 Mar 30, 2026
07a196b
feat(apps/webpanel): separate "App" for setup process
Maximus7474 Mar 30, 2026
0d3503e
chore(shared/types): rename UserPermissions to UserPermissionsType to…
Maximus7474 Mar 30, 2026
624b0a2
feat(shared): permission manager & export of utils group
Maximus7474 Mar 30, 2026
e72f167
feat(ui/hooks): use mobile
Maximus7474 Mar 30, 2026
a8c0216
feat(ui/components): various shadcn components for sidebar
Maximus7474 Mar 30, 2026
a28bc95
chore(webpanel): reimplement navigation & app layout
Maximus7474 Mar 30, 2026
a4fe746
chore(ui/styles): updated css styles to chosen theme
Maximus7474 Mar 30, 2026
57525a1
feat(apps/core): added fastify cookie & sinclair typebox for typing &…
Maximus7474 Mar 31, 2026
544624b
chore(core/config): expand core config to include cookieSecret
Maximus7474 Mar 31, 2026
7034d02
feat(core): register cookie secret to fastify instance
Maximus7474 Mar 31, 2026
ceaecce
refactor(webpanel/authcontext): removed settings from context provider
Maximus7474 Mar 31, 2026
0dc251d
feat(core/routes): basic authentication routes
Maximus7474 Mar 31, 2026
71a62c1
tweak(webpanel/utils): copy to clipboard method
Maximus7474 Mar 31, 2026
3d3977b
refactor(webpanel/query): use vite proxy
Maximus7474 Mar 31, 2026
534bd3d
feat(webpanel/SetupApp): registration form for setup process
Maximus7474 Mar 31, 2026
40627b7
feat(ui/components): shadcn alert
Maximus7474 Mar 31, 2026
653d244
chore(ui): biome cleanup
Maximus7474 Mar 31, 2026
b9b7cac
chore(webpanel): biome cleanup
Maximus7474 Mar 31, 2026
9098e00
chore(shared): biome cleanup
Maximus7474 Mar 31, 2026
1af068b
tweak(webpanel): updated index.html page name
Maximus7474 Mar 31, 2026
03bcae0
tweak(core): have the cookie name as an exported const
Maximus7474 Mar 31, 2026
ec3590f
chore(core/types): extend FastifyRequest to include admin data
Maximus7474 Mar 31, 2026
e6ef390
feat(core/middleware): auth middleware
Maximus7474 Mar 31, 2026
f2bb04c
chore(core/routes): added auth middleware to api/server routes
Maximus7474 Mar 31, 2026
f306580
refactor(core): passing managers to various routes
Maximus7474 Mar 31, 2026
55c4523
refactor(core/modules): have all start/stop methods of process manage…
Maximus7474 Mar 31, 2026
6f38f98
fix(core): set the shared librairie as a dependency not a dev one
Maximus7474 Mar 31, 2026
c4e08e8
feat(core/routes): added start/stop/restart methods to api routes
Maximus7474 Mar 31, 2026
d1b6655
fix(core/routes): api auth routes not setting session cookie correctly
Maximus7474 Apr 13, 2026
0722986
chore(core): added @fastify/webocket
Maximus7474 Apr 13, 2026
c3d92c7
feat(shared/types): websocket types / interfaces
Maximus7474 Apr 13, 2026
f553ed4
feat(shared/types): console output payload
Maximus7474 Apr 13, 2026
6ed3db4
chore(webpanel): added ansi-to-react package for console display
Maximus7474 Apr 13, 2026
8b2071b
fix(webpanel/vite.config): proxy settings for ws routes
Maximus7474 Apr 13, 2026
80b6cf4
feat(core/modules): ws manager class
Maximus7474 Apr 13, 2026
06b1b86
feat(core/routes): added websocket endpoing to api routes
Maximus7474 Apr 13, 2026
64a6029
feat(webpanel): websocket context & hook
Maximus7474 Apr 13, 2026
42ba0ab
feat(webpanel/hooks): use websocket channel hook
Maximus7474 Apr 13, 2026
09bad33
fix(webpanel/query): fixed fetch request generation with issues relat…
Maximus7474 Apr 13, 2026
d82fb31
feat(core/modules): added wsManager broadcast calls to process manager
Maximus7474 Apr 13, 2026
99d98a1
chore(webpanel): add WSProcvider to component tree
Maximus7474 Apr 13, 2026
78e4636
chore(webpanel/query): cleanup file
Maximus7474 Apr 13, 2026
388ea88
chore(webpanel/sidebar): link websocket to server status display
Maximus7474 Apr 13, 2026
581c5b9
feat(webpanel/pages): basic console page
Maximus7474 Apr 13, 2026
294a0e7
feat(core/process.manager): added sendCommand method
Maximus7474 Apr 15, 2026
2d7e42c
feat(webpanel/components): page header
Maximus7474 Apr 15, 2026
3eeecdf
feat(packages/ui): added scroll area shadcn component
Maximus7474 Apr 15, 2026
266df63
feat(webpanel/pages): proper console page
Maximus7474 Apr 15, 2026
4e4184c
feat(core/ws.manager): added listening to socket messages from clients
Maximus7474 Apr 15, 2026
9fb7979
chore: biome cleanup
Maximus7474 Apr 15, 2026
200a8f9
feat(shared/types): ws client message type
Maximus7474 Apr 15, 2026
362d736
feat(webpanel/context): added emit method to WSContext
Maximus7474 Apr 15, 2026
db18fbf
feat(core/routes): added ws listener for console commands
Maximus7474 Apr 15, 2026
b540896
chore(webpanel/pages): added useage of useWS emit method
Maximus7474 Apr 15, 2026
a28affd
fix(core): manually load environment variables if development environ…
andreutu Apr 15, 2026
978f1ce
fix(webpanel): properly route player to appropiate page based on auth…
andreutu Apr 15, 2026
70bd420
feat(webpanel): add loading spinner
andreutu Apr 15, 2026
58b2883
fix(webpanel): add missing pages present in navbar
andreutu Apr 15, 2026
d359e8e
chore: biome cleanup
Maximus7474 Apr 15, 2026
07b4f01
fix(webpanel/lib): formatUptime offset
Maximus7474 Apr 15, 2026
d0defbc
refactor(webpanel/hooks): websocket core logic
Maximus7474 Apr 15, 2026
a0cad11
feat(webpanel/hooks): envelope modules for sockets
Maximus7474 Apr 15, 2026
1565fb4
fix(webpanel/context): import path for WSContext
Maximus7474 Apr 15, 2026
740ec4c
chore(webpanel/sidebar): updated socket logic
Maximus7474 Apr 15, 2026
9ade2be
chore(webpanel/pages): added logic for new websocket system
Maximus7474 Apr 15, 2026
fb6f390
fix(webpanel/pages): disable visually sending console commands if ser…
Maximus7474 Apr 15, 2026
92ce466
feat(core/modules): added initial data system for ws.manager
Maximus7474 Apr 16, 2026
1580fd5
feat(webpanel/hooks): handle initial data in useWsChannel
Maximus7474 Apr 16, 2026
4e23f2c
feat(webpanel/hooks): handle initial data in console socket
Maximus7474 Apr 16, 2026
dda377e
feat(core/modules): buffer manager
Maximus7474 Apr 16, 2026
4cccfe7
refactor(core/modules): implemented buffer manager to process manager…
Maximus7474 Apr 16, 2026
0c7e98b
feat(core/routes): added initial data handler for console output for …
Maximus7474 Apr 16, 2026
69a7b71
feat(core/routes): added initial data handler for server status for s…
Maximus7474 Apr 16, 2026
241f709
tweak(core): don't print out routemap but make it available in dev at…
Maximus7474 Apr 16, 2026
76fc109
feat(webpanel): favicon
Maximus7474 Apr 16, 2026
1087db2
feat(webpanel/pages): main dashboard view
Maximus7474 Apr 16, 2026
0cfe117
fix(core/modules): added fxManager injected output to buffer manager
Maximus7474 Apr 16, 2026
4cf6d7c
feat(webpanel/hooks): debounce hook
Maximus7474 Apr 16, 2026
78d2476
feat(package/ui): more shadcn components
Maximus7474 Apr 16, 2026
3b4c71e
chore(webpanel/pages): cleaned up dashboard main page with biome
Maximus7474 Apr 16, 2026
8c0e012
feat(webpanel): component and hook for handling player actions
Maximus7474 Apr 16, 2026
b57dcff
fix(webpanel/hooks): made player list use online player type
Maximus7474 Apr 16, 2026
8d9628f
feat(webpanel/pages): main dashboard player list view
Maximus7474 Apr 16, 2026
46d182c
chore: biome cleanup
Maximus7474 Apr 16, 2026
d06541c
tweak(core/types): added authedrequest and altered typing
Maximus7474 Apr 18, 2026
a8a505e
refactor(core/routes): server api routes for extracting admin
Maximus7474 Apr 18, 2026
17e1fe2
refactor(core/modules): link admin user to socket clientId
Maximus7474 Apr 18, 2026
79d3f5b
chore(core/routes): added auth checks to sockets
Maximus7474 Apr 18, 2026
3551293
chore(shared/constants): split console perms to view & access
Maximus7474 Apr 18, 2026
fbf2b0c
feat(core/modules): added connection check for websocket channels
Maximus7474 Apr 18, 2026
dfc2dd0
chore(core/routes): added perm checks for console websocket
Maximus7474 Apr 18, 2026
b5b4179
feat(core/types): added search query request interface extending auth…
Maximus7474 Apr 19, 2026
a88b576
refactor(core): styled routemap and auto-redirect to frontend
Maximus7474 Apr 19, 2026
c819ac0
feat(webpanel/components): pagination selectors
Maximus7474 Apr 19, 2026
32578d4
feat(webpanel/pages): added player list
Maximus7474 Apr 19, 2026
2e4439a
chore(webpanel): added database types to dev dependencies
Maximus7474 Apr 19, 2026
ce2d9b5
feat(webpanel/components): stat card
Maximus7474 Apr 19, 2026
66b3861
feat(webpanel/pages): player view page
Maximus7474 Apr 19, 2026
45c494e
fix(webpanel/pages): added playerview to router
Maximus7474 Apr 19, 2026
152fa82
feat(core/routes): player endpoints
Maximus7474 Apr 19, 2026
f2401e1
fix(webpanel): missing sonner toast "provider"
Maximus7474 Apr 19, 2026
c348b1c
tweak(webpanel/pages): dashboard player list
Maximus7474 Apr 19, 2026
894fdfc
feat(shared/types): added player update package type
Maximus7474 Apr 19, 2026
e00154d
refactor(core/modules): update game manager to call wsManager to send…
Maximus7474 Apr 19, 2026
e4ae1ff
refactor(core/modules): remove event emitter super from process manager
Maximus7474 Apr 19, 2026
7fff95f
feat(core/modules): added player updates handler
Maximus7474 Apr 19, 2026
51d1e7c
refactor(webpanel/hooks): updated player update hook
Maximus7474 Apr 19, 2026
9ffa79a
chore(webpanel): biome cleanup
Maximus7474 Apr 19, 2026
c53eead
fix(database): verbatim type import issues
Maximus7474 Apr 19, 2026
2493cb4
fix(database): export types & schema in a separate path
Maximus7474 Apr 19, 2026
7c6a25c
chore(webpanel/pages): correct import path for infered playerprofile …
Maximus7474 Apr 19, 2026
e02a02a
fix(ui/components): props for Spinner
Maximus7474 Apr 19, 2026
9cb76d3
chore: update bun.lock
Maximus7474 Apr 19, 2026
f235eaf
fix(scripts): build script not structuing resource correctly
Maximus7474 Apr 19, 2026
2853955
fix(core/modules): incorrect canconnect check for websockets
Maximus7474 Apr 19, 2026
97a69d8
tweak(webpanel/components): removed remaining debug console log from …
Maximus7474 Apr 19, 2026
9463d27
fix: dodgy indents
Maximus7474 Apr 19, 2026
2fb5983
fix(resource/server): import path for server player events
Maximus7474 Apr 20, 2026
0a4762c
feat(resource/server): player manager
Maximus7474 Apr 20, 2026
e6c3b37
feat(core/middleware): added resource auth
Maximus7474 Apr 20, 2026
5467615
chore(core/middleware): renamed auth.ts to session.ts
Maximus7474 Apr 20, 2026
4704ca2
feat(core/routes): player endpoints for internal use
Maximus7474 Apr 20, 2026
714c7a3
fix(resource/server): refactor query manager fetch options for improv…
Maximus7474 Apr 20, 2026
3fdfc42
fix(core/common): config default webServerPort
Maximus7474 Apr 22, 2026
f42072e
fix(core/routes): fix internal player update endpoint
Maximus7474 Apr 22, 2026
068cfe5
fix(resource/server): env util module using wrong default api port & …
Maximus7474 Apr 22, 2026
4a33036
refactor(resource/server): query util to use node fetch
Maximus7474 Apr 22, 2026
37c632f
feat(resource): track test file for query
Maximus7474 Apr 22, 2026
3207ed1
cd(resource): deploy script, deploys built resource to env variable path
Maximus7474 Apr 22, 2026
8aacdec
fix(resource/server): env util module using wrong default api port & …
Maximus7474 Apr 22, 2026
d15975f
fix(resource/server): player connecting deferrals not being functional
Maximus7474 Apr 22, 2026
02d4183
chore(resource/scripts): formatted deploy
Maximus7474 Apr 22, 2026
5e4aa90
refactor(resource/server): made player event handlers async and use t…
Maximus7474 Apr 22, 2026
d5bfae2
refactor(resource/server): change player monitoring update interval t…
Maximus7474 Apr 22, 2026
b5263ad
chore(resource/server): formatted files
Maximus7474 Apr 22, 2026
a256648
fix(webpanel): only render panel if not loading, correctly handle web…
andreutu Apr 22, 2026
2f623c4
feat(webpanel/console): added horizontal scroll
andreutu Apr 22, 2026
00089c5
tweak(resource/scripts): removed lib/**.lua files from manifest
Maximus7474 Apr 22, 2026
c6022be
refactor(resource/tests): added player join & update tests
Maximus7474 Apr 22, 2026
636d7e0
fix(core/routes): added initial data for playerlist socket
Maximus7474 Apr 22, 2026
4a67a5f
fix(webpanel/hooks): playerlist web socket handlers
Maximus7474 Apr 22, 2026
ebaf910
fix(webpanel/hooks): playerlist socket not removing players on leave
Maximus7474 Apr 22, 2026
45ddabe
fix(core/modules): gamemanager sending incorrect ws message for playe…
Maximus7474 Apr 22, 2026
962da0e
fix(database/repo): missing run statements for player repo update calls
Maximus7474 Apr 22, 2026
bfdcebd
doc(database/schema): playtime field indicator that it's in ms
Maximus7474 Apr 22, 2026
c9a0547
chore(database/sql): updated debug data player playtime to be in ms
Maximus7474 Apr 22, 2026
3f38578
chore: biome cleanup
Maximus7474 Apr 22, 2026
5122616
fix(webpanel/hooks): duplication of console output
Maximus7474 Apr 22, 2026
5ce49a2
feat(core/modules): added a public method to process manager to injec…
Maximus7474 Apr 22, 2026
22b95e9
refactor(core/modules): use pm.injectConsoleLine for start/stop messages
Maximus7474 Apr 22, 2026
ba3235d
refactor(core/routes): use pm.injectConsoleLine to log command execution
Maximus7474 Apr 22, 2026
281501c
chore: biome cleanup
Maximus7474 Apr 22, 2026
f18e9a0
tweak(webpanel/pages): console terminal height
Maximus7474 Apr 22, 2026
883f44c
doc(README): update contents
Maximus7474 Apr 22, 2026
cbe1bb0
tweak(webpanel/context): unused variable
Maximus7474 Apr 22, 2026
bd62881
feat(core): added lint & format scripts
Maximus7474 Apr 22, 2026
295c32f
chore(core): biome cleanup
Maximus7474 Apr 22, 2026
6f03a0b
Merge branch 'main' into proto/fastify
Maximus7474 Apr 22, 2026
7123f6b
tweak(scripts/build): added a wait for file as resource build is async
Maximus7474 Apr 22, 2026
c89c261
feat(package): force build for release that skips cache with turbo
Maximus7474 Apr 22, 2026
09bce7d
ci(release): use build:force instead of build
Maximus7474 Apr 22, 2026
397eb5d
chore(resource/server): removed debug console logs
Maximus7474 Apr 22, 2026
98968de
feat(core/routes) added initial ws data for server_state
Maximus7474 Apr 22, 2026
27310a2
fix(webpanel/lib): formatUptime passing minutes duration instead of m…
Maximus7474 Apr 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 14 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# https://editorconfig.org

root = true

[*]
indent_style = space
indent_size = 2
tab_width = 2
end_of_line = lf
charset = utf-8
insert_final_newline = true
max_line_length = 120
max_line_length = 100

[*.json]
indent_style = tab
insert_final_newline = true

[*.lua]
indent_style = space
indent_size = 4

[*.sql]
indent_style = space
indent_size = 4

[*.tsx, *.ts, *.js]
[*.md]
indent_style = space
indent_size = 2

[*.json]
indent_size = 4
insert_final_newline = false
max_line_length = 200
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ FXSERVER_EXECUTABLE=./FXServer
# Path to your server-data folder
FXSERVER_DATA_PATH=./server-data

DEPLOY_PATH=./server-data/resources/[dev-resources]/fxManager

# Config file inside server-data
FXSERVER_CFG=server.cfg

Expand Down
Binary file added .github/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
git push origin HEAD:main

- name: Run Build
run: bun run build
run: bun run build:force

- name: Package Assets
run: |
Expand Down
39 changes: 32 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
# Dependencies
node_modules
dist/
data/
.pnp
.pnp.js

# Local env files
.env
*.db
*.db-shm
*.db-wal
packages/panel/client/dist/
.turbo/
.env.local
.env.development.local
.env.test.local
.env.production.local

# Testing
coverage

# Database files
data/*.db*

# Turbo
.turbo

# Vercel
.vercel

# Build Outputs
dist

# Debug
npm-debug.log*

# Misc
.DS_Store
*.pem
.vscode
86 changes: 49 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,23 @@ Single binary deployment - no runtime dependencies required on the target machin
> This project is still in intensive development, it is **not** to be considered stable until a `v1.0.0+` release.
> If this repository is public, it's for transparency, feedback and open source contributions to help it achieve this milestone.

---

## Stack
## Structure

| Layer | Tech | Location |
|-------------------|---------------------------------|---------------------|
| Runtime | Bun (compiled into binary) | |
| Monorepo | Turbo + Bun Workspaces | |
| Linting | Biome (lint + format + imports) | |
| Process Manager | Bun | `packages/core` |
| Web Server | ElysiaJS | `packages/core` |
| Frontend | React + Vite SPA | `packages/panel-ui` |
| Database | Bun SQLite + Drizzle ORM | `packages/database` |
| FiveM/RedM Bridge | Lua resource | `packages/resource` |

---

## Project Structure
Each app/package will have it's own more detailled structure in it's README.

```
packages/
core/ - Process manager: spawns & supervises FiveM/RedM
- Webserver: ElysiaJS API for the panel & game resource communication
panel-ui/ - React SPA
database/ - Drizzle schema, migrations, repositories
resource/ - Drop-in FiveM/RedM Lua resource
shared/
types/ - Shared TypeScript types
utils/ - Shared helper functions
fxManager/
├── apps/
│ ├── core/ # Process Manager & Webserver
│ ├── resource/ # FxServer resource to connect to panel
│ └── webpanel/ # React SPA served by the webserver
├── packages/
│ ├── database/ # Drizzle schema & Migration handler
│ ├── shared/ # Enums, types, and utils
│ └── ui/ # Shared React ShadCN components
├── biome.json # Root linting/formatting
├── package.json # Workspace definitions
└── turbo.json # Build pipeline config
```

---
Expand All @@ -50,7 +38,7 @@ bun install
bun dev
```

The React dev server runs on `:5173` and proxies API/WS calls to Elysia on `:4000`.
The React dev server runs on `:5173` and proxies API/WS calls on `:3000`.

---

Expand All @@ -64,7 +52,25 @@ bun typecheck # tsc --noEmit across all packages (via Turbo)
bun db:studio # open Drizzle Studio to browse the database (optional)
```

### Adding a migration
---

## Development & Code Quality

* **`bun lint`** – Runs linting across the entire monorepo to find and fix code smells.
* **`bun format`** – Automatically formats all source code and internal build scripts.
* **`bun typecheck`** – Validates TypeScript types across all packages via Turbo.
* **`bun db:studio`** – Opens a browser-based GUI to manage and browse your database.
* **`bun build`** – Compiles all packages and prepares the production bundle.
* **`bun dev`** – Starts the development environment with hot-reloading.

### Game Resource ( [`apps/resource`](./apps/resource) )
Commands specific to the game-side resource and NUI:

* **`bun web:dev`** – Runs the Vite dev server for the NUI frontend.
* **`bun watch`** – Rebuilds the resource automatically as you save files.
* **`bun deploy`** – Bundles the resource and copies it to the path defined in your `DEPLOY_PATH` environment variable.

## Adding a migration

Edit `packages/database/src/migrations/index.ts` and append to the array:

Expand All @@ -88,11 +94,11 @@ Biome handles everything ESLint + Prettier would - faster, single config at the

```bash
# Build for both platforms
bun run build.ts
bun run build

# Build for a specific platform
bun run build.ts --target=linux
bun run build.ts --target=windows
bun run build --target=linux
bun run build --target=windows
```

Turbo caches build outputs - subsequent builds only rebuild what changed.
Expand Down Expand Up @@ -137,9 +143,15 @@ The panel will be available at `http://your-server-ip:4000`.

## Environment Variables

| Variable | Default | Description |
|-----------------------|-------------------|-----------------------------------|
| `PANEL_PORT` | `4000` | Web panel port |
| `FXSERVER_EXECUTABLE` | `./FXServer` | Path to FXServer binary |
| `FXSERVER_DATA_PATH` | `./server-data` | Path to server-data folder |
| `FXSERVER_CFG` | `server.cfg` | Config file name inside data path |
| Variable | Default | Description |
|-----------------------|-------------------|--------------------------------------|
| `FXSERVER_EXECUTABLE` | `./FXServer` | Path to FXServer binary |
| `FXSERVER_DATA_PATH` | `./server-data` | Path to server-data folder |
| `FXSERVER_CFG` | `server.cfg` | Config file name inside data path |
| `PANEL_PORT` | `3000` (opt) | Web panel port |
| `COOKIE_SECRET` | N/A (opt) | Defines the secret for cookie sign |
| `DEPLOY_PATH` | N/A | Used in development for the resource |

## Errrh anything else ?

![dumb monke](.github/image.png)
34 changes: 34 additions & 0 deletions apps/core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# dependencies (bun install)
node_modules

# output
out
dist
*.tgz

# code coverage
coverage
*.lcov

# logs
logs
_.log
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# caches
.eslintcache
.cache
*.tsbuildinfo

# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
.DS_Store
12 changes: 12 additions & 0 deletions apps/core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# core

## WebServer

### Endpoint Groups

All endpoints are placed in one of two groups, these define what they're used for as well as security for them.

| Prefix | |
|---------------|-----------------------------------------|
| `/api/*` | Endpoints used for the webpanel |
| `/internal/*` | Endpoints used by the fxserver resource |
28 changes: 28 additions & 0 deletions apps/core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "@fxmanager/core",
"module": "index.ts",
"type": "module",
"private": true,
"scripts": {
"dev": "bun --watch src/index.ts",
"start": "bun src/index.ts",
"lint": "biome lint ./src",
"format": "biome format --write ."
},
"devDependencies": {
"@types/bun": "latest",
"@types/node": "^25.5.0"
},
"peerDependencies": {
"typescript": "^5"
},
"dependencies": {
"@fastify/cookie": "^11.0.2",
"@fastify/static": "^9.0.0",
"@fastify/websocket": "^11.2.0",
"@fxmanager/database": "workspace:*",
"@fxmanager/shared": "workspace:*",
"@sinclair/typebox": "^0.34.49",
"fastify": "^5.8.4"
}
}
35 changes: 35 additions & 0 deletions apps/core/src/common/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import type { CoreConfig, PlatformOS } from '@fxmanager/shared/types';
import { repo } from '@fxmanager/database';

function getPlatform(): PlatformOS {
if (process.platform === 'win32') {
return 'windows';
} else if (process.platform === 'linux' || process.platform === 'darwin') {
return 'linux';
} else {
return 'unknown';
}
}

const DEFAULTS: CoreConfig = {
platform: getPlatform(),
executable: process.env.FXSERVER_EXECUTABLE || './FXServer',
serverDataPath: process.env.FXSERVER_DATA_PATH || './server-data',
configFile: process.env.FXSERVER_CFG || 'server.cfg',
autoRestart: true,
maxRestarts: 5,
restartDelayMs: 5000,
webServerPort: process.env.PANEL_PORT ? Number(process.env.PANEL_PORT) : 3000,
// used for fxserver resource -> process manager communications
resourceApiToken: crypto.randomUUID(),
cookieSecret: process.env.COOKIE_SECRET ?? crypto.randomUUID(),
};

export function loadConfig(): CoreConfig {
const stored = repo.settings.get<Partial<CoreConfig>>('server.config');
return { ...DEFAULTS, ...stored };
}

export function saveConfig(config: Partial<CoreConfig>) {
repo.settings.set('server.config', config);
}
36 changes: 36 additions & 0 deletions apps/core/src/common/env.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { existsSync, readFileSync } from 'node:fs';
import { join } from 'node:path';
import { isProduction } from './utils';

/**
* Manually loads environment variables in `process.env` from the root `.env` file.
* Used only in development when the runtime is expecting the `.env` file to be in apps/core.
*/

if (!isProduction) {
const envPath = join(process.cwd(), '../..', '.env');

if (existsSync(envPath)) {
const lines = readFileSync(envPath, 'utf-8').split('\n');

for (const line of lines) {
const trimmed = line.trim();
if (!trimmed || trimmed.startsWith('#')) continue;

const eq = trimmed.indexOf('=');
if (eq === -1) continue;

const key = trimmed.slice(0, eq).trim();
const value = trimmed
.slice(eq + 1)
.trim()
.replace(/^["']|["']$/g, ''); // Removes quotes

if (!(key in process.env)) process.env[key] = value;
}

console.log(`[core] Loaded .env from ${envPath}.`);
} else {
console.log(`[core] No .env found at ${envPath}.`);
}
}
8 changes: 8 additions & 0 deletions apps/core/src/common/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { repo } from '@fxmanager/database';

export const isProduction = process.env.NODE_ENV === 'production';
export const COOKIE_NAME = 'fxm_session';

export function isFxManagerSetup() {
return repo.auth.countUsers() > 0;
}
Loading