Skip to content

Commit a049670

Browse files
committed
Revise README for quick install and project generation flow
1 parent 7d05fdf commit a049670

6 files changed

Lines changed: 526 additions & 42 deletions

File tree

README.md

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,72 +11,74 @@
1111

1212
PSFS is a lightweight PHP framework for MVC/API applications (Twig + Propel + Symfony components).
1313

14-
## 5-minute setup
14+
## Quick Install (Copy/Paste)
1515

16-
Prerequisites:
16+
Requirements:
17+
- `bash`
18+
- `docker compose` or `php + composer`
1719

18-
- Docker + Docker Compose
19-
- Git
20+
Using `curl`:
2021

21-
<!-- validated -->
2222
```bash
23-
docker compose up -d
24-
docker compose ps
25-
docker exec core-php-1 php -v
26-
docker exec core-php-1 composer install --no-interaction --prefer-dist
23+
curl -fsSL https://raw.githubusercontent.com/psfs/core/master/install.sh | bash
2724
```
2825

29-
If your PHP container name is not `core-php-1`:
26+
Using `wget`:
3027

31-
<!-- validated -->
3228
```bash
33-
docker compose ps
34-
docker ps --format '{{.Names}}'
29+
wget -qO- https://raw.githubusercontent.com/psfs/core/master/install.sh | bash
3530
```
3631

37-
## Daily command map
32+
The installer downloads and runs the official PSFS project generator.
3833

39-
<!-- example-only -->
40-
```bash
41-
# Run key tests
42-
docker exec core-php-1 php vendor/bin/phpunit --no-coverage --filter '/(AuthApiTest|RequestResponseSecurityContractTest)/'
34+
## Create a Project
4335

44-
# List PSFS CLI commands
45-
docker exec core-php-1 php src/bin/psfs list
36+
Interactive:
4637

47-
# Security local pre-check (act)
48-
act push --container-architecture linux/amd64
38+
```bash
39+
./scripts/create-psfs-project.sh
4940
```
5041

51-
## Choose your path
52-
53-
### Onboarding path
42+
Non-interactive:
5443

55-
1. Read [Operations Playbook](./doc/OPERATIONS.md)
56-
2. Read [DTO Validation Engine](./doc/DTO_VALIDATION.md)
57-
3. Execute the "First day" flow
58-
4. Use troubleshooting matrix when blocked
59-
60-
### Core contributor path
44+
```bash
45+
./scripts/create-psfs-project.sh \
46+
--non-interactive \
47+
--name my-psfs-app \
48+
--path /tmp/my-psfs-app \
49+
--runtime docker \
50+
--package acme/my-psfs-app \
51+
--description "My PSFS app" \
52+
--author "Your Name"
53+
```
6154

62-
1. Read [Operations Playbook](./doc/OPERATIONS.md)
63-
2. Read [DTO Validation Engine](./doc/DTO_VALIDATION.md)
64-
3. Read [Propel Workflow](./doc/PROPEL_WORKFLOW.md)
65-
4. Run key tests and validate changes in Docker
55+
Remote install with flags:
6656

67-
## Propel models and migrations
57+
```bash
58+
curl -fsSL https://raw.githubusercontent.com/psfs/core/master/install.sh | bash -s -- \
59+
--non-interactive \
60+
--name my-psfs-app \
61+
--runtime docker \
62+
--package acme/my-psfs-app
63+
```
6864

69-
For operational Propel flow (schema, model generation context, migration execution, rollback, failure modes), see:
65+
## What the Generator Does
7066

71-
- [Propel Workflow](./doc/PROPEL_WORKFLOW.md)
67+
- Detects `local` runtime (`php` + `composer`) and `docker` runtime (`docker compose`).
68+
- If both are available in interactive mode, prompts for runtime selection.
69+
- Generates PSFS base structure (`config`, `html`, `modules`, `cache`, `logs`, `locale`).
70+
- Generates initial `composer.json`.
71+
- For Docker runtime, generates `docker-compose.yml`, `docker/php.ini`, and `.env.example`.
72+
- Does not auto-run dependency install or container startup.
7273

73-
## Documentation index
74+
## Documentation
7475

7576
- [Operations Playbook](./doc/OPERATIONS.md)
7677
- [DTO Validation Engine](./doc/DTO_VALIDATION.md)
7778
- [Propel Workflow](./doc/PROPEL_WORKFLOW.md)
79+
- [Core Contracts](./doc/CONTRACTS.md)
7880

79-
## Rules
81+
## Notes
8082

81-
- Run project commands inside Docker containers.
82-
- Keep command blocks explicitly tagged as `validated` or `example-only`.
83+
- Runtime baseline for this repository is Docker Compose with PHP 8.3.
84+
- For project internals and contributor workflows, use the docs listed above.

install.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
REPO_RAW_BASE="${REPO_RAW_BASE:-https://raw.githubusercontent.com/psfs/core/master}"
5+
GENERATOR_PATH="${GENERATOR_PATH:-scripts/create-psfs-project.sh}"
6+
GENERATOR_URL="${REPO_RAW_BASE}/${GENERATOR_PATH}"
7+
8+
tmp_file="$(mktemp -t psfs-generator.XXXXXX.sh)"
9+
cleanup() {
10+
rm -f "${tmp_file}"
11+
}
12+
trap cleanup EXIT
13+
14+
download_with_curl() {
15+
curl -fsSL "${GENERATOR_URL}" -o "${tmp_file}"
16+
}
17+
18+
download_with_wget() {
19+
wget -qO "${tmp_file}" "${GENERATOR_URL}"
20+
}
21+
22+
if command -v curl >/dev/null 2>&1; then
23+
download_with_curl
24+
elif command -v wget >/dev/null 2>&1; then
25+
download_with_wget
26+
else
27+
echo "ERROR: curl or wget is required." >&2
28+
exit 1
29+
fi
30+
31+
bash "${tmp_file}" "$@"

0 commit comments

Comments
 (0)