|
6 | 6 |
|
7 | 7 | PSFS is a lightweight PHP framework for MVC/API applications (Twig + Propel + Symfony components). |
8 | 8 |
|
9 | | -## Runtime baseline |
| 9 | +## 5-minute setup |
10 | 10 |
|
11 | | -- Execution and validation use Docker Compose. |
12 | | -- Target PHP runtime: **8.3**. |
13 | | -- Main services: `php`, `redis`, `db`. |
14 | | -- Host port is configured via `.env` (`HOST_PORT=8008` by default). |
| 11 | +Prerequisites: |
15 | 12 |
|
16 | | -## Quick start |
| 13 | +- Docker + Docker Compose |
| 14 | +- Git |
17 | 15 |
|
| 16 | +<!-- validated --> |
18 | 17 | ```bash |
19 | 18 | docker compose up -d |
20 | 19 | docker compose ps |
21 | | -``` |
22 | | - |
23 | | -Run project commands inside the PHP container: |
24 | | - |
25 | | -```bash |
26 | 20 | docker exec core-php-1 php -v |
27 | | -docker exec core-php-1 composer install |
28 | | -docker exec core-php-1 php vendor/bin/phpunit --no-coverage |
| 21 | +docker exec core-php-1 composer install --no-interaction --prefer-dist |
29 | 22 | ``` |
30 | 23 |
|
31 | | -If your PHP container name differs: |
| 24 | +If your PHP container name is not `core-php-1`: |
32 | 25 |
|
| 26 | +<!-- validated --> |
33 | 27 | ```bash |
34 | 28 | docker compose ps |
35 | 29 | docker ps --format '{{.Names}}' |
36 | 30 | ``` |
37 | 31 |
|
38 | | -## Swoole runtime |
39 | | - |
40 | | -Check and run Swoole commands through `src/bin/psfs`: |
| 32 | +## Daily command map |
41 | 33 |
|
| 34 | +<!-- example-only --> |
42 | 35 | ```bash |
43 | | -docker exec core-php-1 php /var/www/src/bin/psfs psfs:swoole:check |
44 | | -docker exec core-php-1 php /var/www/src/bin/psfs psfs:swoole:start --host=0.0.0.0 --port=8080 |
45 | | -docker exec core-php-1 php /var/www/src/bin/psfs psfs:swoole:status |
46 | | -docker exec core-php-1 php /var/www/src/bin/psfs psfs:swoole:reload |
47 | | -docker exec core-php-1 php /var/www/src/bin/psfs psfs:swoole:stop |
48 | | -``` |
| 36 | +# Run key tests |
| 37 | +docker exec core-php-1 php vendor/bin/phpunit --no-coverage --filter '/(AuthApiTest|RequestResponseSecurityContractTest)/' |
49 | 38 |
|
50 | | -Optional compose profile: |
| 39 | +# List PSFS CLI commands |
| 40 | +docker exec core-php-1 php src/bin/psfs list |
51 | 41 |
|
52 | | -```bash |
53 | | -docker compose --profile swoole up -d php-swoole |
54 | | -docker compose --profile swoole ps |
| 42 | +# Security local pre-check (act) |
| 43 | +act push --container-architecture linux/amd64 |
55 | 44 | ``` |
56 | 45 |
|
57 | | -## Security baseline (v2) |
| 46 | +## Choose your path |
58 | 47 |
|
59 | | -- Auth/cookies are versioned as `v2`. |
60 | | -- Legacy fallback remains read-only until explicit removal approval. |
61 | | -- Invalid auth must result in `null/null` and stop request flow. |
62 | | -- Cookie policy target: |
63 | | - - `HttpOnly=true` |
64 | | - - `Secure=true` on HTTPS |
65 | | - - `SameSite=Lax|Strict` |
66 | | - - `Path=/` |
67 | | - - coherent `Domain` |
68 | | - - TTL aligned with session/auth policy |
| 48 | +### Onboarding path |
69 | 49 |
|
70 | | -## CI/CD security gates |
| 50 | +1. Read [Operations Playbook](./doc/OPERATIONS.md) |
| 51 | +2. Execute the "First day" flow |
| 52 | +3. Use troubleshooting matrix when blocked |
71 | 53 |
|
72 | | -Security pipeline blocks merge/release when: |
| 54 | +### Core contributor path |
73 | 55 |
|
74 | | -- a `must_pass` security control test fails, |
75 | | -- any high/critical finding is unresolved, |
76 | | -- hardening or quality gate returns non-pass. |
| 56 | +1. Read [Core Contracts](./doc/CONTRACTS.md) |
| 57 | +2. Read [Async Jobs and Connectors Contracts](./doc/contracts/async-jobs-connectors-contracts.md) |
| 58 | +3. Read [Security Plan and Artifacts](./doc/security/PLAN.md) |
77 | 59 |
|
78 | | -Local pre-check: |
| 60 | +## Propel models and migrations |
79 | 61 |
|
80 | | -```bash |
81 | | -act push --container-architecture linux/amd64 |
82 | | -``` |
| 62 | +For operational Propel flow (schema, model generation context, migration execution, rollback, failure modes), see: |
| 63 | + |
| 64 | +- [Propel Workflow](./doc/PROPEL_WORKFLOW.md) |
| 65 | + |
| 66 | +## Documentation quality gate |
83 | 67 |
|
84 | | -## Install as dependency |
| 68 | +Use the docs checker before opening PRs that touch docs: |
85 | 69 |
|
| 70 | +<!-- validated --> |
86 | 71 | ```bash |
87 | | -composer require psfs/core |
88 | | -./vendor/bin/psfs psfs:create:root |
| 72 | +bash scripts/docs/validate_docs.sh |
89 | 73 | ``` |
90 | 74 |
|
91 | | -## Documentation |
| 75 | +## Documentation index |
92 | 76 |
|
93 | | -- [Contracts](./doc/CONTRACTS.md) |
94 | | -- [Versioning policy](./doc/VERSIONING.md) |
95 | | -- [Async jobs and connectors contracts](./doc/contracts/async-jobs-connectors-contracts.md) |
| 77 | +- [Operations Playbook](./doc/OPERATIONS.md) |
| 78 | +- [Propel Workflow](./doc/PROPEL_WORKFLOW.md) |
| 79 | +- [Core Contracts](./doc/CONTRACTS.md) |
| 80 | +- [Versioning](./doc/VERSIONING.md) |
| 81 | +- [Async Jobs and Connectors Contracts](./doc/contracts/async-jobs-connectors-contracts.md) |
96 | 82 |
|
97 | | -## Notes |
| 83 | +## Rules |
98 | 84 |
|
99 | | -- Do not run `php`, `composer`, or `phpunit` directly on host for project validation. |
100 | | -- Human review is required before committing automated/agent-driven changes. |
| 85 | +- Run project commands inside Docker containers. |
| 86 | +- Keep command blocks explicitly tagged as `validated` or `example-only`. |
0 commit comments