Skip to content

Commit 5ce9223

Browse files
committed
Added configuration files for Lefthook and Oxlint, updated Docker Compose and package.json for Node version, and made various adjustments to the API and web components, including new routes and UI elements. Removed unused files and improved code structure across multiple components.
1 parent eae23a1 commit 5ce9223

File tree

169 files changed

+13140
-26844
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+13140
-26844
lines changed

.github/copilot-instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../AGENT.md

.github/instructions/README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Instructions Directory Overview
2+
3+
This directory contains all instruction files that guide AI assistants and developers in maintaining consistent code quality and following established patterns.
4+
5+
## Documentation Flow
6+
7+
```mermaid
8+
graph TD
9+
CLAUDE[CLAUDE.md<br/>symlink]
10+
CURSOR[.cursorrules<br/>symlink]
11+
COPILOT[.github/copilot-instructions.md<br/>symlink]
12+
HUMAN[Developer<br/>Real Human]
13+
14+
AGENT[AGENT.md<br/>Central Source]
15+
16+
CLAUDE --> AGENT
17+
CURSOR --> AGENT
18+
COPILOT --> AGENT
19+
HUMAN --> AGENT
20+
21+
INST[Instruction Files<br/>typescript.md, react.md, etc.]
22+
README[README Files<br/>Project & Package docs]
23+
CODE[Code Examples<br/>Tests, Stories, Patterns]
24+
25+
AGENT --> INST
26+
AGENT --> README
27+
AGENT --> CODE
28+
29+
style CLAUDE fill:#fafafa,stroke:#222,stroke-width:1px,stroke-dasharray: 5 5,color:#222
30+
style CURSOR fill:#fafafa,stroke:#222,stroke-width:1px,stroke-dasharray: 5 5,color:#222
31+
style COPILOT fill:#fafafa,stroke:#222,stroke-width:1px,stroke-dasharray: 5 5,color:#222
32+
style HUMAN fill:#fafafa,stroke:#222,stroke-width:2px,color:#222
33+
style AGENT fill:#fafafa,stroke:#222,stroke-width:3px,color:#222
34+
style INST fill:#fafafa,stroke:#222,stroke-width:1px,color:#222
35+
style README fill:#fafafa,stroke:#222,stroke-width:1px,color:#222
36+
style CODE fill:#fafafa,stroke:#222,stroke-width:1px,color:#222
37+
```
38+
39+
Each AI assistant tool enters through its own symlink, but they all point to the central `AGENT.md` file. This central file acts as the single source of truth that references the appropriate documentation without duplicating content.
40+
41+
## Documentation Philosophy
42+
43+
### Structure
44+
45+
- **AGENT.md**: Central source of truth, index pointing to resources, not duplicating content
46+
- **Instruction files** (.github/instructions/\*.instructions.md): Language/framework-specific rules and patterns
47+
- All instruction files must follow the naming pattern `*.instructions.md`
48+
- Examples: `git.instructions.md`, `typescript.instructions.md`, `react.instructions.md`
49+
- **README files**: Setup, usage, and overview information
50+
- Root README: Project overview and quick start
51+
- App/package READMEs: Specific setup and usage for that module
52+
- **Code examples**: Actual implementation patterns (stories, tests, example components)
53+
54+
### Principles
55+
56+
- Each document has ONE clear purpose
57+
- Avoid duplicating information across files
58+
- Reference other docs instead of repeating content
59+
- More specific docs deeper in directory tree
60+
- Keep instructions actionable and concise
61+
62+
## Keep Documentation Updated
63+
64+
**When making architectural changes or adding new tools/patterns:**
65+
66+
1. Update the relevant documentation files to reflect changes
67+
2. This ensures all AI assistants have accurate, current information
68+
3. Include: new commands, changed workflows, updated dependencies, new patterns
69+
4. Remove: deprecated commands, old patterns, removed dependencies
70+
71+
Examples of changes that require updates:
72+
73+
- Adding/removing packages or dependencies
74+
- Changing build/test commands
75+
- Modifying project structure
76+
- Updating development workflows
77+
- Changing environment variables or ports
78+
- Adopting new conventions or patterns
79+
80+
## How to Add New Instruction Files
81+
82+
1. Create a new file following the naming pattern: `<topic>.instructions.md`
83+
2. Focus on ONE specific technology or pattern
84+
3. Include practical examples and clear guidelines
85+
4. Update AGENT.md to reference the new instruction file
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
applyTo: "**"
3+
---
4+
5+
# Clean Code Guidelines
6+
7+
## Important for AI Assistants
8+
9+
Apply these principles to all code regardless of language or framework. These guidelines complement language-specific rules and should be followed universally.
10+
11+
## Constants Over Magic Numbers
12+
13+
- Replace hard-coded values with named constants
14+
- Use descriptive constant names that explain the value's purpose
15+
- Keep constants at the top of the file or in a dedicated constants file
16+
17+
## Meaningful Names
18+
19+
- Variables, functions, and classes should reveal their purpose
20+
- Names should explain why something exists and how it's used
21+
- Avoid abbreviations unless they're universally understood
22+
23+
## Smart Comments
24+
25+
- Don't comment on what the code does - make the code self-documenting
26+
- Use comments to explain why something is done a certain way
27+
- Document APIs, complex algorithms, and non-obvious side effects
28+
29+
## Single Responsibility
30+
31+
- Each function should do exactly one thing
32+
- Functions should be small and focused
33+
- If a function needs a comment to explain what it does, it should be split
34+
35+
## DRY (Don't Repeat Yourself)
36+
37+
- Extract repeated code into reusable functions
38+
- Share common logic through proper abstraction
39+
- Maintain single sources of truth
40+
41+
## Clean Structure
42+
43+
- Keep related code together
44+
- Organize code in a logical hierarchy
45+
- Use consistent file and folder naming conventions
46+
- Prefer simplicity over complexity
47+
- Prefer composition over inheritance
48+
49+
## Encapsulation
50+
51+
- Hide implementation details
52+
- Expose clear interfaces
53+
- Move nested conditionals into well-named functions
54+
- Prefer immutable data structures
55+
- Make state changes explicit and predictable
56+
57+
## Explicit Over Implicit
58+
59+
- Be explicit about intentions and behavior
60+
- Avoid hidden side effects
61+
- Make dependencies clear
62+
- Prefer explicit returns over implicit ones
63+
- Name things for what they are, not what you hope they'll be
64+
65+
## Error Handling
66+
67+
- Fail fast - catch errors early
68+
- Handle errors at the appropriate level
69+
- Provide meaningful error messages
70+
- Never ignore or suppress errors silently
71+
- Use proper error types and avoid generic catches
72+
73+
## Code Quality Maintenance
74+
75+
- Refactor continuously
76+
- Fix technical debt early
77+
- Leave code cleaner than you found it
78+
79+
## Performance
80+
81+
- Measure before optimizing
82+
- Avoid premature optimization
83+
- Focus on algorithmic improvements over micro-optimizations
84+
- Cache expensive operations
85+
- Be mindful of memory usage
86+
87+
## Security
88+
89+
- Never hardcode secrets or credentials
90+
- Validate all inputs
91+
- Sanitize outputs
92+
- Don't log sensitive information
93+
- Follow the principle of least privilege
94+
95+
## Testing
96+
97+
- Write tests before fixing bugs
98+
- Keep tests readable and maintainable
99+
- Test edge cases and error conditions
100+
101+
## Version Control
102+
103+
- Write clear commit messages
104+
- Make small, focused commits
105+
- Use meaningful branch names
106+
107+
## Code Reviews
108+
109+
- Focus on the code, not the person
110+
- Suggest improvements, don't demand changes
111+
- Explain the "why" behind feedback
112+
- Be open to different approaches
113+
- Prioritize critical issues over style preferences
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# Git Workflow Instructions
2+
3+
Git workflow and commit conventions for the monorepo.
4+
5+
## Branching Strategy
6+
7+
We follow Git Flow branching model.
8+
9+
### Branch Types
10+
11+
**`main`** - Production code (protected)
12+
13+
- Never commit directly
14+
- Only receives merges from release and hotfix branches
15+
16+
**`develop`** - Integration branch (protected)
17+
18+
- Never commit directly
19+
- All features merge here first
20+
21+
**`feature/*`** - New features and enhancements
22+
23+
- Branch from: `develop`
24+
- Merge to: `develop`
25+
- Naming: `feature/[issue-id]-description` or `feature/description`
26+
- Deleted after merging
27+
- Note: Also used for chores, refactors, and other non-feature work
28+
29+
**`release/*`** - Prepare for production
30+
31+
- Branch from: `develop`
32+
- Merge to: `main` and `develop`
33+
- Naming: `release/vX.Y.Z`
34+
- Only bug fixes allowed, no new features
35+
36+
**`hotfix/*`** - Emergency production fixes
37+
38+
- Branch from: `main`
39+
- Merge to: `main` and `develop`
40+
- Naming: `hotfix/vX.Y.Z` or `hotfix/[issue-id]-description`
41+
42+
## Commit Messages
43+
44+
Follow [Conventional Commits](https://www.conventionalcommits.org/) specification.
45+
46+
The entire first line must be ≤50 characters (type + scope + subject).
47+
48+
### Format
49+
50+
```
51+
<type>(<scope>): <subject> ← ENTIRE LINE ≤50 CHARACTERS
52+
53+
[optional body]
54+
55+
[optional footer(s)]
56+
```
57+
58+
### Types
59+
60+
| Type | Description |
61+
| ---------- | --------------------------------------------------- |
62+
| `feat` | New feature |
63+
| `fix` | Bug fix |
64+
| `docs` | Documentation only |
65+
| `style` | Formatting, no code change |
66+
| `refactor` | Code change that neither fixes bug nor adds feature |
67+
| `perf` | Performance improvement |
68+
| `test` | Adding or correcting tests |
69+
| `build` | Build system or dependency changes |
70+
| `ci` | CI configuration changes |
71+
| `chore` | Other changes that don't modify src or test |
72+
| `revert` | Reverts a previous commit |
73+
74+
### Scope (Optional)
75+
76+
Common scopes: `api`, `web`, `ui`, `auth`, `db`, `deps`, `config`
77+
78+
- Omit scope for changes affecting multiple areas
79+
- Use kebab-case for multi-word scopes (e.g., `user-auth`)
80+
81+
### Subject Rules
82+
83+
1. **50 character limit** for entire first line: `<type>(<scope>): <subject>`
84+
2. **Lowercase start**: `feat: add user auth` not `feat: Add user auth`
85+
3. **Imperative mood**: "add" not "adds" or "added"
86+
4. **No period** at the end
87+
5. **Blank line** required between subject and body
88+
89+
**Quick check:** Write the full line and count characters. If >50, shorten it.
90+
91+
### Examples
92+
93+
```bash
94+
# Good (under 50 chars)
95+
feat(api): add user auth # 24
96+
fix(web): resolve login bug # 27
97+
refactor(config): update ts settings # 36
98+
99+
# Bad (over 50) → Fixed
100+
refactor(config): reorganize typescript configuration # 54 ❌
101+
refactor(config): reorganize ts config # 38 ✅
102+
```
103+
104+
### Body (Optional)
105+
106+
- Explain **why**, not how (implementation is in the code)
107+
- **72 characters max per line** (hard limit, count ALL characters including spaces)
108+
- MUST have a blank line between subject and body (no exceptions)
109+
- Each line in the body must be ≤72 characters
110+
111+
### Footer (Optional)
112+
113+
- Issue references: `Closes #123`
114+
- Breaking changes: `BREAKING CHANGE: description` or `!` after type
115+
- Co-authors: `Co-authored-by: name <email>`
116+
117+
### Shortening Strategies
118+
119+
When your commit message is too long, try these:
120+
121+
1. **Shorten the scope**: `user-management``users`, `authentication``auth`
122+
2. **Use abbreviations**: `configuration``config`, `typescript``ts`
123+
3. **Be more concise**: `implement profile picture uploads``add profile pics`
124+
4. **Remove filler words**: `establish strict``lockdown`, `resolve issues``fix`
125+
5. **Consider dropping scope**: If it makes the message clearer and shorter
126+
127+
## Pre-commit Hooks
128+
129+
Automated code quality checks run on every commit via Lefthook.
130+
131+
### What Runs Automatically
132+
133+
1. **oxlint** - Auto-fixes linting issues on staged JS/TS files
134+
2. **prettier** - Formats staged files (JS, TS, JSON, MD, YAML, CSS)
135+
136+
These run sequentially (oxlint first, then prettier) to avoid conflicts.
137+
138+
### Manual Checks Before Pushing
139+
140+
While pre-commit hooks handle formatting and linting, run these manually before pushing:
141+
142+
```bash
143+
pnpm tc # or pnpm typecheck - ensure no type errors
144+
```
145+
146+
The CI pipeline will catch any issues, but checking locally saves time.
147+
148+
## Workflow Commands
149+
150+
```bash
151+
# Feature work
152+
git checkout -b feature/description develop
153+
git push -u origin feature/description
154+
155+
# Release (maintainers only)
156+
git checkout -b release/v1.2.0 develop
157+
git merge --no-ff release/v1.2.0 # to main & develop
158+
159+
# Hotfix (maintainers only)
160+
git checkout -b hotfix/v1.2.1 main
161+
git merge --no-ff hotfix/v1.2.1 # to main & develop
162+
```
163+
164+
## Version Control
165+
166+
Follow [Semantic Versioning](https://semver.org/): `MAJOR.MINOR.PATCH`
167+
168+
- Breaking changes increment MAJOR
169+
- New features increment MINOR
170+
- Bug fixes increment PATCH
171+
172+
Tag format: `v1.2.3`
173+
174+
## Critical Git Rules
175+
176+
**NEVER use `git add -A` or `git add .`** - Always stage specific files deliberately
177+
178+
```bash
179+
git add <specific-files> # Stage deliberately
180+
git add -p # Interactive staging
181+
git diff --cached # Review before committing
182+
```
183+
184+
**Commit frequently**: After each logical change, not at task end
185+
**Keep atomic**: One change per commit
186+
**Check secrets**: Never commit API keys, tokens, passwords
187+
188+
## Additional Resources
189+
190+
- [Conventional Commits](https://www.conventionalcommits.org/)
191+
- [Semantic Versioning](https://semver.org/)
192+
- [Git Flow](https://danielkummer.github.io/git-flow-cheatsheet/)

0 commit comments

Comments
 (0)