Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
priyadi committed Sep 21, 2023
0 parents commit 5992202
Show file tree
Hide file tree
Showing 40 changed files with 15,969 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
\?

# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

43 changes: 43 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
PLANTUML=docker run --rm --user $$(id -u):$$(id -g) -v ./:/data/ plantuml/plantuml
# PLANTUML=java -jar ~/Downloads/plantuml-1.2023.11.jar

WSD=$(wildcard diagrams/*.wsd)
LIGHTSVG=$(patsubst diagrams/%.wsd, static/diagrams/light/%.svg, $(WSD))
DARKSVG=$(patsubst diagrams/%.wsd, static/diagrams/dark/%.svg, $(WSD))
LIGHTPNG=$(patsubst diagrams/%.wsd, static/diagrams/light/%.png, $(WSD))
DARKPNG=$(patsubst diagrams/%.wsd, static/diagrams/dark/%.png, $(WSD))

all: svg

.PHONY: svg
svg: $(LIGHTSVG) $(DARKSVG)

.PHONY: png
png: $(LIGHTPNG) $(DARKPNG)

.PHONY: start
start:
npx docusaurus start

.PHONY: clean
clean:
npx docusaurus clear
rm -f static/diagrams/light/*.svg
rm -f static/diagrams/dark/*.svg
rm -rf \?

.PHONY: static/diagrams/light/%.svg
static/diagrams/light/%.svg: diagrams/%.wsd
$(PLANTUML) -tsvg -SbackgroundColor=transparent $< -o ../static/diagrams/light/

.PHONY: static/diagrams/dark/%.svg
static/diagrams/dark/%.svg: diagrams/%.wsd
$(PLANTUML) -tsvg -darkmode -SbackgroundColor=transparent $< -o ../static/diagrams/dark/

.PHONY: static/diagrams/light/%.png
static/diagrams/light/%.png: diagrams/%.wsd
$(PLANTUML) -tpng -SbackgroundColor=transparent $< -o ../static/diagrams/light/

.PHONY: static/diagrams/dark/%.png
static/diagrams/dark/%.png: diagrams/%.wsd
$(PLANTUML) -tpng -darkmode -SbackgroundColor=transparent $< -o ../static/diagrams/dark/
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
69 changes: 69 additions & 0 deletions diagrams/file.wsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
@startuml file
interface FileRepository {
+get(FilePointer): File
+tryGet(FilePointer): ?File
+clear(): void
+createFromString(FilePointer, string)
+createFromStream(FilePointer, resource|Stream)
+createFromLocalFile(FilePointer, string)
+delete(FilePointer): void
+copy(File|FilePointer, File|FilePointer): File
+move(File|FilePointer, File|FilePointer): File
+createTemporaryFile()
}

interface FilePointer {
filesystemIdentifier: string
key: string
+isEqualTo(File|FilePointer): bool
+isSameFilesystem(File|FilePointer): bool
}

FileRepository o--- File
FilePointer --* File::pointer
FilePointer -- File

interface File {
+filesystemIdentifier: ?string
+key: string
+pointer: FilePointer
+isEqualTo(File|FilePointer): bool
+isSameFilesystem(File|FilePointer): bool
+name: FileName
+setName(string): void
+setContent(string): void
+setContentFromStream(resource|Stream): void
+content: string
+contentAsStream: Stream
+saveToLocalFile(string): SplFileInfo
+createLocalTemporaryFile(): SplFileInfo
+mediaType: MediaType
+setMediaType(string): void
+size: int
+lastModified: DateTime
+getDerivation(string): FilePointer
+get(string): mixed
}

File::name *-- FileName
File::mediaType *-- FileType

interface FileName {
+full: string|Translatable
+setFull(string): void
+base: string|Translatable
+setBase(string): void
+extension: string
+setExtension(string): void
+hasExtension(): bool
}

interface FileType {
+name: string
+type: string
+subType: string
+commonExtensions: array
+extension: ?string
+description: string|Translatable
}
@enduml
8 changes: 8 additions & 0 deletions docs/00-index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
slug: /
title: Intro
---

<!-- import DocCardList from '@theme/DocCardList';
<DocCardList /> -->
87 changes: 87 additions & 0 deletions docs/direct-property-access/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
title: rekalogika/direct-property-access
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Simple and limited implementation of Symfony's `PropertyAccessorInterface` that
reads and writes directly to the object's properties, bypassing getters and
setters.

Installation
------------

Make sure Composer is installed globally, as explained in the
[installation chapter](https://getcomposer.org/doc/00-intro.md)
of the Composer documentation.

<Tabs>
<TabItem value="flex" label="With Symfony Flex">

Open a command console, enter your project directory and execute:

```bash
composer require rekalogika/direct-property-access
```
</TabItem>

<TabItem value="noflex" label="Without Symfony Flex">

### Step 1: Download the Bundle

Open a command console, enter your project directory and execute the
following command to download the latest stable version of this bundle:

```bash
composer require rekalogika/direct-property-access
```

### Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles
in the `config/bundles.php` file of your project:

```php title=config/bundles.php
return [
// ...
Rekalogika\DirectPropertyAccess\RekalogikaDirectPropertyAccessBundle::class => ['all' => true],
];
```
</TabItem>

<TabItem value="nonsymfony" label="Non-Symfony Projects">

Open a command console, enter your project directory and execute:

```bash
composer require rekalogika/direct-property-access
```
</TabItem>
</Tabs>

Usage
-----

In Symfony projects, you can autowire `DirectPropertyAccessor`. In other
projects, you can simply instantiate it.

Read [Symfony's PropertyAccess
documentation](https://symfony.com/doc/current/components/property_access.html)
for more information on how to use it. The difference is that
`DirectPropertyAccessor` does not call any of the object's methods, but reads
and writes directly to the object's properties, even if they are private.

Caveats
-------

Currently does not support arrays and paths beyond one level deep.

Credits
-------

This project took inspiration from the following projects.

* [Symfony Property Access](https://github.com/symfony/property-access)
* [kwn/reflection-property-access](https://github.com/kwn/reflection-property-access)
* [nelmio/alice](https://github.com/nelmio/alice/blob/master/src/PropertyAccess/ReflectionPropertyAccessor.php)
76 changes: 76 additions & 0 deletions docs/domain-event/00-intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
title: Introduction & Installation
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

An implementation of [domain event pattern](https://learn.microsoft.com/en-us/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/domain-events-design-implementation)
for Symfony & Doctrine.

## Features

* Works out of the box. No configuration is required.
* Simple, unopinionated architecture. Uses plain event objects, and doesn't
require much from your domain entities.
* Uses standard Symfony's event dispatcher, with the same dispatching semantics
& listener registrations.
* Three dispatching strategies: pre-flush, post-flush, and immediate.
* In pre-flush or post-flush modes, multiple events considered identical are
dispatched only once.
* Does not require you to change how you work with entities, most of the time.
* Should work everywhere without any change: in controllers, message handlers,
command line, etc.
* Separated contracts & framework. Useful for enforcing architectural
boundaries. Your domain doesn't have to depend on the framework.

## Installation

Make sure Composer is installed globally, as explained in the
[installation chapter](https://getcomposer.org/doc/00-intro.md)
of the Composer documentation.

<Tabs>
<TabItem value="flex" label="With Symfony Flex">

Open a command console, enter your project directory and execute:

```bash
composer require rekalogika/domain-event
```
</TabItem>

<TabItem value="noflex" label="Without Symfony Flex">

### Step 1: Download the Bundle

Open a command console, enter your project directory and execute the
following command to download the latest stable version of this bundle:

```bash
composer require rekalogika/domain-event
```

### Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles
in the `config/bundles.php` file of your project:

```php title=config/bundles.php
return [
// ...
Rekalogika\DomainEvent\RekalogikaDomainEventBundle::class => ['all' => true],
];
```
</TabItem>
</Tabs>

## License

MIT

## Contributing

This framework consists of multiple repositories splitted from a monorepo. Be
sure to submit issues and pull request to the
[`rekalogika/domain-event-src`](https://github.com/rekalogika/domain-event-src) monorepo.
Loading

0 comments on commit 5992202

Please sign in to comment.