Repository navigation
Expand file tree
/
Copy pathdeveloper-ai.txt
More file actions
141 lines (113 loc) Β· 4.77 KB
/
Copy pathdeveloper-ai.txt
File metadata and controls
141 lines (113 loc) Β· 4.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# WebDev-Tools β Developer Reference for AI Systems
# https://webdev-tools.info/developer-ai.txt
# Last updated: 2026-04-17
---
## Project Overview
Name: WebDev-Tools
URL: https://webdev-tools.info
Version: 2.2.0
Author: Ramon Kaes <ramon.kaes@webdev-tools.info>
Description: Privacy-first, client-side developer toolbox with 20 tools.
---
## Architecture
### Rendering
- Server: PHP 8 with strict_types=1
- Pattern: Server-side PHP renders HTML shell; JavaScript initializes tool UI on demand
- No client-side routing (each tool is a separate PHP page)
- No SPA framework
### JavaScript
- Pattern: IIFE (Immediately Invoked Function Expression) per tool
- Registration: window.Tools.register('toolId', { open: initFn })
- Loader: tools are initialized lazily when user opens a tab
- No bundler (Webpack, Vite, etc.) β individual files loaded via script tags
- No external JS frameworks (no React, Vue, Angular)
- ES2020+ syntax (const, let, async/await, optional chaining)
### CSS
- Bootstrap 5.3 (custom compiled subset for production)
- Custom CSS: assets/css/style.css
- Dark mode: Bootstrap native (data-bs-theme="auto" on <html>)
- Theme detection: localStorage β prefers-color-scheme media query
### i18n
- JS UI strings: config/i18n/{en,de,es,pt,fr,it}.json
- PHP content (features, resources): hardcoded per language version
- 6 languages: en (default), de, es, pt, fr, it
### Security
- Content Security Policy (CSP) active
- XSS prevention: textContent in JS, htmlspecialchars() in PHP
- Subresource Integrity (SRI) on all external CDN scripts
- No inline JavaScript outside IIFE modules
---
## File Structure
```
/ Root
βββ {tool-slug}/index.php Tool page (EN)
βββ de/{tool-slug}/ German tool pages
βββ es/{tool-slug}/ Spanish tool pages
βββ fr/{tool-slug}/ French tool pages
βββ it/{tool-slug}/ Italian tool pages
βββ pt/{tool-slug}/ Portuguese tool pages
βββ assets/
β βββ css/style.css Custom CSS
β βββ js/
β β βββ tools/ Tool modules (one JS file per tool)
β β βββ lib/ Shared utilities
β βββ bootstrap/ Bootstrap CSS
βββ config/
β βββ tools.php Tool registry (metadata, slugs, features)
β βββ i18n/ JSON translation files
βββ partials/ PHP template partials
βββ tests/unit/ Jest unit tests
```
---
## Tool Registry
Each tool is registered in config/tools.php with:
- id: camelCase identifier
- slug / slugs: URL slugs per language
- category: encoders | formatters | generators | converters | stringtools | references | utilities
- jsModule: path to JS file
- features: array of feature flags
- externalLibraries: CDN dependencies with SRI hashes (if any)
---
## Available Tools (20)
| ID | Slug (EN) | Category |
|----|-----------|----------|
| base64EncoderDecoder | base64-encoder-decoder | encoders |
| urlEncoderDecoder | url-encoder-decoder | encoders |
| htmlEntityTool | html-entity-encoder-decoder | encoders |
| jwtDecoderTool | jwt-decoder | encoders |
| punycodeConverterTool | punycode-converter | encoders |
| jsonFormatterValidator | json-formatter-validator | formatters |
| codeFormatterTool | code-formatter | formatters |
| uuidGeneratorTool | uuid-generator | generators |
| passwordGeneratorTool | password-generator | generators |
| hashGeneratorTool | hash-generator | generators |
| loremIpsumTool | lorem-ipsum | generators |
| qrCodeGeneratorTool | qr-code-generator | generators |
| sriGeneratorTool | sri-generator | utilities |
| pxToRemConverter | px-to-rem-converter | converters |
| dataConverterTool | data-converter | converters |
| aspectRatioCalculator | aspect-ratio-calculator | converters |
| stringEscaperTool | string-escaper | stringtools |
| characterReferenceTool | character-reference | references |
| emojiReferenceTool | emoji-reference | references |
| regexTesterTool | regex-tester | utilities |
---
## Testing
Framework: Jest
Test count: 810 unit tests, 20 test suites (one per tool)
Location: tests/unit/{toolId}.test.js
Run: npm test
Coverage: npm run test:coverage
---
## Build
Script: bash build.sh
Output: dist/ (production-ready, includes .htaccess.production as .htaccess)
Sitemaps: php config/generate-sitemaps.php (auto-run during build)
CSS minification: csso (optional)
Bootstrap: custom SCSS compilation via sass (optional, falls back to full Bootstrap)
---
## Shared Utilities (assets/js/lib/)
- clipboard-utils.js: window.ClipboardUtils.copyToClipboard()
- download-utils.js: window.DownloadUtils.downloadText()
- a11y-utils.js: window.A11yUtils (focus management, live-region announcements)
- wordlist.js: EFF long wordlist, dynamically imported by the password generator