Skip to content

Commit e34be06

Browse files
authored
Merge pull request #4 from dotkernel/file-structure
added files for api, admin, core
2 parents 117be3b + 67ecf4d commit e34be06

File tree

14 files changed

+284
-0
lines changed

14 files changed

+284
-0
lines changed

docs/book/v1/admin/introduction.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Introduction
2+
3+
Dotkernel Admin is an application (skeleton) intended for quickly setting up an administration site for your platform.
4+
5+
Dotkernel Admin:
6+
7+
- Is a fast and reliable way to manage records in your database with a simple table-based approach
8+
- Allows you to monitor your platform via its built-in reports and graphs.
9+
- Contains many graphical components to ensure an intuitive user experience.
10+
- Has a PSR-Compliant Middleware Stack to promote a lean, modular architecture and create a common ground between components from various sources.
11+
- 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/).

docs/book/v1/admin/usage.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Usage
2+
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):
5+
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.
9+
10+
A safe bet is to start with Dotkernel API and integrate it into your existing platform.
11+
The API can manage the access permissions to keep your data secure:
12+
13+
- Admin-level users create and edit the data for your existing backend.
14+
- Regular users read the data for your frontend.
15+
16+
Later on you can add:
17+
18+
- Dotkernel Admin for its simple table-based approach, its reports and graphs.
19+
- Dotkernel Queue for its asynchronous task processing.

docs/book/v1/api/introduction.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Introduction
2+
3+
Dotkernel API is a REST API based on the Mezzio skeleton.
4+
The API is the root or the Dotkernel Headless Platform.
5+
6+
Dotkernel API:
7+
8+
- 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.
9+
- Has a PSR-Compliant Middleware Stack to promote a lean, modular architecture and create a common ground between components from various sources.
10+
- 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/).

docs/book/v1/api/usage.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Usage
2+
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):
5+
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.
9+
10+
A safe bet is to start with Dotkernel API and integrate it into your existing platform.
11+
The API can manage the access permissions to keep your data secure:
12+
13+
- Admin-level users create and edit the data for your existing backend.
14+
- Regular users read the data for your frontend.
15+
16+
Later on you can add:
17+
18+
- Dotkernel Admin for its simple table-based approach, its reports and graphs.
19+
- Dotkernel Queue for its asynchronous task processing.

docs/book/v1/core/benefits.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Benefits of the Core Submodule
2+
3+
This design pattern ensures:
4+
5+
- Design flexibility.
6+
- Scalability based on future requirements.
7+
- Consistent, enterprise-level growth, while also being suited for smaller applications.
8+
- The ability to split the work to multiple developers.
9+
- Easier bugfixes and onboarding.
10+
11+
As your platform expands, each new application connects to the Dotkernel Headless Platform via the central API which services everything the other applications require.
12+
This ensures consistency throughout your platform, while allowing any number of outside connections as requirements arise.

docs/book/v1/core/creation.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Creating a Core Submodule
2+
3+
The full steps for creating a submodule are described in [Git Tools – Submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules).
4+
5+
> There is already a Core module in some of the Dotkernel applications, but it works like any other module (App, Page, or User).
6+
> The Core modules are designed to be a starting point for the module’s transformation into a Git submodule.
7+
8+
First create a new Git repository that will contain the Core code.
9+
To create the submodule in an application, you need to have Git create the `.gitmodules` file in the root of the main repository by running the command below.
10+
Use the url from the new repository you just created instead of `<url>`:
11+
12+
```shell
13+
git submodule add <url>
14+
```
15+
16+
> You can have multiple submodules, but for this tutorial we will only create the Core submodule.
17+
18+
The `.gitmodules` file maps the submodules and its corresponding local directory within the main project (e.g. `src/Core`).
19+
This allows Git to manage the submodule correctly, from cloning, to updating, to tracking its changes.
20+
21+
> None of the Dotkernel applications have the .gitmodules file out of the box.
22+
> Only after isolating the Core into a Git submodule and pushing it to a separate Git repository does it become available to be included into any Dotkernel application.
23+
24+
From now on, any changes to the Core submodule must be commited from within the Core folder, like for any other Git repository, using these commands (simplified version, provided as an example):
25+
26+
```shell
27+
cd <path/to/submodule>
28+
git add .
29+
git commit -m "comment"
30+
git push
31+
```
32+
33+
Whenever you clone the project, you simply need to `init` and `update` the submodule with these commands:
34+
35+
```shell
36+
git submodule init
37+
git submodule update
38+
```
39+
40+
> Do not forget to delete the existing Core module before adding the submodule to other applications.

