Skip to content

Commit a32ee10

Browse files
authored
Merge pull request #2 from aalkhodiry/master
Adding web app
2 parents b02675f + e1abaa5 commit a32ee10

34 files changed

Lines changed: 2325 additions & 39 deletions

.cursorrules

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Cursor Rules - Context7 Required
2+
3+
## MANDATORY: Always Use Context7
4+
5+
**CRITICAL RULE**: Before answering any question, implementing any feature, or solving any problem, you MUST use Context7 to look up relevant documentation and best practices.
6+
7+
### When to Use Context7
8+
9+
1. **Before implementing any feature**: Always search Context7 for library documentation, examples, and best practices
10+
2. **When encountering errors**: Use Context7 to find solutions and troubleshooting guides
11+
3. **When using external libraries**: Always fetch library documentation via Context7 before using APIs
12+
4. **When optimizing code**: Search Context7 for performance best practices and patterns
13+
5. **When designing architecture**: Consult Context7 for design patterns and architectural guidance
14+
15+
### How to Use Context7
16+
17+
1. **Resolve library ID first**: Use `mcp_context7_resolve-library-id` to find the correct library identifier
18+
2. **Fetch documentation**: Use `mcp_context7_get-library-docs` with the resolved library ID
19+
3. **Apply best practices**: Use the documentation to inform your implementation
20+
4. **Cite sources**: Reference the Context7 documentation when explaining your approach
21+
22+
### Example Workflow
23+
24+
```
25+
User asks: "How do I implement X?"
26+
1. Use Context7 to resolve library ID for relevant library
27+
2. Fetch documentation with specific topic
28+
3. Review examples and best practices
29+
4. Implement solution based on Context7 documentation
30+
5. Explain approach referencing Context7 sources
31+
```
32+
33+
### Prohibited Behavior
34+
35+
- ❌ DO NOT implement features without consulting Context7 first
36+
- ❌ DO NOT guess API usage - always look it up via Context7
37+
- ❌ DO NOT skip Context7 even for "simple" questions
38+
- ❌ DO NOT use outdated patterns - always check Context7 for current best practices
39+
40+
### Exception
41+
42+
The ONLY exception is when Context7 is explicitly unavailable or the user explicitly requests to skip it. Otherwise, Context7 usage is MANDATORY.
43+
44+
---
45+
46+
## Project-Specific Rules
47+
48+
### Technology Stack
49+
- **Framework**: Dioxus 0.7.1
50+
- **Language**: Rust
51+
- **Styling**: Tailwind CSS
52+
- **Platform**: Web (WASM)
53+
54+
### Code Style
55+
- Use Rust naming conventions (snake_case for functions, PascalCase for types)
56+
- Prefer explicit types over type inference when it improves readability
57+
- Use `use_signal`, `use_memo`, `use_effect` hooks appropriately
58+
- Keep components focused and single-purpose
59+
- Organize code into separate component files
60+
61+
### Component Organization
62+
- Components should be in `src/components/` directory
63+
- Each component should be in its own file
64+
- Use `mod.rs` to re-export components
65+
- Pass signals and event handlers as props
66+
67+
### Best Practices
68+
- Always handle async operations with `spawn` and proper error handling
69+
- Use debouncing for expensive operations
70+
- Cache expensive computations (like scrypt key derivation)
71+
- Provide visual feedback for loading states
72+
- Ensure accessibility with proper ARIA labels and keyboard navigation
73+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Rust
16+
uses: actions-rs/toolchain@v1
17+
with:
18+
toolchain: stable
19+
target: wasm32-unknown-unknown
20+
override: true
21+
profile: minimal
22+
23+
- name: Install Dioxus CLI
24+
run: cargo install dioxus-cli
25+
26+
- name: Build with Dioxus
27+
run: |
28+
cd spectre-app
29+
dx bundle -r
30+
31+
- name: Upload artifact
32+
uses: actions/upload-pages-artifact@v3
33+
with:
34+
path: ./spectre-app/dist/public
35+
36+
deploy:
37+
needs: build
38+
permissions:
39+
pages: write # Allow the GITHUB_TOKEN to create a deployment
40+
id-token: write # Allow the GITHUB_TOKEN to authenticate with OIDC
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
44+
runs-on: ubuntu-latest
45+
steps:
46+
- name: Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ Thumbs.db
2121
*.mpsites
2222
*.json
2323
!Cargo.json
24+
25+
*/dist/public

Cargo.toml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,21 @@ sha2 = "0.10"
2323
aes = "0.8"
2424
cbc = "0.1"
2525
rand = "0.8"
26+
getrandom = { version = "0.2", features = ["js"] }
2627

2728
# CLI
28-
clap = { version = "4.5", features = ["derive", "env"] }
29-
rpassword = "7.3"
29+
clap = { version = "4.5", features = ["derive", "env"], optional = true }
30+
rpassword = { version = "7.3", optional = true }
3031

3132
# Serialization
3233
serde = { version = "1.0", features = ["derive"] }
3334
serde_json = "1.0"
3435

3536
# Utilities
3637
thiserror = "1.0"
37-
chrono = { version = "0.4", features = ["serde"] }
38-
dirs = "5.0"
38+
chrono = { version = "0.4", features = ["serde", "clock", "wasmbind"], default-features = false }
39+
dirs = { version = "5.0", optional = true }
40+
41+
[features]
42+
default = ["cli"]
43+
cli = ["clap", "rpassword", "dirs"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)