Commit graph

14 commits

Author SHA1 Message Date
yisroel
533320fcac
add User entity, dto, repository interface
User holds email (EmailAddress vo), passwordHash, isAdmin - tide
keeps password and admin flag on the user row directly (no
separate profile entity like youngstartup). UserRepository
exposes find, findByEmail, create. CreateUserDto is readonly with
explicit isAdmin (per shared.md no-default-args rule).
2026-05-06 15:00:49 +03:00
Yisroel Baum
f47ea1c73d
merge harden-devshell
hot-fix: pgdata anchored to repo root, .postgres/.direnv ignored
at any nesting. resolves stray backend/.postgres tracking caught
during phase 1 merge.
2026-05-06 14:58:44 +03:00
yisroel
ee1b30d0ec
harden devshell: anchor pgdata to repo root, broaden gitignore
shellHook now derives PGDATA from $(git rev-parse --show-toplevel)
instead of $PWD. nix develop / direnv from a subdir (e.g.
backend/) used to seed a duplicate cluster at backend/.postgres
that leaked into git tracking. .gitignore loses its leading slash
on .postgres/ + .direnv/ + .pc.* so any nested cluster also gets
ignored. fallback to pwd preserves behavior outside a git repo.

968 stray backend/.postgres/* blobs already pruned from history
via git-filter-repo before this commit.
2026-05-06 14:58:27 +03:00
Yisroel Baum
0178654535 merge backend-skeleton
phase 1: laravel 12 + ddd tooling + base scaffolding
(exceptions, EmailAddress vo, dev tooling aligned with
youngstartup conventions).
2026-05-06 14:55:27 +03:00
yisroel
4f6ac876ce implement EmailAddress value object
immutable readonly. trims whitespace, splits on @, lowercases the
domain (local-part case preserved per RFC 5321), validates with
FILTER_VALIDATE_EMAIL after normalization. throws
InvalidArgumentException on empty / missing-@ / malformed input.
exposes value(), getDomain(), equals(), __toString(). all 7
EmailAddressTest cases green; 9 tests total pass.
2026-05-06 14:52:45 +03:00
yisroel
f862348a31 test EmailAddress value object
7 cases: rejects spaces, double-@, empty input; trims whitespace;
lowercases domain only (preserving local-part case); equality by
normalized value; __toString and getDomain. fails red - class
App\\Shared\\ValueObject\\EmailAddress not yet defined.
2026-05-06 14:52:14 +03:00
yisroel
fb5f8d4f02 add domain exception classes
BadRequestException, UnauthorizedException, ForbiddenException -
all extend DomainException. use cases throw these to signal HTTP
4xx categories; controllers translate to JsonResponse status
codes (400, 401, 403).
2026-05-06 14:51:41 +03:00
yisroel
c2ba02cc6f drop laravel scaffold defaults
removed app/Models/User.php (laravel auth model - tide authors a
ddd User entity in app/User/), app/Http/Controllers/Controller.php
(controllers live flat in app/Controllers/ per youngstartup), and
all three 0001_01_01_* migrations (default users schema, cache,
jobs - tide writes its own users migration with is_admin and
password_hash). routes/api.php stripped of the sanctum-bound
/user demo route - left as an empty stub for incoming domains.
2026-05-06 14:51:21 +03:00
yisroel
d58bc9036d align dev tooling with youngstartup conventions
require-dev: phpstan ^2.1 + strict rules, larastan ^3, php-cs-fixer
^3.91 + jubeki/laravel-code-style ^2.18, ide-helper ^3.7. add
phpstan.neon (level max, app/ scope) and .php-cs-fixer.dist.php
(jubeki preset, modifier_keywords rule). phpunit.xml mirrors
youngstartup (sqlite :memory:, bcrypt rounds 4, enforceTimeLimit).
gitignore picks up _ide_helper.php, *~, .php-cs-fixer.cache. drop
sail's phpactor.json line. composer scripts: drop npm bits from
setup/dev (frontend lives separately). composer test + stan +
cs:check all green on default scaffold.
2026-05-06 14:49:27 +03:00
yisroel
ffd102a1cc drop inline laravel frontend assets
frontend lives separately at frontend/blog_portal (vue 3 spa).
removed backend/{vite.config.js,package.json,resources/css,
resources/js}.
2026-05-06 14:47:31 +03:00
yisroel
c03ffc8941 scaffold laravel 12 backend
composer create-project laravel/laravel + artisan install:api.
sanctum removed (custom session-cookie auth per ai/backend-context).
personal_access_tokens migration + config/sanctum.php deleted.
default .gitignore excludes vendor/, .env, etc - composer install
recreates vendor at setup time.
2026-05-06 14:46:41 +03:00
Yisroel Baum
5425df0eae merge nix-devshell
phase 0: nix flake devshell + process-compose orchestrator.
2026-05-06 14:44:13 +03:00
yisroel
d1df7a6a42 add nix flake devshell and process-compose
mirrors youngstartup setup. flake provides php 8.4, composer,
nodejs, postgresql, cypress, typescript, process-compose. shellHook
seeds a per-repo postgres cluster at .postgres/. process-compose
orchestrates postgres + backend (laravel) + vite (vue spa) for
local dev. .envrc auto-loads the flake via direnv. mailpit and
gitlab-ci-local omitted - not needed for tide blogging app.
2026-05-06 14:38:29 +03:00
yisroel
91cc08614d init: agent context files 2026-05-06 14:37:39 +03:00