docs/book/v1/core/introduction.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Introduction
2+
3+
The Core submodule is a common codebase set up to be used by the Dotkernel applications you added to your project.
4+
The project setup may differ - e.g. two APIs, one Admin, 3 Frontends - but the Core submodule can be included in all of them.
5+
6+
By having a common module in your Dotkernel applications, you ensure that each of them uses entities and services in the same way.
7+
It helps to make service updates easier to sync in all the application in your platform.
8+
9+
General rules:
10+
11+
- The golden rule for the Core codebase is that it is the only place which manages the database entities.
12+
- As much as possible, all Doctrine entities must reside in Core.
13+
- The current location of the Core submodule is `src/Core`.

docs/book/v1/core/usage.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Using the Core Submodule
2+
3+
Once the shared Core submodule is separated and imported into each application, your platform can look like in the example below:
4+
5+
- API + Core
6+
- Admin + Core
7+
- Queue + Core
8+
9+
![Headless Platform with Core Submodule](https://docs.dotkernel.org/img/headless-platform/core-queue2.png)
10+
11+
> Each box in the image is a different Git repository.
12+
13+
Whenever work begins on a new feature or update, the devs should normally have the most recent Core in their development environment.
14+
In our example we have four code bases which will be kept in four separate repositories.
15+
16+
The Dotkernel applications include various entities to get you started quickly.
17+
This is not a complete list, but it should help you understand what each application is aimed toward, for example:
18+
19+
- The admin has admins, admin logins and settings entities.
20+
- The api has both users and admins, as well as authentication entities.
21+
22+
There are already shared entities which are identical, so the best place for them is within the Core submodule.
23+
Whenever you create new shared code, you should add it in the Core submodule and make sure to keep it updated in all your applications.
24+
25+
> This does not mean that all new code should be in Core, as there are plenty of instances when certain functionality is designed to only be used by only one application.

docs/book/v1/introduction.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
11
# Introduction
2+
3+
The principle of a Headless Platform is to decouple the User Interface (frontend) from the backend services.
4+
The responses from the platform are then used by another system, such as a website or mobile app.
5+
6+
![Headless Platform](https://docs.dotkernel.org/img/headless-platform/api-comms4.png)
7+
8+
Its design leads to a great deal of versatility in the setup and configuration.
9+
Here are some of the advantages of the Headless Platform:
10+
11+
- The ability to have multiple frontends, each targeted to various end-users, like desktop vs mobile, iOS vs Android etc.
12+
- Different frontends (websites) for various niches (younger vs older users) and countries (including localization).
13+
- Ability to customise separate frontends in terms of design, as well as available features.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Full Rewrite or Big Bang Rewrite
2+
3+
A full rewrite is a software migration strategy that implies completely rebuilding the system from scratch in the new architecture or technology.
4+
5+
## How It Works
6+
7+
- You keep the old application in use, as-is.
8+
- In parallel, you work with the development team to build a new version of the application in the target environment.
9+
- Once the new application is complete and tested, you redirect all execution to the new application.
10+
- You decommission the old application.
11+
12+
## Pluses
13+
14+
There are several advantages to this approach:
15+
16+
- Blank slate – No technical debt is carried over to the new application.
17+
- Optimal architecture – You can code the new application without worrying about legacy code or outdated design patterns.
18+
- Better maintainability and security – The new code can follow modern best practices which may be incompatible with the old code.
19+
20+
## Minuses
21+
22+
The disadvantages often weigh heavy against choosing this approach:
23+
24+
- High risk – Your release must work on the first try, there’s no partial rollback.
25+
- Long timeline – There is no immediate user value during development.
26+
- Expensive – Building a second product in parallel may prove to be just as costly as the original product.
27+
- Feature drift – Since the old application is still running, any updates performed on it may cause further delay on the development of the new one and greater mismatching of business logic.
28+
29+
## Conclusion
30+
31+
Performing a full rewrite is no easy choice.
32+
More often than not, the costs are the main reason you would not choose this migration strategy.
33+
You may find yourself delaying its implementation until you are forced to do so by circumstance.

0 commit comments

Comments
 (0)