diff --git a/.gitignore b/.gitignore
index c36ace92..5e8fb4eb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,32 +1,13 @@
wails3
build/
!cmd/app/build
+.task
vendor/
.idea
node_modules/
.DS_Store
-.vscode
*.log
.env
.env.*.local
-dist/
-*.exe
-*.dll
-*.so
-*.dylib
-*.test
coverage/
-*.out
-*.prof
-*.zip
-*.tar.gz
*.cache
-*.tmp
-*.bak
-*.swp
-*.swo
-*.class
-*.jar
-*.war
-*.iml
-*.ipr
\ No newline at end of file
diff --git a/Makefile b/Makefile
deleted file mode 100644
index ab6bd3a4..00000000
--- a/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-all:
- go build -o build/bin/core cmd/app/main.go
\ No newline at end of file
diff --git a/README.md b/README.md
index 33b3eeda..2c41437f 100644
--- a/README.md
+++ b/README.md
@@ -1,187 +1,34 @@
-# Core.Framework
+# Core
-Core is an opinionated framework for building Go applications. It was written to ensure information exchange between the front-end and back-end of a Web3 environment.
+Core is an opinionated Go framework for building desktop apps with Wails. It provides a small set of focused modules:
-There is no assumption of what front-end framework you use or what back-end framework you use.
+- Core — framework bootstrap and service container
+- Core.Config — app and UI state persistence
+- Core.Crypt — keys, encrypt/decrypt, sign/verify
+- Core.Display — windows, tray, window state
+- Core.Docs — in‑app help and deep‑links
+- Core.IO — local/remote filesystem helpers
+- [Core.Workspace](https://core.help/) — projects and paths
-However, Core provides a set of services beneficial for building applications for the Web3 environment.
+Help: https://Core.Help \
+Web: https://dAppCo.re \
+Repo: https://github.com/Snider/Core
-With working defaults, Core is designed to be as simple as possible, yet powerful enough to be used in various applications.
-
-## Libraries used in Core
-- [Wails.io](https://github.com/wailsapp/wails) - A framework for building desktop applications using Go and web technologies.
-- [ProtonMail OpenPGP](https://github.com/ProtonMail/go-crypto)
-## Features
-- [Core](#core) - Manages application configuration
-- [Core.Config](#coreconfig) - Manages application configuration
-- [Core.Crypto](#corecrypto) - Manages cryptographic operations
-- [Core.Database](#coredatabase) - Manages database operations
-- [Core.IPC](#coreipc) - Manages inter-process communication
-- [Core.Log](#corelog) - Manages logging
-- [Core.Network](#corenetwork) - Manages network operations
-- [Core.Storage](#corestorage) - Manages storage operations
-- [Core.UI](#coreui) - Manages user interface operations
-- [Core.Utils](#coreutils) - Manages utility operations
-- [Core.Display](#coredisplay) - Manages Windows, system tray and their states
-
-
-## Core
-
-Core allows you to easily instantiate complex services within a locked-down environment enforcing logical enclaves.
-
-### Basic Usage
+## Quick start
```go
-package main
+import core "github.com/Snider/Core"
-import (
- "cmd/demo"
-
- "https://github.com/Snider/Core"
-)
-
-func main() {
- demoService := core.New(
- core.WithService(demo.Register),
- core.WithServiceLock(), // This can go anywhere in the chain to be the Final Service (provides security clarity)
- )
- demoService.Run() // handled by wails, not implemented yet
- demoService.Wait() // handled by wails, not implemented yet
- demoService.Close() // handled by wails, not implemented yet
-}
-```
-
-### Multiple Services
-```go
-package main
-
-import (
- "cmd/demo"
-
- "https://github.com/Snider/Core"
-)
-
-func main() {
- coreService := core.New(
- core.WithService(demo.Register),
- core.WithService(demo.RegisterDemo2),
- core.WithServiceLock(),
- )
-
- rickService := core.New(
- core.WithService(demo.Register),
- core.WithService(demo.RegisterDemo2),
- core.WithServiceLock(),
- )
- mortyService := core.New(
- core.WithService(demo.Register),
- core.WithService(demo.RegisterDemo2),
- core.WithServiceLock(),
- )
-
- core.Mod[API](coreService,"demo").name = "demo"
- core.Mod[API](rickService).name = "demo2"
- core.Mod[API](mortyService).name = "demo2"
-
-}
-```
-
-### Integrating your own services
-```go
-package demo
-
-import "github.com/Snider/Core"
-
-// this instance is the singleton instance of the demo module.
-var instance *Demo
-
-type Demo struct {
- name string
- core *core.Core
-}
-
-func Register(c *core.Core) error {
- instance = &Demo{
- core: c,
- }
- if err := c.RegisterModule("demo", instance); err != nil {
- return err
- }
- c.RegisterAction(handleActionCall)
- return nil
-}
-
-func handleActionCall(c *core.Core, msg core.Message) error {
- return nil
-}
-
-
-```
-
-## Core.Display
-
-Display is a Wails.io service that provides the ability to open windows.
-Core.Display remembers the locations of your users windows and will reopen them when the application is restarted.
-Also allows you to adjust your windowing programmatically via JavaScript bindings, and for it to be persistent.
-
-### Open A Window On Startup
-
-```go
-func (d *API) ServiceStartup(ctx context.Context, options application.ServiceOptions) error {
- d.OpenWindow(
- OptName("main"),
- OptHeight(900),
- OptWidth(1280),
- OptURL("/"),
- OptTitle("Core"),
- )
- return nil
-}
-```
-
-```go
-window := d.OpenWindow(
- OptName("main"),
- OptHeight(900),
- OptWidth(1280),
- OptURL("/"),
- OptTitle("Core"),
+app := core.New(
+ core.WithServiceLock(),
)
```
-### Full Wails Example
-```go
-package main
+## Docs (MkDocs)
+The help site and in‑app docs are built with MkDocs Material and live under `pkg/v1/core/docs`.
-import (
- "embed"
+- Live preview: from `pkg/v1/core/docs` run
+ - `pip install -r requirements.txt`
+ - `mkdocs serve -o -c` (or `task dev` if you use Task)
+- Build static site: `mkdocs build --clean -d public` (or `task build`)
- "github.com/Snider/Core"
- "github.com/Snider/Core/display"
- "github.com/wailsapp/wails/v3/pkg/application"
-)
-
-//go:embed all:public/*
-var assets embed.FS
-
-func main() {
-
- app := application.New(application.Options{
- Assets: application.AssetOptions{
- Handler: application.AssetFileServerFS(assets),
- },
- })
-
- app.RegisterService(application.NewService(core.Service(
- core.WithWails(app), // Provides the Wails application instance to core services
- core.WithAssets(assets), // Provides the embed.FS to core services
- core.WithService(display.Register), // Provides the ability to open windows
- core.WithService(config.Register), // Provides the ability to persist UI state (windows reopen where they closed)
- core.WithServiceLock(), // locks core from accepting new services blocking access to IPC
- )))
-
- err := app.Run()
- if err != nil {
- panic(err)
- }
-}
-```
+The demo app embeds the built docs from `public/` and can open specific sections in new windows using stable, short headings.
diff --git a/Taskfile.yaml b/Taskfile.yaml
deleted file mode 100644
index 877af8c3..00000000
--- a/Taskfile.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-version: '3'
-
-tasks:
- build:
- cmds:
- - go build -o build/bin/core cmd/app/main.go
diff --git a/Taskfile.yml b/Taskfile.yml
new file mode 100644
index 00000000..e0549880
--- /dev/null
+++ b/Taskfile.yml
@@ -0,0 +1,35 @@
+version: '3'
+
+# This top-level Taskfile orchestrates tasks in the sub-directories.
+# It uses the 'dir' property to ensure that each included task runs
+# from its correct working directory.
+includes:
+ app:
+ dir: {{.TASKFILE_DIR}}/cmd/app
+ docs:
+ dir: {{.TASKFILE_DIR}}/pkg/v1/core/docs
+
+
+
+tasks:
+ default:
+ desc: "Show available tasks."
+ cmds:
+ - task --list-all
+
+ build:
+ desc: "Build both the application and the documentation."
+ cmds:
+ - task: app:build
+ - task: docs:build
+
+ dev:
+ desc: "Run the application in development mode and serve the documentation."
+ cmds:
+ - task: app:dev
+ - task: docs:dev
+
+ tidy:
+ desc: "Tidy all Go modules in the workspace."
+ cmds:
+ - go mod tidy
diff --git a/cmd/app/.gitignore b/cmd/app/.gitignore
index c2a88322..393ccc12 100644
--- a/cmd/app/.gitignore
+++ b/cmd/app/.gitignore
@@ -1 +1,2 @@
-.task
\ No newline at end of file
+.task
+/build/bin/core
diff --git a/cmd/app/Taskfile.yml b/cmd/app/Taskfile.yml
new file mode 100644
index 00000000..c2336aa5
--- /dev/null
+++ b/cmd/app/Taskfile.yml
@@ -0,0 +1,34 @@
+version: '3'
+
+
+includes:
+ common: "{{.TASKFILE_DIR}}/build/Taskfile.yml"
+ windows: "{{.TASKFILE_DIR}}/build/windows/Taskfile.yml"
+ darwin: "{{.TASKFILE_DIR}}/build/darwin/Taskfile.yml"
+ linux: "{{.TASKFILE_DIR}}/build/linux/Taskfile.yml"
+
+vars:
+ APP_NAME: "core"
+ BIN_DIR: "{{.TASKFILE_DIR}}/build/bin"
+ VITE_PORT: '{{.WAILS_VITE_PORT | default 9245}}'
+
+tasks:
+ build:
+ summary: Builds the application
+ cmds:
+ - task: "{{OS}}:build"
+
+ package:
+ summary: Packages a production build of the application
+ cmds:
+ - task: "{{OS}}:package"
+
+ run:
+ summary: Runs the application
+ cmds:
+ - task: "{{OS}}:run"
+
+ dev:
+ summary: Runs the application in development mode
+ cmds:
+ - wails3 dev -config {{.TASKFILE_DIR}}/build/config.yml -port {{.VITE_PORT}}
diff --git a/cmd/app/build/Taskfile.yml b/cmd/app/build/Taskfile.yml
new file mode 100644
index 00000000..4fb1eecb
--- /dev/null
+++ b/cmd/app/build/Taskfile.yml
@@ -0,0 +1,84 @@
+version: '3'
+
+tasks:
+ go:mod:tidy:
+ summary: Runs `go mod tidy`
+ internal: true
+ cmds:
+ - go mod tidy
+
+ install:public:deps:
+ summary: Install public dependencies
+ dir: public
+ sources:
+ - package.json
+ - package-lock.json
+ generates:
+ - node_modules/*
+ preconditions:
+ - sh: npm version
+ msg: "Looks like npm isn't installed. Npm is part of the Node installer: https://nodejs.org/en/download/"
+ cmds:
+ - npm install
+
+ build:public:
+ label: build:public (PRODUCTION={{.PRODUCTION}})
+ summary: Build the public folder
+ dir: public
+ sources:
+ - "**/*"
+ generates:
+ - dist/**/*
+ deps:
+ - task: install:public:deps
+ - task: generate:bindings
+ vars:
+ BUILD_FLAGS:
+ ref: .BUILD_FLAGS
+ cmds:
+ - npm run {{.BUILD_COMMAND}} -q
+ env:
+ PRODUCTION: '{{.PRODUCTION | default "false"}}'
+ vars:
+ BUILD_COMMAND: '{{if eq .PRODUCTION "true"}}build{{else}}build:dev{{end}}'
+
+ generate:bindings:
+ label: generate:bindings (BUILD_FLAGS={{.BUILD_FLAGS}})
+ summary: Generates bindings
+ deps:
+ - task: go:mod:tidy
+ sources:
+ - "**/*.[jt]s"
+ - exclude: public/**/*
+ - public/bindings/**/*
+ - "**/*.go"
+ - go.mod
+ - go.sum
+ generates:
+ - public/bindings/**/*
+ cmds:
+ - wails3 generate bindings -d public/bindings -f '{{.BUILD_FLAGS}}' -clean=true -ts
+
+ generate:icons:
+ summary: Generates Windows `.ico` and Mac `.icns` files from an image
+ dir: build
+ sources:
+ - "appicon.png"
+ generates:
+ - "darwin/icons.icns"
+ - "windows/icon.ico"
+ cmds:
+ - wails3 generate icons -input appicon.png -macfilename darwin/icons.icns -windowsfilename windows/icon.ico
+
+ dev:public:
+ summary: Runs the frontend dev server for live development
+ dir: public
+ deps:
+ - task: install:public:deps
+ cmds:
+ - npm start -- --port {{.VITE_PORT | default "4200"}}
+
+ update:build-assets:
+ summary: Updates the build assets
+ cmds:
+ - wails3 update build-assets -name "{{.APP_NAME}}" -binaryname "{{.APP_NAME}}" -config config.yml -dir .
diff --git a/cmd/app/build/appicon.png b/cmd/app/build/appicon.png
new file mode 100644
index 00000000..3a14b0d0
Binary files /dev/null and b/cmd/app/build/appicon.png differ
diff --git a/cmd/app/frontend/dist/assets/apptray.png b/cmd/app/build/apptray.png
similarity index 100%
rename from cmd/app/frontend/dist/assets/apptray.png
rename to cmd/app/build/apptray.png
diff --git a/cmd/app/build/config.yml b/cmd/app/build/config.yml
new file mode 100644
index 00000000..cfcaa087
--- /dev/null
+++ b/cmd/app/build/config.yml
@@ -0,0 +1,43 @@
+# This file contains the configuration for this project.
+# When you update `info` or `fileAssociations`, run `wails3 task common:update:build-assets` to update the assets.
+# Note that this will overwrite any changes you have made to the assets.
+version: '3'
+# This information is used to generate the build assets.
+info:
+ companyName: "Snider"
+ productName: "Core.Framework"
+ productIdentifier: "com.core.desktop"
+ description: "A program that does demos the features"
+ copyright: "(c) EUPL-1.2, Snider"
+ comments: "Demo Dev Area"
+ version: "0.0.1"
+
+# Dev mode configuration
+dev_mode:
+ root_path: ../
+ log_level: warn
+ debounce: 1000
+ ignore:
+ dir:
+ - .git
+ - node_modules
+ - public
+ - bin
+ file:
+ - .DS_Store
+ - .gitignore
+ - .gitkeep
+ watched_extension:
+ - "*.go"
+ git_ignore: true
+ executes:
+ - cmd: wails3 task common:install:public:deps
+ type: once
+ - cmd: wails3 task common:dev:public
+ type: background
+ - cmd: go mod tidy
+ type: blocking
+ - cmd: wails3 task build
+ type: blocking
+ - cmd: wails3 task run
+ type: primary
diff --git a/cmd/app/build/darwin/Info.dev.plist b/cmd/app/build/darwin/Info.dev.plist
new file mode 100644
index 00000000..c7d6ce4b
--- /dev/null
+++ b/cmd/app/build/darwin/Info.dev.plist
@@ -0,0 +1,32 @@
+
+