Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
57 changes: 57 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
APP_NAME=ModusBuild
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=https://modusbuild.local

LOG_CHANNEL=stack
LOG_LEVEL=debug

DB_CONNECTION=pgsql
DB_HOST=postgres
DB_PORT=5432
DB_DATABASE=modusbuild
DB_USERNAME=modusbuild
DB_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=redis
FILESYSTEM_DISK=s3
QUEUE_CONNECTION=redis
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=localkey
AWS_SECRET_ACCESS_KEY=localsecret
AWS_DEFAULT_REGION=eu-central-1
AWS_BUCKET=modusbuild-dev

SANCTUM_STATEFUL_DOMAINS=modusbuild.local
SESSION_DOMAIN=modusbuild.local

FEATURE_RLS=false
FEATURE_IFC_PREVIEW=false

SIGNING_SECRET=change-me
MAX_UPLOAD_MB=250

CLAMAV_HOST=clamav
CLAMAV_PORT=3310

SENTRY_LARAVEL_DSN=null

23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/vendor/
/node_modules/
/public/hot
/public/storage
/storage/*.key
/storage/app/public
/storage/debugbar
/.phpunit.result.cache
/.php-cs-fixer.cache
.env
.env.*
!.env.example
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.idea/
.vscode/
.phpunit.cache
package-lock.json
pnpm-lock.yaml
yarn.lock
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
SHELL := /bin/bash

up:
docker compose up -d
docker compose exec app composer install || true

stop:
docker compose down

logs:
docker compose logs -f app

pint:
docker compose exec app ./vendor/bin/pint || true

phpstan:
docker compose exec app ./vendor/bin/phpstan analyse || true

test:
docker compose exec app ./vendor/bin/pest || true

67 changes: 66 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,66 @@
# ModusBuild.dk
# ModusBuild

Monolitten for ModusBuilds MVP er bygget på Laravel 11 med Vue/Inertia frontend-opsætning. Denne repo indeholder både tekniske RFC'er og det faktiske applikationskodegrundlag.

## Hurtig start

1. Kopiér `.env.example` til `.env` og opdater eventuelle hemmeligheder.
2. Start udviklingsmiljøet:

```bash
make up
```

Første kørsel forsøger at installere Composer-afhængigheder inde i containeren. I miljøer uden netværksadgang skal installationen køres lokalt på en maskine med adgang og artefakterne mountes ind i containeren.

3. Installer Node-afhængigheder og start Vite-dev serveren til frontend:

```bash
npm install
npm run dev
```

Mangler der netværksadgang, kan pakker installeres på en ekstern maskine og kopieres ind via bind mounts.

4. Besøg `http://localhost:8080` for Laravel-app'en og `http://localhost:5173` for Vite dev server proxy.

## Kvalitetssikring

- `make pint` – kører Laravel Pint kodeformattering.
- `make phpstan` – kører Larastan statisk analyse.
- `make test` – kører Pest test-suiten.

## Dokumentation

- [RFC-001: ModusBuild – MVP teknisk specifikation (Draft)](docs/rfcs/RFC-001-modusbuild-mvp.md)

## Håndtering af GitHub-konflikter

Hvis GitHub viser en besked om konflikter, når du forsøger at merge en pull request, kan du løse dem lokalt med følgende fremgangsmåde:

1. Sørg for, at din lokale `main` (eller den branch, du vil merge ind i) er opdateret:
```bash
git checkout main
git fetch origin
git pull origin main
```
2. Skift tilbage til din feature-branch (f.eks. `work`) og merge de seneste ændringer fra `main` ind:
```bash
git checkout work
git merge origin/main
```
Git markerer nu de filer, der er i konflikt (fx `Makefile`, `composer.json`, `routes/web.php`).
3. Åbn hver konfliktfil i din editor og fjern konfliktmarkeringerne (`<<<<<<<`, `=======`, `>>>>>>>`) ved at vælge, kombinere eller omskrive indholdet, så det afspejler den ønskede endelige version.
4. Når alle konflikter er løst, stage filerne og fuldfør mergingen:
```bash
git add Makefile bootstrap/cache/.gitignore composer.json config/database.php routes/web.php storage/.gitignore
git commit
```
Hvis merge-committen allerede blev oprettet automatisk, kan du nøjes med `git commit` for at afslutte den.
5. Afslut ved at pushe den opdaterede branch til GitHub:
```bash
git push origin work
```
6. Gå tilbage til pull requesten på GitHub og verificér, at konflikten er væk. Herefter kan du fortsætte med review og merge.

> Tip: Hvis du foretrækker rebase-fremgangsmåden, kan du erstatte trin 2 med `git rebase origin/main` og afslutte eventuelle konflikter trin for trin. Husk at pushe med `--force-with-lease`, hvis du rebaser.
27 changes: 27 additions & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*/
protected function schedule(Schedule $schedule): void
{
// $schedule->command('inspire')->hourly();
}

