From 63e6c640774d028fb109b9ffc1b6fcd6ae860d10 Mon Sep 17 00:00:00 2001 From: Puechberty Arthur Date: Mon, 30 Mar 2026 19:25:43 +0200 Subject: [PATCH] Add SVG assets and TypeScript configuration - Created a new SVG for the Open Graph image (og-image.svg) with a gradient background and text elements. - Added Vercel logo SVG (vercel.svg) for deployment branding. - Introduced a window icon SVG (window.svg) for UI representation. - Initialized TypeScript configuration file (tsconfig.json) with strict settings and module resolution for a React project. --- .dockerignore | 5 + .gitignore | 42 + README.md | 71 + app/components/Editor.tsx | 95 + app/components/MarkdownPreview.tsx | 26 + app/components/Sidebar.tsx | 216 + app/components/Toolbar.tsx | 117 + app/favicon.ico | Bin 0 -> 25931 bytes app/globals.css | 982 +++++ app/hooks/useNotes.ts | 173 + app/hooks/useTheme.ts | 28 + app/layout.tsx | 158 + app/page.tsx | 99 + app/robots.ts | 14 + app/sitemap.ts | 13 + app/types.ts | 11 + docker-compose.yml | 27 + eslint.config.mjs | 18 + next.config.ts | 46 + package-lock.json | 6627 ++++++++++++++++++++++++++++ package.json | 28 + postcss.config.mjs | 7 + public/apple-touch-icon.png | Bin 0 -> 19863 bytes public/favicon.ico | Bin 0 -> 4286 bytes public/icon-192.png | Bin 0 -> 19227 bytes public/icon-512.png | Bin 0 -> 19968 bytes public/icon.svg | 24 + public/manifest.json | 26 + public/og-image.png | Bin 0 -> 74603 bytes public/og-image.svg | 28 + tsconfig.json | 34 + 31 files changed, 8915 insertions(+) create mode 100644 .dockerignore create mode 100644 .gitignore create mode 100644 README.md create mode 100644 app/components/Editor.tsx create mode 100644 app/components/MarkdownPreview.tsx create mode 100644 app/components/Sidebar.tsx create mode 100644 app/components/Toolbar.tsx create mode 100644 app/favicon.ico create mode 100644 app/globals.css create mode 100644 app/hooks/useNotes.ts create mode 100644 app/hooks/useTheme.ts create mode 100644 app/layout.tsx create mode 100644 app/page.tsx create mode 100644 app/robots.ts create mode 100644 app/sitemap.ts create mode 100644 app/types.ts create mode 100644 docker-compose.yml create mode 100644 eslint.config.mjs create mode 100644 next.config.ts create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 postcss.config.mjs create mode 100644 public/apple-touch-icon.png create mode 100644 public/favicon.ico create mode 100644 public/icon-192.png create mode 100644 public/icon-512.png create mode 100644 public/icon.svg create mode 100644 public/manifest.json create mode 100644 public/og-image.png create mode 100644 public/og-image.svg create mode 100644 tsconfig.json diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b9a7b74 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +node_modules +.next +.git +*.md +.env*.local diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1f3f329 --- /dev/null +++ b/.gitignore @@ -0,0 +1,42 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/versions + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem +.vscode/ + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# env files (can opt-in for committing if needed) +.env* + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/README.md b/README.md new file mode 100644 index 0000000..961b6e0 --- /dev/null +++ b/README.md @@ -0,0 +1,71 @@ +# BlocNote + +Bloc-notes Markdown en ligne, rapide et sans inscription. + +## Site public + +- Production: https://blocnote.arthurp.fr + +## Stack technique + +- Next.js 16 (App Router) +- React 19 +- TypeScript +- ESLint + +## Fonctionnalites + +- Edition Markdown avec apercu en temps reel +- Sauvegarde automatique des notes +- Recherche et tri des notes +- Notes epinglees +- Export d'une note +- Mode clair / sombre +- Raccourcis clavier + +## Lancement local + +Pre-requis: + +- Node.js 22+ +- npm + +Installation et demarrage: + +```bash +npm ci +npm run dev +``` + +Application disponible sur http://localhost:3000 + +## Scripts + +```bash +npm run dev # mode developpement +npm run lint # verification lint +npm run build # build production +npm run start # lancer le build production +``` + +## Variables d'environnement + +Le projet peut utiliser: + +- NEXT_PUBLIC_SITE_URL (exemple: https://blocnote.arthurp.fr) + +## Docker + +Un environnement Docker est disponible via [docker-compose.yml](docker-compose.yml). + +```bash +docker compose up -d +``` + +## Publication GitHub + +Points verifies avant publication: + +- Secrets et fichiers sensibles non exposes +- Fichiers d'environnement ignores par [.gitignore](.gitignore) +- Build et lint valides diff --git a/app/components/Editor.tsx b/app/components/Editor.tsx new file mode 100644 index 0000000..4a95f5d --- /dev/null +++ b/app/components/Editor.tsx @@ -0,0 +1,95 @@ +"use client"; + +import { useRef, useState } from "react"; +import { Note } from "../types"; +import Toolbar from "./Toolbar"; +import MarkdownPreview from "./MarkdownPreview"; +import { Pencil, Eye, Columns2 } from "lucide-react"; + +type ViewMode = "edit" | "preview" | "split"; + +interface EditorProps { + note: Note; + onUpdateNote: (id: string, updates: Partial) => void; +} + +export default function Editor({ note, onUpdateNote }: EditorProps) { + const textareaRef = useRef(null); + const [viewMode, setViewMode] = useState("split"); + const [title, setTitle] = useState(note.title); + const [content, setContent] = useState(note.content); + + const handleTitleChange = (newTitle: string) => { + setTitle(newTitle); + onUpdateNote(note.id, { title: newTitle }); + }; + + const handleContentChange = (newContent: string) => { + setContent(newContent); + onUpdateNote(note.id, { content: newContent }); + }; + + return ( +
+
+ handleTitleChange(e.target.value)} + placeholder="Titre de la note..." + /> +
+ + + +
+
+ + {(viewMode === "edit" || viewMode === "split") && ( + + )} + +
+ {(viewMode === "edit" || viewMode === "split") && ( +
+ +