Skip to content

Commit 0070f9f

Browse files
authored
Merge pull request #8 from dotkernel/overhaul
Overhaul
2 parents e8a34b6 + c54a966 commit 0070f9f

47 files changed

Lines changed: 1918 additions & 26 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/book/llms-full.txt

Lines changed: 686 additions & 0 deletions
Large diffs are not rendered by default.

docs/book/v1/admin/introduction.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Introduction
22

3+
## Summary
4+
5+
An overview of Dotkernel Admin, a skeleton application for quickly building a database-backed administration site with reports, graphs, and a PSR-compliant middleware stack.
6+
7+
## Details
8+
39
Dotkernel Admin is an application (skeleton) intended for quickly setting up an administration site for your platform.
410

511
Dotkernel Admin:
@@ -9,3 +15,19 @@ Dotkernel Admin:
915
- Contains many graphical components to ensure an intuitive user experience.
1016
- Has a PSR-Compliant Middleware Stack to promote a lean, modular architecture and create a common ground between components from various sources.
1117
- Implements [PSR-7](https://www.php-fig.org/psr/psr-7/) (HTTP message interfaces) and [PSR-15](https://www.php-fig.org/psr/psr-15/) (HTTP Server Request Handlers) as defined by the [PHP Framework Interop Group](https://www.php-fig.org/).
18+
19+
## FAQ
20+
21+
**Q: What is Dotkernel Admin?**
22+
A: It's a skeleton application for quickly setting up an administration site to manage records in your database.
23+
24+
**Q: Does Dotkernel Admin include reporting features?**
25+
A: Yes, it has built-in reports and graphs to help you monitor your platform.
26+
27+
**Q: What standards does Dotkernel Admin implement?**
28+
A: PSR-7 and PSR-15, as defined by the PHP Framework Interop Group (PHP-FIG).
29+
30+
## See also
31+
32+
- [Usage](usage.md) — how Admin fits alongside API and Queue.
33+
- [Architecture Overview](../architecture.md) — how all the platform pieces fit together.

docs/book/v1/admin/usage.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Usage
22

3-
Dotkernel Admin can be installed independently or together with other applications in the Dotkernel suite, based on your business requirements.
4-
These components are designed to complement each other (out-of-box they are separate codebases):
3+
## Summary
4+
5+
Explains how Dotkernel Admin fits alongside Dotkernel API and Dotkernel Queue, and how you can start with Admin alone and add the other components later.
56

6-
- **Dotkernel API** exposes the content to 3rd-party frontends or backends.
7-
- **Dotkernel Admin** (optional) manages the data (create, edit, delete).
8-
- **Dotkernel Queue** (optional) queue management microservice.
7+
## Details
8+
9+
Dotkernel Admin can be installed independently or together with other applications in the Dotkernel suite, based on your business requirements.
10+
Out of the box, Admin, API, and Queue are separate codebases designed to complement each other — see the [Architecture Overview](../architecture.md) for how they fit together.
911

1012
You can start with Dotkernel Admin and integrate it into your existing platform.
1113
The Admin has built-in reports and graphs that can be configured and customized based on your needs.
@@ -14,3 +16,20 @@ Later on you can add:
1416

1517
- Dotkernel API to handle all data manipulation.
1618
- Dotkernel Queue for its asynchronous task processing.
19+
20+
## FAQ
21+
22+
**Q: Can Dotkernel Admin be used on its own?**
23+
A: Yes, it can be installed independently and integrated into your existing platform.
24+
25+
**Q: Are Dotkernel Admin, API, and Queue part of the same codebase?**
26+
A: No, out of the box they are separate codebases designed to complement each other.
27+
28+
**Q: What do Dotkernel API and Dotkernel Queue add to Admin?**
29+
A: The API handles data manipulation for the platform, and Queue handles asynchronous task processing.
30+
31+
## See also
32+
33+
- [Dotkernel API: Usage](../api/usage.md)
34+
- [Dotkernel Queue: Usage](../queue/usage.md)
35+
- [Architecture Overview](../architecture.md)

docs/book/v1/api/introduction.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
11
# Introduction
22

3+
## Summary
4+
5+
An overview of Dotkernel API, the Mezzio-based REST API at the root of the Dotkernel Headless Platform, and its PSR-compliant, standards-based architecture.
6+
7+
## Details
8+
39
Dotkernel API is a REST API based on the Mezzio skeleton.
4-
The API is the root or the Dotkernel Headless Platform.
10+
The API is the root of the Dotkernel Headless Platform.
511

612
Dotkernel API:
713

814
- Ensures that you build a cohesive system that contains an API-first backend with the same architecture and standards support as other Dotkernel tools and applications.
915
- Has a PSR-Compliant Middleware Stack to promote a lean, modular architecture and create a common ground between components from various sources.
1016
- Implements [PSR-7](https://www.php-fig.org/psr/psr-7/) (HTTP message interfaces) and [PSR-15](https://www.php-fig.org/psr/psr-15/) (HTTP Server Request Handlers) as defined by the [PHP Framework Interop Group](https://www.php-fig.org/).
17+
18+
## FAQ
19+
20+
**Q: What is Dotkernel API built on?**
21+
A: It's a REST API based on the Mezzio skeleton.
22+
23+
**Q: What role does Dotkernel API play in the Headless Platform?**
24+
A: It is the root of the Dotkernel Headless Platform.
25+
26+
**Q: What standards does Dotkernel API implement?**
27+
A: PSR-7 and PSR-15, as defined by the PHP Framework Interop Group (PHP-FIG).
28+
29+
## See also
30+
31+
- [Usage](usage.md) — how API fits alongside Admin and Queue.
32+
- [Architecture Overview](../architecture.md) — how all the platform pieces fit together.

docs/book/v1/api/usage.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Usage
22

3-
Dotkernel API can be installed independently or together with other applications in the Dotkernel suite, based on your business requirements.
4-
These components are designed to complement each other (out-of-box they are separate codebases):
3+
## Summary
4+
5+
Explains how Dotkernel API fits alongside Dotkernel Admin and Dotkernel Queue, and how to start with API alone and add the other components later.
56

6-
- **Dotkernel API** exposes the content to 3rd-party frontends or backends.
7-
- **Dotkernel Admin** (optional) manages the data (create, edit, delete).
8-
- **Dotkernel Queue** (optional) queue management microservice.
7+
## Details
8+
9+
Dotkernel API can be installed independently or together with other applications in the Dotkernel suite, based on your business requirements.
10+
Out of the box, API, Admin, and Queue are separate codebases designed to complement each other — see the [Architecture Overview](../architecture.md) for how they fit together.
911

1012
A safe bet is to start with Dotkernel API and integrate it into your existing platform.
1113
The API can manage the access permissions to keep your data secure:
@@ -17,3 +19,20 @@ Later on you can add:
1719

1820
- Dotkernel Admin for its simple table-based approach, its reports and graphs.
1921
- Dotkernel Queue for its asynchronous task processing.
22+
23+
## FAQ
24+
25+
**Q: Should I start with Dotkernel API or Admin?**
26+
A: Starting with Dotkernel API is a safe bet since it can manage access permissions to keep your data secure.
27+
28+
**Q: How does Dotkernel API separate admin and regular users?**
29+
A: Admin-level users create and edit the data, while regular users read the data for your frontend.
30+
31+
**Q: What can I add to Dotkernel API later?**
32+
A: Dotkernel Admin for its table-based management, reports and graphs, and Dotkernel Queue for asynchronous task processing.
33+
34+
## See also
35+
36+
- [Dotkernel Admin: Usage](../admin/usage.md)
37+
- [Dotkernel Queue: Usage](../queue/usage.md)
38+
- [Architecture Overview](../architecture.md)

docs/book/v1/architecture.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Architecture Overview
2+
3+
## Summary
4+
5+
Ties together the four building blocks of the Dotkernel Headless Platform — API, Admin, Queue, and the Core submodule — and shows how they combine into a single platform.
6+
7+
## Details
8+
9+
The [Headless Platform](introduction.md) principle is to decouple the frontend from the backend services, so any number of outside systems can consume the same backend.
10+
Dotkernel implements this with four building blocks, each its own Git repository, which you combine based on your needs:
11+
12+
- **[Dotkernel API](api/introduction.md)** exposes your data to 3rd-party frontends or backends.
13+
- **[Dotkernel Admin](admin/introduction.md)** (optional) manages the data through a simple table-based UI, with built-in reports and graphs.
14+
- **[Dotkernel Queue](queue/introduction.md)** (optional) handles asynchronous task processing as its own microservice.
15+
- **[Core submodule](core/introduction.md)** is the shared codebase that any of the above applications can include, so they all manage database entities and services the same way.
16+
17+
You don't need every piece from the start.
18+
You can begin with [just Admin](admin/usage.md) or [just API](api/usage.md) and add the others later as requirements grow.
19+
Once you're running more than one application, pull the shared logic out into a [Core submodule](core/creation.md) and include it in each one — a typical setup looks like API + Core, Admin + Core, and Queue + Core, each in its own repository, all reading from the same shared entities and services (see [Using the Core Submodule](core/usage.md)).
20+
21+
Regardless of which pieces you use, every Dotkernel application and package boots the same way: through a [ConfigProvider](config-provider/introduction.md) that declares its dependencies, handlers, and configuration, merged together by the framework at [bootstrap time](config-provider/functionality.md).
22+
23+
## FAQ
24+
25+
**Q: What are the building blocks of the Dotkernel Headless Platform?**
26+
A: Dotkernel API, Dotkernel Admin, Dotkernel Queue, and the Core submodule.
27+
28+
**Q: Do I need all four components to get started?**
29+
A: No, you can start with just Admin or just API and add the others as your requirements grow.
30+
31+
**Q: How do multiple applications stay consistent with each other?**
32+
A: By sharing a Core submodule for entities and services, and by each bootstrapping through its own ConfigProvider.
Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
11
# Benefits
22

3+
## Summary
4+
5+
Lists the benefits of using a ConfigProvider, including centralized, modular, container-friendly, and testable configuration.
6+
7+
## Details
8+
39
- **Centralized setup** – Instead of hardcoding bootstrap code, you declare it in a config provider so it's easy to read, change, or extend.
410
- **Modular** – Each package can ship with its own config without interfering with others.
511
- **Container-friendly** – It works well with frameworks using DI containers like Laminas ServiceManager, PHP-DI, or Pimple.
6-
- **Standardized service definitions** - It has consistent rules for object creation that are separate from business logic.
7-
- **Environment-agnostic** - It returns an array that defines dev, test, or prod environments.
8-
- **Testability** - The consistent, central configuration promotes isolated (e.g. per-module) testing, easier swapping of dependencies and the assertion of pipeline setup (e.g. check if a config key is present).
12+
- **Standardized service definitions** It has consistent rules for object creation that are separate from business logic.
13+
- **Environment-agnostic** It returns an array that defines dev, test, or prod environments.
14+
- **Testability** The consistent, central configuration promotes isolated (e.g. per-module) testing, easier swapping of dependencies and the assertion of pipeline setup (e.g. check if a config key is present).
915

1016
> **Dotkernel ConfigProviders** have to be **added manually** in `config/config.php`, because all the initial ConfigProviders required to install the applications are already injected.
17+
18+
## FAQ
19+
20+
**Q: Why use a ConfigProvider instead of hardcoding bootstrap code?**
21+
A: It centralizes configuration so it's easy to read, change, or extend.
22+
23+
**Q: Does a ConfigProvider work with dependency injection containers?**
24+
A: Yes, it's container-friendly and works with DI containers like Laminas ServiceManager, PHP-DI, or Pimple.
25+
26+
**Q: Do I need to register Dotkernel ConfigProviders manually?**
27+
A: Yes, Dotkernel ConfigProviders must be added manually in `config/config.php`.
28+
29+
## See also
30+
31+
- [Introduction](introduction.md)
32+
- [How the ConfigProvider works](functionality.md)

docs/book/v1/config-provider/functionality.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# How the ConfigProvider works
22

3+
## Summary
4+
5+
Walks through how the ConfigProvider is picked up during bootstrap, merged, resolved, and executed within the Mezzio middleware pipeline.
6+
7+
## Details
8+
39
The ConfigProvider is automatically picked up by the framework during application bootstrap.
410
Let's look at it step by step:
511

@@ -20,4 +26,20 @@ $config = $container->get('config')['key'] ?? [];
2026

2127
Below you can see how Mezzio and Dotkernel merge and use ConfigProviders to build the middleware pipeline and dependencies.
2228

23-
![Headless Platform with Core Submodule](https://docs.dotkernel.org/img/headless-platform/ConfigProvider.png)
29+
![Diagram of Mezzio and Dotkernel merging ConfigProviders into the middleware pipeline](https://docs.dotkernel.org/img/headless-platform/ConfigProvider.png)
30+
31+
## FAQ
32+
33+
**Q: When is the ConfigProvider picked up?**
34+
A: Automatically, by the framework during application bootstrap.
35+
36+
**Q: What happens during the "Resolve item" step?**
37+
A: `$app->pipe()` resolves a service name from the container, wraps a middleware array, or calls a closure/invokable object.
38+
39+
**Q: Why does the error-handling middleware run last in the pipeline?**
40+
A: So it can catch any exceptions raised by the preceding middleware.
41+
42+
## See also
43+
44+
- [Introduction](introduction.md)
45+
- [Benefits](benefits.md)

docs/book/v1/config-provider/introduction.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Introduction
22

3+
## Summary
4+
5+
Introduces the `ConfigProvider` class, what it returns, and how it's used across Dotkernel applications and packages, with a code example.
6+
7+
## Details
8+
39
In PHP, the `ConfigProvider` is a class that is part of an application's bootstrap process.
410
It returns an array of configuration, settings, or anything else your application needs.
511
In Dotkernel, each application module and package contains a `ConfigProvider` that normally returns:
@@ -51,3 +57,20 @@ All Dotkernel applications and packages use ConfigProviders:
5157
- [Dotkernel Frontend](https://docs.dotkernel.org/frontend-documentation/)
5258
- [Dotkernel Light](https://docs.dotkernel.org/light-documentation/)
5359
- [Dotkernel Packages](https://docs.dotkernel.org/packages/)
60+
61+
## FAQ
62+
63+
**Q: What does a ConfigProvider return in Dotkernel?**
64+
A: Dependency injection mappings, request handlers, and template file paths.
65+
66+
**Q: Which Dotkernel applications use ConfigProviders?**
67+
A: Dotkernel API, Admin, Frontend, Light, and Packages all use ConfigProviders.
68+
69+
**Q: Is the Dotkernel ConfigProvider approach specific to Dotkernel?**
70+
A: No, it follows an approach similar to Laminas/Mezzio.
71+
72+
## See also
73+
74+
- [How the ConfigProvider works](functionality.md)
75+
- [Benefits](benefits.md)
76+
- [Glossary](../glossary.md)

docs/book/v1/core/benefits.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Benefits of the Core Submodule
22

3+
## Summary
4+
5+
Lists the benefits the Core submodule pattern provides as your platform grows, such as scalability and easier onboarding.
6+
7+
## Details
8+
39
This design pattern ensures:
410

511
- Design flexibility.
@@ -10,3 +16,19 @@ This design pattern ensures:
1016

1117
As your platform expands, each new application connects to the Dotkernel Headless Platform via the central API which services everything the other applications require.
1218
This ensures consistency throughout your platform, while allowing any number of outside connections as requirements arise.
19+
20+
## FAQ
21+
22+
**Q: How does the Core submodule pattern help as a platform grows?**
23+
A: It provides design flexibility and scalability suited for both enterprise and smaller applications.
24+
25+
**Q: Can multiple developers work on the platform using this pattern?**
26+
A: Yes, it allows splitting the work across multiple developers.
27+
28+
**Q: How do new applications connect to the platform?**
29+
A: Each new application connects via the central API, which services everything the other applications require.
30+
31+
## See also
32+
33+
- [Introduction](introduction.md)
34+
- [Using the Core Submodule](usage.md)

0 commit comments

Comments
 (0)