/**
* Register the commands for the application.
*/
protected function commands(): void
{
$this->load(__DIR__.'/Commands');

require base_path('routes/console.php');
}
}
20 changes: 20 additions & 0 deletions app/Domain/CDE/Document.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace App\Domain\CDE;

class Document
{
public function __construct(
public string $id,
public string $projectId,
public string $code,
public string $title,
public ?string $discipline,
public ?string $phaseCode,
public array $classification = [],
public string $status = 'draft',
public ?string $currentVersionId = null,
public int $lockedVersion = 0
) {
}
}
20 changes: 20 additions & 0 deletions app/Domain/CDE/DocumentVersion.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace App\Domain\CDE;

class DocumentVersion
{
public function __construct(
public string $id,
public string $documentId,
public string $revision = 'A',
public string $version = '1.0',
public string $storageKey,
public ?string $checksum,
public ?int $size,
public ?string $mime,
public ?\DateTimeImmutable $approvedAt = null,
public ?string $approvedBy = null
) {
}
}
16 changes: 16 additions & 0 deletions app/Domain/CDE/Transmittal.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace App\Domain\CDE;

class Transmittal
{
public function __construct(
public string $id,
public string $projectId,
public string $number,
public array $recipients = [],
public ?\DateTimeImmutable $sentAt = null,
public array $receiptLog = []
) {
}
}
14 changes: 14 additions & 0 deletions app/Domain/CDE/Workflow.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace App\Domain\CDE;

class Workflow
{
public function __construct(
public string $id,
public string $projectId,
public string $name,
public array $steps = []
) {
}
}
18 changes: 18 additions & 0 deletions app/Domain/Core/Organization.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace App\Domain\Core;

class Organization
{
/**
* @param array<int, string> $projectCodes
*/
public function __construct(
public string $id,
public string $tenantId,
public string $name,
public string $slug,
public array $projectCodes = []
) {
}
}
20 changes: 20 additions & 0 deletions app/Domain/Core/Tenant.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace App\Domain\Core;

use Illuminate\Support\Str;

class Tenant
{
public function __construct(
public string $id,
public string $name,
public string $planId,
) {
}

public static function create(string $name, string $planId): self
{
return new self(Str::uuid()->toString(), $name, $planId);
}
}
17 changes: 17 additions & 0 deletions app/Domain/Infrastructure/AuditLog.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace App\Domain\Infrastructure;

class AuditLog
{
public function __construct(
public int $id,
public string $actorId,
public string $action,
public string $targetType,
public string $targetId,
public \DateTimeImmutable $timestamp,
public array $meta = []
) {
}
}
15 changes: 15 additions & 0 deletions app/Domain/Infrastructure/OutboxEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace App\Domain\Infrastructure;

class OutboxEvent
{
public function __construct(
public int $id,
public string $eventType,
public array $payload,
public string $dedupeKey,
public ?\DateTimeImmutable $publishedAt = null
) {
}
}
15 changes: 15 additions & 0 deletions app/Domain/Process/ExternalApproval.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace App\Domain\Process;

class ExternalApproval
{
public function __construct(
public string $id,
public string $phaseId,
public array $approver = [],
public ?\DateTimeImmutable $approvedAt = null,
public ?string $tokenHash = null
) {
}
}
17 changes: 17 additions & 0 deletions app/Domain/Process/Gate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace App\Domain\Process;

class Gate
{
public function __construct(
public string $id,
public string $projectId,
public string $phaseId,
public string $status = 'open',
public ?string $decidedBy = null,
public ?\DateTimeImmutable $decidedAt = null,
public ?string $reason = null
) {
}
}
Loading