Skip to content

Commit c2a7d7e

Browse files
thenickberryclaude
andcommitted
Update README to reflect current stack and project structure
- Requirements: MariaDB 11 (not MySQL 8.0), Caddy+PHP-FPM (not Apache), imagick extension (not GD) - Docker CLI: mariadb command (not mysql) - Project structure: resources/, bin/, bootstrap/app.php, tests/e2e/ - Test counts: 102 PHPUnit, 40×4=160 Playwright - CI: PHP 8.3 and 8.4 (not 8.2/8.3) - Added Nginx example alongside Caddy for manual installs - Added composer install step to manual installation - Removed stale DEFAULT_THEME / MAX_UPLOAD_SIZE env vars, added APP_ENV, APP_DEBUG, SESSION_LIFETIME Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 907823d commit c2a7d7e

File tree

1 file changed

+77
-64
lines changed

1 file changed

+77
-64
lines changed

README.md

Lines changed: 77 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@ A PHP-based image management and cataloging system.
44

55
## Overview
66

7-
CANDIDv2 is an image database application that allows users to organize, search, and browse photo collections. Originally written in Perl by Ben Weir, it has been rewritten in PHP.
7+
CANDIDv2 is an image database application for organizing, searching, and browsing photo collections. Originally written in Perl by Ben Weir, rewritten in modern PHP.
88

99
## Features
1010

11-
- **Search** — Find images by date, photographer, description, or tagged people
12-
- **Browse** — Navigate images through hierarchical categories with sorting options
13-
- **Lightbox** — View images in a carousel with keyboard/touch navigation
14-
- **Bulk Upload** — Upload multiple images with EXIF metadata extraction
15-
- **People Tagging** — Tag users in photos and search by tagged people
16-
- **Duplicate Detection** — Automatic MD5-based duplicate detection on upload
11+
- **Browse** — Navigate images through hierarchical categories with sort options
12+
- **Search** — Find images by date range, photographer, description, or tagged people
13+
- **Lightbox** — Full-screen carousel with keyboard and touch navigation
14+
- **Bulk Upload** — Upload multiple images at once with automatic EXIF extraction (date taken, camera)
15+
- **Bulk Edit** — Select multiple images to update metadata or rotate in one action
16+
- **People Tagging** — Tag users in photos and filter search results by tagged people
17+
- **Duplicate Detection** — MD5-based duplicate detection on upload
18+
- **Admin Panel** — User management and trash/restore for soft-deleted content
1719

1820
## Requirements
1921

2022
- PHP 8.3+
21-
- MySQL 8.0+
22-
- Apache with mod_rewrite
23-
- PHP Extensions: GD, PDO_MySQL, EXIF, zip
23+
- MariaDB 11+
24+
- Caddy (or any web server) + PHP-FPM
25+
- PHP extensions: `imagick`, `pdo_mysql`, `exif`, `zip`
2426

2527
## Quick Start (Docker)
2628

27-
The fastest way to get started is with Docker:
28-
2929
```bash
3030
# Clone the repository
3131
git clone <repository-url>
@@ -43,10 +43,10 @@ open http://localhost:8080
4343

4444
### Default Credentials
4545

46-
- **Username:** admin
47-
- **Password:** changeme
46+
- **Username:** `admin`
47+
- **Password:** `changeme`
4848

49-
**Important:** Change the admin password immediately after first login.
49+
> **Important:** Change the admin password immediately after first login.
5050
5151
### Docker Commands
5252

@@ -60,16 +60,14 @@ docker compose down
6060
# View logs
6161
docker compose logs -f
6262

63-
# Rebuild after changes
64-
docker compose build --no-cache
65-
docker compose up -d
63+
# Rebuild image after Dockerfile changes
64+
docker compose build --no-cache && docker compose up -d
6665

67-
# Access MySQL CLI
68-
docker compose exec db mysql -u candid -p candid
66+
# MariaDB CLI
67+
docker compose exec db mariadb -u candid -p candid
6968

70-
# Reset database (warning: destroys data)
71-
docker compose down -v
72-
docker compose up -d
69+
# Reset database (destroys all data)
70+
docker compose down -v && docker compose up -d
7371
```
7472

7573
## Manual Installation
@@ -78,97 +76,112 @@ docker compose up -d
7876

7977
```bash
8078
cp .env.example .env
81-
# Edit .env with your database credentials
79+
# Edit .env with your database credentials and settings
8280
```
8381

84-
### 2. Create Database
82+
### 2. Install PHP Dependencies
8583

8684
```bash
87-
mysql -u root -p < database/schema.sql
88-
mysql -u root -p candid < database/seed.sql
85+
composer install
8986
```
9087

91-
### 3. Configure Apache
88+
### 3. Create Database
9289

93-
Point your document root to the `public/` directory and ensure mod_rewrite is enabled.
90+
```bash
91+
mariadb -u root -p < database/schema.sql
92+
mariadb -u root -p candid < database/seed.sql
93+
```
9494

95-
Example virtual host:
95+
### 4. Configure Web Server
9696

