# nersus15/webcore-go architecture

> Architecture diagram of the GitHub repository nersus15/webcore-go, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nersus15/webcore-go
- Repository: https://github.com/nersus15/webcore-go

## Overview

WebCoreGo is a pluggable Go/Fiber API framework. Its principal workflow starts with an HTTP request, applies global middleware and authentication, checks authorization, and dispatches onward to registered module routes. At startup, the app initializes shared libraries and modules before listening; configuration and library/module interfaces support that composition. Authentication is the clearest sampled feature branch, including credential validation, user lookup, access control, and optional sessions. README-described capabilities such as CORS and external database, Redis, Kafka, and Pub/Sub drivers are not represented as implementations because their source paths are absent from this tree.

Main entry points: [`adapter/auth/authn/authn.go`](https://github.com/nersus15/webcore-go/blob/main/adapter/auth/authn/authn.go) (Authentication manager), [`app/core/app.go`](https://github.com/nersus15/webcore-go/blob/main/app/core/app.go) (Application), [`infra/middleware/auth.go`](https://github.com/nersus15/webcore-go/blob/main/infra/middleware/auth.go) (Auth middleware), [`app/core/module.go`](https://github.com/nersus15/webcore-go/blob/main/app/core/module.go) (Module manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["HTTP Runtime"]
  node_app["Application<br/>[app.go]"]
  node_middleware["Global middleware<br/>[middleware.go]"]
  node_authmw["Auth middleware<br/>[auth.go]"]
  node_fiber["Fiber server<br/>[app.go]"]
end

subgraph group_registry["Modules And Libraries"]
  node_modulemgr["Module manager<br/>[module.go]"]
  node_libmgr["Library manager<br/>[library.go]"]
  node_module["Pluggable modules<br/>[module.go]"]
end

subgraph group_auth["Authentication"]
  node_authn["Authentication manager<br/>[authn.go]"]
  node_validator["Credential validators<br/>[validator.go]"]
  node_basicvalidator["Basic validator<br/>[validator.go]"]
  node_authenticator["User authenticator<br/>[authn.go]"]
  node_authstore["Auth store<br/>[store.go]"]
  node_yamlstore["YAML backend<br/>[backend.go]"]
  node_authorizer["RBAC / ABAC<br/>[authz.go]"]
  node_session["Session manager<br/>[session.go]"]
  node_sessioncache["Memory session store<br/>[storage.go]"]
end

subgraph group_infra["Configuration And Ports"]
  node_config["Config loader<br/>[interface.go]"]
  node_ports["Dependency ports<br/>[conn.go]"]
  node_memory[("Cache provider")]
end

node_client(("API client"))

node_client -->|"sends requests"| node_fiber
node_app -->|"creates and serves"| node_fiber
node_app -->|"sets up"| node_middleware
node_app -->|"initializes and routes"| node_modulemgr
node_app -->|"loads and destroys"| node_libmgr
node_app -->|"installs auth"| node_authmw
node_fiber -->|"runs protected requests"| node_authmw
node_authmw -->|"gets handler"| node_authn
node_authn -->|"validates credentials"| node_validator
node_authn -->|"checks user"| node_authenticator
node_authenticator -->|"looks up user"| node_authstore
node_authstore -.->|"uses backend"| node_yamlstore
node_authn -->|"checks access"| node_authorizer
node_authn -->|"continues request"| node_fiber
node_authn -.->|"loads optional sessions"| node_session
node_session -.->|"uses store"| node_sessioncache
node_sessioncache -->|"reads and writes"| node_memory
node_modulemgr -->|"initializes modules"| node_module
node_config -->|"provides settings"| node_app
node_libmgr -->|"loads implementations"| node_ports

click node_app "https://github.com/nersus15/webcore-go/blob/main/app/core/app.go"
click node_middleware "https://github.com/nersus15/webcore-go/blob/main/infra/middleware/middleware.go"
click node_authmw "https://github.com/nersus15/webcore-go/blob/main/infra/middleware/auth.go"
click node_fiber "https://github.com/nersus15/webcore-go/blob/main/app/core/app.go"
click node_modulemgr "https://github.com/nersus15/webcore-go/blob/main/app/core/module.go"
click node_libmgr "https://github.com/nersus15/webcore-go/blob/main/app/core/library.go"
click node_module "https://github.com/nersus15/webcore-go/blob/main/app/core/module.go"
click node_config "https://github.com/nersus15/webcore-go/blob/main/infra/config/interface.go"
click node_ports "https://github.com/nersus15/webcore-go/blob/main/port/conn.go"
click node_authn "https://github.com/nersus15/webcore-go/blob/main/adapter/auth/authn/authn.go"
click node_validator "https://github.com/nersus15/webcore-go/blob/main/adapter/auth/apikey/validator.go"
click node_basicvalidator "https://github.com/nersus15/webcore-go/blob/main/adapter/auth/basic/validator.go"
click node_authenticator "https://github.com/nersus15/webcore-go/blob/main/port/auth/authn.go"
click node_authstore "https://github.com/nersus15/webcore-go/blob/main/adapter/authstore/store/store.go"
click node_yamlstore "https://github.com/nersus15/webcore-go/blob/main/adapter/authstore/yaml/backend.go"
click node_authorizer "https://github.com/nersus15/webcore-go/blob/main/port/auth/authz.go"
click node_session "https://github.com/nersus15/webcore-go/blob/main/adapter/authsession/session/session.go"
click node_sessioncache "https://github.com/nersus15/webcore-go/blob/main/adapter/authsession/cache/storage.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_middleware,node_authmw,node_fiber,node_client toneBlue
class node_modulemgr,node_libmgr,node_module toneAmber
class node_authn,node_validator,node_basicvalidator,node_authenticator,node_authstore,node_yamlstore,node_authorizer,node_session,node_sessioncache toneMint
class node_config,node_ports,node_memory toneRose
```

## Components

### HTTP Runtime

- [Application](https://github.com/nersus15/webcore-go/blob/main/app/core/app.go): `app/core/app.go`
- [Global middleware](https://github.com/nersus15/webcore-go/blob/main/infra/middleware/middleware.go): `infra/middleware/middleware.go`
- [Auth middleware](https://github.com/nersus15/webcore-go/blob/main/infra/middleware/auth.go): `infra/middleware/auth.go`
- [Fiber server](https://github.com/nersus15/webcore-go/blob/main/app/core/app.go): `app/core/app.go`

### Modules And Libraries

- [Module manager](https://github.com/nersus15/webcore-go/blob/main/app/core/module.go): `app/core/module.go`
- [Library manager](https://github.com/nersus15/webcore-go/blob/main/app/core/library.go): `app/core/library.go`
- [Pluggable modules](https://github.com/nersus15/webcore-go/blob/main/app/core/module.go): `app/core/module.go`

### Authentication

- [Authentication manager](https://github.com/nersus15/webcore-go/blob/main/adapter/auth/authn/authn.go): `adapter/auth/authn/authn.go`
- [Credential validators](https://github.com/nersus15/webcore-go/blob/main/adapter/auth/apikey/validator.go): `adapter/auth/apikey/validator.go`
- [Basic validator](https://github.com/nersus15/webcore-go/blob/main/adapter/auth/basic/validator.go): `adapter/auth/basic/validator.go`
- [User authenticator](https://github.com/nersus15/webcore-go/blob/main/port/auth/authn.go): `port/auth/authn.go`
- [Auth store](https://github.com/nersus15/webcore-go/blob/main/adapter/authstore/store/store.go): `adapter/authstore/store/store.go`
- [YAML backend](https://github.com/nersus15/webcore-go/blob/main/adapter/authstore/yaml/backend.go): `adapter/authstore/yaml/backend.go`
- [RBAC / ABAC](https://github.com/nersus15/webcore-go/blob/main/port/auth/authz.go): `port/auth/authz.go`
- [Session manager](https://github.com/nersus15/webcore-go/blob/main/adapter/authsession/session/session.go): `adapter/authsession/session/session.go`
- [Memory session store](https://github.com/nersus15/webcore-go/blob/main/adapter/authsession/cache/storage.go): `adapter/authsession/cache/storage.go`

### Configuration And Ports

- [Config loader](https://github.com/nersus15/webcore-go/blob/main/infra/config/interface.go): `infra/config/interface.go`
- [Dependency ports](https://github.com/nersus15/webcore-go/blob/main/port/conn.go): `port/conn.go`
- **Cache provider**

### Other components

- **API client**

## Connections

- API client → Fiber server: sends requests
- Application → Fiber server: creates and serves
- Application → Global middleware: sets up
- Application → Module manager: initializes and routes
- Application → Library manager: loads and destroys
- Application → Auth middleware: installs auth
- Fiber server → Auth middleware: runs protected requests
- Auth middleware → Authentication manager: gets handler
- Authentication manager → Credential validators: validates credentials
- Authentication manager → User authenticator: checks user
- User authenticator → Auth store: looks up user
- Auth store → YAML backend: uses backend
- Authentication manager → RBAC / ABAC: checks access
- Authentication manager → Fiber server: continues request
- Authentication manager → Session manager: loads optional sessions
- Session manager → Memory session store: uses store
- Memory session store → Cache provider: reads and writes
- Module manager → Pluggable modules: initializes modules
- Config loader → Application: provides settings
- Library manager → Dependency ports: loads implementations
