This file provides guidance to WARP (warp.dev) when working with code in this repository.
"The gooneral wheelchair" is a full-stack personal CMS (Content Management System) built with React frontend and Node.js/Express backend. The system provides both a public blog interface and a complete admin dashboard for managing posts dynamically through a REST API.
npm run dev - Runs both frontend (Vite) and backend (Express) servers concurrentlynpm run dev:frontend - Runs Vite dev server on port 5173npm run dev:backend - Runs Express API server on port 3001npm run build - Creates optimized production build in dist/npm run start:backend - Starts production Express servernpm run preview - Serves the built application locallynpm run lint - Runs ESLint on all JavaScript/JSX filesnpm install && cd backend && npm installnpm install <package-name>cd backend && npm install <package-name>npm install -D <package-name>public/posts/)src/main.jsx - React application entry with StrictModesrc/App.jsx - React Router setup with route definitionsBlogHome - Public blog homepage with post gridPostView - Individual post display componentAdminDashboard - Admin interface for managing postsPostEditor - Create/edit post interface with live previewbackend/server.js - Express server with CORS and session managementhttp://localhost:3001/apiGET /api/posts - Fetch all posts with metadataGET /api/posts/:slug - Fetch specific postGET /api/health - Health check endpointPOST /api/auth/login - User loginPOST /api/auth/logout - User logoutGET /api/auth/me - Get current user infoPOST /api/auth/change-password - Change user password (requires auth)POST /api/posts - Create new postPUT /api/posts/:slug - Update existing postDELETE /api/posts/:slug - Delete postThe CMS operates on a hybrid approach:
public/posts/ directoryindex.json when posts changetitle:, desc:, tags:)/adminThe application uses an extensive MarkdownIt setup with multiple plugins:
/posts/{slug} maps to post slugs/ shows post grid/admin for content managementFrontend Routes:
/ - Blog homepage (BlogHome component)/posts/:slug - Individual post view (PostView component)/login - Login form (LoginForm component)/admin - Admin dashboard (AdminDashboard component) - Protected/admin/post/new - Create new post (PostEditor component) - Protected/admin/post/:slug/edit - Edit existing post (PostEditor component) - ProtectedAPI Routes:
GET /api/posts - List all postsGET /api/posts/:slug - Get single postPOST /api/posts - Create postPUT /api/posts/:slug - Update postDELETE /api/posts/:slug - Delete postsrc/App.jsx - Main router component with route definitions and auth integrationsrc/main.jsx - React entry pointsrc/index.css - Global styles (Tailwind imports)src/contexts/AuthContext.jsx - Authentication context and state managementsrc/components/AdminDashboard.jsx - Admin interface componentsrc/components/PostEditor.jsx - Post creation/editing interfacesrc/components/LoginForm.jsx - User login formsrc/components/ProtectedRoute.jsx - Route protection wrapperbackend/server.js - Express API server with authenticationbackend/auth.js - Authentication utilities and user managementbackend/users.json - User data storage (auto-generated)backend/package.json - Backend dependencies and scriptspublic/posts/*.md - Blog post markdown files (managed via API)public/posts/index.json - Auto-generated file list (managed by backend)public/posts/image.png - Post assets (images referenced in markdown)package.json - Frontend dependencies and development scriptsbackend/package.json - Backend dependenciesvite.config.js - Vite configuration with React and Tailwind (no custom plugins)eslint.config.js - ESLint configuration with React rulesVia Admin Interface (Recommended):
/admin in your browserManual File Creation:
.md file in public/posts/ directorytitle: Your Title, desc: Description, tags: tag1, tag2Via Admin Interface:
/admin and click "Edit" on any postDirect File Editing:
.md file directly in public/posts/:emoji_name: syntax)[^ref] and [^ref]: content):::info, :::warning, :::spoiler)^[A-Z_] patternEach React component manages its own state with useState hooks:
posts, loading, error - For blog homepagepost, loading, error - For individual post displayposts, loading, error - For admin post listformData, loading, saving, error, previewMode - For post editingAll components use fetch() to communicate with the Express backend:
http://localhost:3001/apiThe codebase contains intentionally obscure function names (e.g., giveFoxHerHeir, getTingyun, travelToExpress, conceiveFoxFromSemen) - this appears to be a stylistic choice and should be preserved when making changes.
npm installcd backend && npm installnpm run devhttp://localhost:5173http://localhost:3001http://localhost:5173/adminFrontend: Can be deployed to static hosting (Netlify, Vercel, etc.) Backend: Requires Node.js server environment (Heroku, Railway, DigitalOcean, etc.) Database: File system based, no external database required
PORT - Backend server port (default: 3001)NODE_ENV - Environment mode for backendadminadmin123/admin without authentication → redirected to /login/admin) - Requires Authentication/admin/post/new or /admin/post/:slug/edit) - Requires Authentication/login)