806 lines
15 KiB
Bash
Executable File
806 lines
15 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Fonction pour créer une note avec front matter
|
|
create_note() {
|
|
local path="$1"
|
|
local title="$2"
|
|
local tags="$3"
|
|
local content="$4"
|
|
local date=$(date +%d-%m-%Y)
|
|
local time=$(date +%d-%m-%Y:%H:%M)
|
|
|
|
cat > "$path" << NOTEEOF
|
|
---
|
|
title: "$title"
|
|
date: "$date"
|
|
last_modified: "$time"
|
|
tags: [$tags]
|
|
---
|
|
|
|
$content
|
|
NOTEEOF
|
|
}
|
|
|
|
# Créer la structure de dossiers
|
|
mkdir -p projets/{backend,frontend,mobile}
|
|
mkdir -p meetings/2025
|
|
mkdir -p documentation/{api,guides}
|
|
mkdir -p ideas
|
|
mkdir -p tasks
|
|
mkdir -p research/{ai,tech,design}
|
|
mkdir -p personal
|
|
mkdir -p archive
|
|
|
|
echo "Dossiers créés..."
|
|
|
|
# Notes dans projets/backend
|
|
create_note "projets/backend/api-design.md" "API Design" '"projet", "backend", "api"' \
|
|
"# API Design
|
|
|
|
## Architecture REST
|
|
|
|
Notre API suit les principes REST avec les endpoints suivants:
|
|
|
|
- \`GET /api/v1/notes\` - Liste toutes les notes
|
|
- \`GET /api/v1/notes/{path}\` - Récupère une note
|
|
- \`PUT /api/v1/notes/{path}\` - Crée/met à jour une note
|
|
- \`DELETE /api/v1/notes/{path}\` - Supprime une note
|
|
|
|
## Authentification
|
|
|
|
Pour l'instant, pas d'authentification. À implémenter avec JWT.
|
|
|
|
## Rate Limiting
|
|
|
|
À considérer pour la production."
|
|
|
|
create_note "projets/backend/database-schema.md" "Database Schema" '"projet", "backend", "database"' \
|
|
"# Database Schema
|
|
|
|
## Indexer
|
|
|
|
L'indexer maintient une structure en mémoire:
|
|
|
|
\`\`\`go
|
|
type Indexer struct {
|
|
tags map[string][]string
|
|
docs map[string]*Document
|
|
mu sync.RWMutex
|
|
}
|
|
\`\`\`
|
|
|
|
## Performance
|
|
|
|
- Indexation en O(n) au démarrage
|
|
- Recherche en O(1) pour les tags
|
|
- Re-indexation incrémentale avec fsnotify"
|
|
|
|
create_note "projets/backend/deployment.md" "Deployment Strategy" '"projet", "backend", "devops"' \
|
|
"# Deployment Strategy
|
|
|
|
## Production
|
|
|
|
1. Compiler le binaire Go
|
|
2. Copier les fichiers statiques
|
|
3. Configurer nginx comme reverse proxy
|
|
4. Systemd pour gérer le service
|
|
|
|
## Docker
|
|
|
|
À créer un Dockerfile pour faciliter le déploiement.
|
|
|
|
\`\`\`dockerfile
|
|
FROM golang:1.22 AS builder
|
|
WORKDIR /app
|
|
COPY . .
|
|
RUN go build -o server ./cmd/server
|
|
\`\`\`"
|
|
|
|
# Notes dans projets/frontend
|
|
create_note "projets/frontend/codemirror-integration.md" "CodeMirror Integration" '"projet", "frontend", "editor"' \
|
|
"# CodeMirror 6 Integration
|
|
|
|
## Configuration
|
|
|
|
Nous utilisons CodeMirror 6 avec:
|
|
- \`@codemirror/lang-markdown\` pour le Markdown
|
|
- \`@codemirror/theme-one-dark\` pour le thème
|
|
- \`@codemirror/basic-setup\` pour les fonctionnalités de base
|
|
|
|
## Slash Commands
|
|
|
|
Système de commandes rapides avec \`/\`:
|
|
- /h1, /h2, /h3 - Titres
|
|
- /date - Date actuelle
|
|
- /table - Tableau
|
|
- /code - Bloc de code
|
|
|
|
## Auto-save
|
|
|
|
Déclenché après 2 secondes d'inactivité."
|
|
|
|
create_note "projets/frontend/vite-build.md" "Vite Build Process" '"projet", "frontend", "build"' \
|
|
"# Vite Build Process
|
|
|
|
## Structure
|
|
|
|
\`\`\`
|
|
frontend/
|
|
├── src/
|
|
│ ├── main.js
|
|
│ ├── editor.js
|
|
│ ├── file-tree.js
|
|
│ └── ui.js
|
|
├── vite.config.js
|
|
└── package.json
|
|
\`\`\`
|
|
|
|
## Build
|
|
|
|
\`npm run build\` génère:
|
|
- \`personotes-frontend.es.js\` (ES modules)
|
|
- \`personotes-frontend.umd.js\` (UMD)
|
|
|
|
## Watch Mode
|
|
|
|
\`npm run build -- --watch\` pour le dev."
|
|
|
|
create_note "projets/frontend/drag-and-drop.md" "Drag and Drop System" '"projet", "frontend", "ux"' \
|
|
"# Drag and Drop System
|
|
|
|
## Fonctionnalités
|
|
|
|
- Déplacer fichiers entre dossiers
|
|
- Déplacer dossiers entre dossiers
|
|
- Zone de drop racine
|
|
- Indicateur visuel de destination
|
|
|
|
## Implémentation
|
|
|
|
Utilise l'API HTML5 Drag & Drop:
|
|
- \`dragstart\` / \`dragend\`
|
|
- \`dragover\` / \`dragleave\`
|
|
- \`drop\`
|
|
|
|
## Validations
|
|
|
|
- Impossible de déplacer un dossier dans lui-même
|
|
- Impossible de déplacer la racine"
|
|
|
|
# Notes dans projets/mobile
|
|
create_note "projets/mobile/responsive-design.md" "Responsive Design" '"projet", "mobile", "css"' \
|
|
"# Responsive Design
|
|
|
|
## Media Queries
|
|
|
|
\`\`\`css
|
|
@media (max-width: 768px) {
|
|
/* Tablettes */
|
|
}
|
|
|
|
@media (max-width: 480px) {
|
|
/* Smartphones */
|
|
}
|
|
\`\`\`
|
|
|
|
## Mobile-First
|
|
|
|
- Sidebar masquée par défaut
|
|
- Preview-only mode
|
|
- Touch-friendly buttons"
|
|
|
|
create_note "projets/mobile/pwa.md" "Progressive Web App" '"projet", "mobile", "pwa"' \
|
|
"# PWA Features
|
|
|
|
## À implémenter
|
|
|
|
1. Service Worker
|
|
2. Manifest.json
|
|
3. Offline support
|
|
4. Install prompt
|
|
|
|
## Avantages
|
|
|
|
- Fonctionne offline
|
|
- Installable sur mobile
|
|
- Notifications push possibles"
|
|
|
|
# Notes dans meetings
|
|
create_note "meetings/2025/sprint-planning.md" "Sprint Planning January" '"meeting", "planning"' \
|
|
"# Sprint Planning - Janvier 2025
|
|
|
|
## Participants
|
|
- Équipe Dev
|
|
- Product Owner
|
|
- Scrum Master
|
|
|
|
## Objectifs
|
|
|
|
1. Améliorer le drag & drop
|
|
2. Ajouter l'API REST
|
|
3. Search modal avec Ctrl+K
|
|
|
|
## Vélocité
|
|
|
|
20 story points pour ce sprint.
|
|
|
|
## Risques
|
|
|
|
- Complexité du drag & drop de dossiers
|
|
- Tests E2E à mettre en place"
|
|
|
|
create_note "meetings/2025/retrospective.md" "Sprint Retrospective" '"meeting", "retro"' \
|
|
"# Retrospective - Sprint 1
|
|
|
|
## What went well ✅
|
|
|
|
- API REST implémentée rapidement
|
|
- Bonne collaboration
|
|
- Tests unitaires en place
|
|
|
|
## What to improve ⚠️
|
|
|
|
- Documentation à jour
|
|
- CI/CD pipeline
|
|
- Code reviews plus rapides
|
|
|
|
## Action items
|
|
|
|
1. Créer CONTRIBUTING.md
|
|
2. Setup GitHub Actions
|
|
3. Daily standups à 10h"
|
|
|
|
create_note "meetings/client-feedback.md" "Client Feedback Session" '"meeting", "client"' \
|
|
"# Client Feedback - Session 1
|
|
|
|
## Points positifs
|
|
|
|
- Interface épurée et rapide
|
|
- Édition Markdown fluide
|
|
- Recherche efficace
|
|
|
|
## Demandes
|
|
|
|
1. Export PDF des notes
|
|
2. Partage de notes par lien
|
|
3. Mode collaboratif
|
|
4. Dark/Light theme toggle
|
|
|
|
## Priorités
|
|
|
|
Focus sur l'export PDF pour la v1.1"
|
|
|
|
# Notes dans documentation/api
|
|
create_note "documentation/api/endpoints.md" "API Endpoints Reference" '"documentation", "api"' \
|
|
"# API Endpoints
|
|
|
|
## Notes
|
|
|
|
### List Notes
|
|
\`\`\`
|
|
GET /api/v1/notes
|
|
\`\`\`
|
|
|
|
Returns array of all notes.
|
|
|
|
### Get Note
|
|
\`\`\`
|
|
GET /api/v1/notes/{path}
|
|
Accept: application/json | text/markdown
|
|
\`\`\`
|
|
|
|
### Create/Update Note
|
|
\`\`\`
|
|
PUT /api/v1/notes/{path}
|
|
Content-Type: application/json
|
|
\`\`\`
|
|
|
|
### Delete Note
|
|
\`\`\`
|
|
DELETE /api/v1/notes/{path}
|
|
\`\`\`
|
|
|
|
## Examples
|
|
|
|
See API.md for complete examples."
|
|
|
|
create_note "documentation/api/authentication.md" "Authentication Guide" '"documentation", "api", "security"' \
|
|
"# Authentication
|
|
|
|
## Current Status
|
|
|
|
⚠️ No authentication currently implemented.
|
|
|
|
## Future Implementation
|
|
|
|
### JWT Tokens
|
|
|
|
\`\`\`
|
|
POST /api/auth/login
|
|
{
|
|
\"username\": \"user\",
|
|
\"password\": \"pass\"
|
|
}
|
|
|
|
Response:
|
|
{
|
|
\"token\": \"eyJhbGc...\"
|
|
}
|
|
\`\`\`
|
|
|
|
### Bearer Token
|
|
|
|
\`\`\`
|
|
Authorization: Bearer eyJhbGc...
|
|
\`\`\`
|
|
|
|
## Security
|
|
|
|
- HTTPS only in production
|
|
- Reverse proxy with nginx
|
|
- Rate limiting"
|
|
|
|
# Notes dans documentation/guides
|
|
create_note "documentation/guides/getting-started.md" "Getting Started Guide" '"documentation", "guide", "tutorial"' \
|
|
"# Getting Started
|
|
|
|
## Installation
|
|
|
|
1. Clone the repo
|
|
2. Install Go 1.22+
|
|
3. Install Node.js dependencies
|
|
4. Build frontend
|
|
5. Run server
|
|
|
|
\`\`\`bash
|
|
git clone https://github.com/user/project-notes.git
|
|
cd project-notes
|
|
cd frontend && npm install && npm run build
|
|
cd ..
|
|
go run ./cmd/server
|
|
\`\`\`
|
|
|
|
## First Steps
|
|
|
|
1. Create a note
|
|
2. Add tags
|
|
3. Search with Ctrl+K
|
|
4. Organize with folders"
|
|
|
|
create_note "documentation/guides/markdown-syntax.md" "Markdown Syntax Guide" '"documentation", "guide", "markdown"' \
|
|
"# Markdown Syntax
|
|
|
|
## Headers
|
|
|
|
\`\`\`markdown
|
|
# H1
|
|
## H2
|
|
### H3
|
|
\`\`\`
|
|
|
|
## Emphasis
|
|
|
|
**bold** and *italic*
|
|
|
|
## Lists
|
|
|
|
- Item 1
|
|
- Item 2
|
|
- Nested
|
|
|
|
## Code
|
|
|
|
Inline \`code\` and blocks:
|
|
|
|
\`\`\`python
|
|
def hello():
|
|
print('Hello')
|
|
\`\`\`
|
|
|
|
## Tables
|
|
|
|
| Column | Column |
|
|
|--------|--------|
|
|
| Data | Data |"
|
|
|
|
# Notes dans ideas
|
|
create_note "ideas/mobile-app.md" "Native Mobile App" '"idea", "mobile"' \
|
|
"# Native Mobile App Idea
|
|
|
|
## Concept
|
|
|
|
Créer une app native iOS/Android pour l'édition de notes.
|
|
|
|
## Tech Stack
|
|
|
|
- React Native ou Flutter
|
|
- Sync avec l'API REST
|
|
- Offline-first architecture
|
|
|
|
## Features
|
|
|
|
- Push notifications
|
|
- Widget home screen
|
|
- Voice notes
|
|
- Photo attachments
|
|
|
|
## Timeline
|
|
|
|
Q2 2025 - Prototype
|
|
Q3 2025 - Beta testing"
|
|
|
|
create_note "ideas/ai-assistant.md" "AI Writing Assistant" '"idea", "ai"' \
|
|
"# AI Writing Assistant
|
|
|
|
## Vision
|
|
|
|
Intégrer un assistant IA pour:
|
|
- Suggestions d'écriture
|
|
- Résumés automatiques
|
|
- Tags suggestions
|
|
- Recherche sémantique
|
|
|
|
## APIs
|
|
|
|
- OpenAI GPT-4
|
|
- Anthropic Claude
|
|
- Local LLM avec Ollama
|
|
|
|
## Privacy
|
|
|
|
Données restent locales, API optionnelle."
|
|
|
|
create_note "ideas/collaboration.md" "Real-time Collaboration" '"idea", "collaboration"' \
|
|
"# Real-time Collaboration
|
|
|
|
## Goal
|
|
|
|
Plusieurs utilisateurs éditent la même note simultanément.
|
|
|
|
## Technology
|
|
|
|
- WebSockets
|
|
- Operational Transforms ou CRDT
|
|
- Presence indicators
|
|
|
|
## Challenges
|
|
|
|
- Conflict resolution
|
|
- Performance at scale
|
|
- User permissions"
|
|
|
|
# Notes dans tasks
|
|
create_note "tasks/backlog.md" "Product Backlog" '"task", "planning"' \
|
|
"# Product Backlog
|
|
|
|
## High Priority
|
|
|
|
- [ ] Export notes to PDF
|
|
- [ ] Bulk operations (delete, move)
|
|
- [ ] Tags management page
|
|
- [ ] Keyboard shortcuts documentation
|
|
|
|
## Medium Priority
|
|
|
|
- [ ] Note templates
|
|
- [ ] Trash/Recycle bin
|
|
- [ ] Note history/versions
|
|
- [ ] Full-text search improvements
|
|
|
|
## Low Priority
|
|
|
|
- [ ] Themes customization
|
|
- [ ] Plugin system
|
|
- [ ] Graph view of notes links"
|
|
|
|
create_note "tasks/bugs.md" "Known Bugs" '"task", "bug"' \
|
|
"# Known Bugs
|
|
|
|
## Critical
|
|
|
|
None currently! 🎉
|
|
|
|
## Medium
|
|
|
|
- [ ] Search doesn't highlight in preview
|
|
- [ ] Drag over nested folders can be glitchy
|
|
- [ ] Mobile: sidebar animation stutters
|
|
|
|
## Low
|
|
|
|
- [ ] File tree doesn't remember expanded state
|
|
- [ ] Tags with special chars break search
|
|
- [ ] Long filenames overflow in sidebar
|
|
|
|
## Fixed
|
|
|
|
- [x] Slash commands not working consistently
|
|
- [x] Drag and drop to root not working"
|
|
|
|
# Notes dans research/ai
|
|
create_note "research/ai/semantic-search.md" "Semantic Search Research" '"research", "ai", "search"' \
|
|
"# Semantic Search
|
|
|
|
## Current Search
|
|
|
|
Keyword-based with scoring.
|
|
|
|
## Semantic Search
|
|
|
|
Use embeddings for similarity:
|
|
- OpenAI embeddings API
|
|
- Local models (sentence-transformers)
|
|
- Vector database (Pinecone, Weaviate)
|
|
|
|
## Implementation
|
|
|
|
1. Generate embeddings for all notes
|
|
2. Store in vector DB
|
|
3. Query with user search
|
|
4. Return top-k similar
|
|
|
|
## Cost Analysis
|
|
|
|
OpenAI: $0.0001 per 1K tokens
|
|
Local: Free but slower"
|
|
|
|
create_note "research/ai/auto-tagging.md" "Automatic Tagging" '"research", "ai", "nlp"' \
|
|
"# Automatic Tagging
|
|
|
|
## Goal
|
|
|
|
Suggest tags based on note content.
|
|
|
|
## Approaches
|
|
|
|
### Rule-based
|
|
- Keyword extraction
|
|
- TF-IDF
|
|
|
|
### ML-based
|
|
- Zero-shot classification
|
|
- Fine-tuned model
|
|
|
|
### Hybrid
|
|
- Combine both approaches
|
|
|
|
## Training Data
|
|
|
|
Use existing notes with tags as training set."
|
|
|
|
# Notes dans research/tech
|
|
create_note "research/tech/go-performance.md" "Go Performance Optimization" '"research", "tech", "performance"' \
|
|
"# Go Performance
|
|
|
|
## Current Bottlenecks
|
|
|
|
- Full re-index on file changes
|
|
- No caching of parsed front matter
|
|
|
|
## Optimizations
|
|
|
|
### Incremental Indexing
|
|
Only re-parse changed files.
|
|
|
|
### Caching
|
|
\`\`\`go
|
|
type Cache struct {
|
|
entries map[string]*CachedEntry
|
|
mu sync.RWMutex
|
|
}
|
|
\`\`\`
|
|
|
|
### Profiling
|
|
\`\`\`bash
|
|
go test -cpuprofile=cpu.prof
|
|
go tool pprof cpu.prof
|
|
\`\`\`"
|
|
|
|
create_note "research/tech/websockets.md" "WebSockets for Live Updates" '"research", "tech", "websocket"' \
|
|
"# WebSockets
|
|
|
|
## Use Cases
|
|
|
|
- Live file tree updates
|
|
- Real-time collaboration
|
|
- Presence indicators
|
|
|
|
## Libraries
|
|
|
|
- \`gorilla/websocket\`
|
|
- \`nhooyr.io/websocket\`
|
|
|
|
## Architecture
|
|
|
|
\`\`\`
|
|
Client <-> WebSocket <-> Hub <-> Indexer
|
|
\`\`\`
|
|
|
|
## Broadcasting
|
|
|
|
\`\`\`go
|
|
type Hub struct {
|
|
clients map[*Client]bool
|
|
broadcast chan []byte
|
|
}
|
|
\`\`\`"
|
|
|
|
# Notes dans research/design
|
|
create_note "research/design/ui-inspiration.md" "UI Design Inspiration" '"research", "design", "ui"' \
|
|
"# UI Inspiration
|
|
|
|
## Apps to Study
|
|
|
|
- Notion - Clean, minimal
|
|
- Obsidian - Graph view
|
|
- Bear - Beautiful typography
|
|
- Craft - Smooth animations
|
|
|
|
## Design Systems
|
|
|
|
- Material Design 3
|
|
- Apple HIG
|
|
- Tailwind components
|
|
|
|
## Colors
|
|
|
|
Current: Material Darker
|
|
Consider:
|
|
- Nord theme
|
|
- Dracula
|
|
- Catppuccin"
|
|
|
|
create_note "research/design/typography.md" "Typography Research" '"research", "design", "typography"' \
|
|
"# Typography
|
|
|
|
## Current Fonts
|
|
|
|
- System fonts for UI
|
|
- Fira Code for code
|
|
|
|
## Alternatives
|
|
|
|
### Sans-serif
|
|
- Inter
|
|
- Poppins
|
|
- Public Sans
|
|
|
|
### Monospace
|
|
- JetBrains Mono
|
|
- Cascadia Code
|
|
- Source Code Pro
|
|
|
|
## Readability
|
|
|
|
- Line height: 1.6
|
|
- Max width: 65ch
|
|
- Font size: 16px base"
|
|
|
|
# Notes dans personal
|
|
create_note "personal/learning-goals.md" "2025 Learning Goals" '"personal", "learning"' \
|
|
"# Learning Goals 2025
|
|
|
|
## Technical
|
|
|
|
- [ ] Master Go concurrency patterns
|
|
- [ ] Learn Rust basics
|
|
- [ ] Deep dive into databases
|
|
- [ ] System design courses
|
|
|
|
## Soft Skills
|
|
|
|
- [ ] Technical writing
|
|
- [ ] Public speaking
|
|
- [ ] Mentoring
|
|
|
|
## Books to Read
|
|
|
|
1. Designing Data-Intensive Applications
|
|
2. The Pragmatic Programmer
|
|
3. Clean Architecture"
|
|
|
|
create_note "personal/book-notes.md" "Book Notes" '"personal", "notes", "books"' \
|
|
"# Book Notes
|
|
|
|
## Currently Reading
|
|
|
|
**Atomic Habits** by James Clear
|
|
|
|
Key takeaways:
|
|
- 1% improvement daily = 37x better in a year
|
|
- Identity-based habits
|
|
- Environment design
|
|
|
|
## Want to Read
|
|
|
|
- Deep Work - Cal Newport
|
|
- The Mom Test - Rob Fitzpatrick
|
|
- Shape Up - Basecamp"
|
|
|
|
# Notes dans archive
|
|
create_note "archive/old-ideas.md" "Archived Ideas" '"archive", "ideas"' \
|
|
"# Archived Ideas
|
|
|
|
Ideas that didn't make the cut:
|
|
|
|
## WYSIWYG Editor
|
|
Too complex, Markdown is better.
|
|
|
|
## Desktop App
|
|
Web app is sufficient.
|
|
|
|
## Blockchain Integration
|
|
No real use case.
|
|
|
|
## Gamification
|
|
Not aligned with minimalist approach."
|
|
|
|
# Quelques notes à la racine
|
|
create_note "welcome.md" "Welcome" '"default"' \
|
|
"# Welcome to PersoNotes
|
|
|
|
This is your personal note-taking app.
|
|
|
|
## Quick Start
|
|
|
|
1. Press **Ctrl/Cmd+K** to search
|
|
2. Click **✨ Nouvelle note** to create
|
|
3. Use **/** for quick Markdown commands
|
|
|
|
## Features
|
|
|
|
- **Fast** - Go backend, instant search
|
|
- **Simple** - Just Markdown files
|
|
- **Organized** - Folders, tags, drag & drop
|
|
- **Beautiful** - Dark theme, live preview
|
|
|
|
Enjoy! 📝"
|
|
|
|
create_note "todo.md" "Quick TODO List" '"task", "todo"' \
|
|
"# TODO
|
|
|
|
## Today
|
|
- [x] Fix drag & drop
|
|
- [x] Add root drop zone
|
|
- [ ] Write documentation
|
|
- [ ] Deploy to production
|
|
|
|
## This Week
|
|
- [ ] Add export feature
|
|
- [ ] Improve mobile experience
|
|
- [ ] Write blog post
|
|
|
|
## Someday
|
|
- [ ] Collaboration features
|
|
- [ ] Mobile app
|
|
- [ ] Plugin system"
|
|
|
|
create_note "scratch.md" "Scratch Pad" '"default"' \
|
|
"# Scratch Pad
|
|
|
|
Random thoughts and quick notes...
|
|
|
|
## Ideas
|
|
- Maybe add a daily note feature?
|
|
- Graph view of linked notes
|
|
- Vim mode for power users
|
|
|
|
## Links
|
|
- https://example.com
|
|
- https://github.com/user/repo
|
|
|
|
## Code Snippet
|
|
|
|
\`\`\`javascript
|
|
const hello = () => {
|
|
console.log('Hello World');
|
|
};
|
|
\`\`\`"
|
|
|
|
echo "✅ Structure créée avec succès!"
|
|
echo ""
|
|
echo "📊 Statistiques:"
|
|
echo "- Dossiers: $(find . -type d | wc -l)"
|
|
echo "- Notes: $(find . -name '*.md' | wc -l)"
|
|
echo "- Tags uniques: $(grep -h "^tags:" **/*.md 2>/dev/null | sort -u | wc -l)"
|