97-
```apache
98-
<VirtualHost *:80>
99-
ServerName candid.local
100-
DocumentRoot /path/to/candidv2/public
97+
Point your document root to the `public/` directory. All requests must be routed through `public/index.php`.
10198

102-
<Directory /path/to/candidv2/public>
103-
AllowOverride All
104-
Require all granted
105-
</Directory>
106-
</VirtualHost>
99+
**Caddy example:**
100+
```
101+
root * /path/to/candidv2/public
102+
php_fastcgi unix//run/php/php-fpm.sock
103+
file_server
104+
try_files {path} /index.php?{query}
105+
```
106+
107+
**Nginx example:**
108+
```nginx
109+
root /path/to/candidv2/public;
110+
index index.php;
111+
location / { try_files $uri $uri/ /index.php?$query_string; }
112+
location ~ \.php$ { fastcgi_pass unix:/run/php/php-fpm.sock; include fastcgi_params; }
107113
```
108114

109-
### 4. Set Permissions
115+
### 5. Set Permissions
110116

111117
```bash
112-
# Make storage directories writable
113118
chmod -R 755 storage
114119
chown -R www-data:www-data storage
115120
```
116121

117122
## Configuration
118123

119-
Configuration is managed through environment variables. See `.env.example` for available options:
124+
All configuration is via environment variables in `.env`:
120125

121126
| Variable | Description | Default |
122127
|----------|-------------|---------|
128+
| `APP_ENV` | Environment (`development` / `production`) | `production` |
129+
| `APP_DEBUG` | Show PHP errors | `false` |
123130
| `DB_HOST` | Database hostname | `localhost` |
124131
| `DB_NAME` | Database name | `candid` |
125132
| `DB_USER` | Database username | `candid` |
126133
| `DB_PASS` | Database password ||
127-
| `DEFAULT_THEME` | UI theme | `default` |
128-
| `MAX_UPLOAD_SIZE` | Max upload file size | `50M` |
134+
| `SESSION_LIFETIME` | Session lifetime in seconds | `86400` |
129135

130136
## Project Structure
131137

132138
```
133139
candidv2/
134-
├── public/ # Web root (front controller)
140+
├── bin/ # CLI utility scripts
141+
├── bootstrap/
142+
│ └── app.php # Application bootstrap
143+
├── config/ # Configuration
144+
├── database/ # Schema and seed SQL
145+
├── docker/ # Dockerfile, Caddyfile, php.ini
146+
├── public/ # Web root (front controller + assets)
147+
├── resources/ # View templates
135148
├── src/ # Application code (PSR-4: App\)
136-
│ ├── Controller/ # Request handlers
137-
│ ├── Service/ # Business logic
138-
│ ├── Exception/ # Custom exceptions
139-
│ └── Helper/ # Utility functions
140-
├── config/ # Configuration files
141-
├── templates/ # View templates
142-
├── database/ # Schema and seeds
143-
├── docker/ # Docker configuration
149+
│ ├── Controller/
150+
│ ├── Service/
151+
│ ├── Repository/
152+
│ ├── Entity/
153+
│ ├── Exception/
154+
│ └── Helper/
144155
├── storage/ # Runtime files (uploads, images, cache)
145-
├── scripts/ # CLI utilities
146-
├── tests/ # PHPUnit test suites
147-
└── legacy/ # Deprecated code (reference only)
156+
└── tests/ # PHPUnit suites + Playwright E2E
157+
└── e2e/
148158
```
149159

150160
## Testing
151161

152162
```bash
153-
# PHPUnit (79 tests)
163+
# PHPUnit — unit and integration tests (102 tests)
154164
docker exec candidv2-app-1 php vendor/bin/phpunit
155165

156-
# PHPStan static analysis
166+
# PHPStan static analysis (level 6)
157167
docker exec candidv2-app-1 vendor/bin/phpstan analyse
158168

159-
# Playwright E2E (27 tests) - requires npm install first
169+
# Playwright E2E tests (40 tests × 4 browsers = 160 total)
160170
npm install && npx playwright install
161171
npx playwright test
172+
173+
# Single browser
174+
npx playwright test --project=chromium
162175
```
163176

164-
Tests run automatically via GitHub Actions on push/PR (PHP 8.2, 8.3).
177+
Tests run automatically via GitHub Actions on push/PR (PHP 8.3 and 8.4).
165178

166179
## Documentation
167180

168-
- [PHASES.md](PHASES.md) — Roadmap for ongoing updates
169-
- [CHANGELOG.md](CHANGELOG.md) — Log of all modifications
170-
- [MODERNIZATION_PLAN.md](MODERNIZATION_PLAN.md) — Technical assessment and plan
181+
- [PHASES.md](PHASES.md) — Roadmap and task tracking
182+
- [CHANGELOG.md](CHANGELOG.md) — Log of all changes with rationale
183+
- [MODERNIZATION_PLAN.md](MODERNIZATION_PLAN.md) — Technical assessment
171184

172185
## License
173186

174-
See LICENSE file for details.
187+
MIT — see [LICENSE](LICENSE) for details.

0 commit comments

Comments
 (0)