A modern, full-stack AI prompt management platform with multi-model optimization, community prompt library, and professional-grade editing tools.
Live Demo Β· Documentation Β· Report Bug
NotePrompt is an AI prompt management platform built with Next.js 15. It provides a workspace for creating, organizing, optimizing, and sharing AI prompts across multiple AI providers, with a dual-mode editor, community library, and administration tools.
π Production endpoint: noteprompt.cn. A release is considered healthy only after the commit-SHA image, migration status, database/Redis readiness, and live TLS checks in DEPLOY.md pass.
- Built as a complete SaaS-style product rather than a single-page demo: authentication, personal workspace, public library, admin dashboard, deployment scripts, and production reverse proxy are all included.
- Designed around a real prompt-management workflow: users can draft, organize, optimize, publish, search, and reuse prompts across multiple model providers.
- Shows full-stack engineering range: Next.js App Router, TypeScript, MySQL, Redis, JWT auth, Docker Compose, Nginx, email verification, and rate limiting.
- Useful as a portfolio project because it demonstrates product thinking, backend API design, AI-provider integration, and deployable infrastructure in one repository.
- Dual-Mode Editor β Switch between Standard and Professional editing modes with real-time preview
- Folder Organization β Hierarchical folder system with drag-and-drop, custom descriptions, and nested structure
- Version History β Automatic edit tracking with one-click rollback to any previous version
- Global Search β
Ctrl+Kinstant search across all prompts and folders - Tags & Categories β Organize prompts with 15 built-in categories and custom tagging
- 17+ AI Models β Integrated with DeepSeek (V3.2, R1), Kimi (K2.5, K2 Thinking), Qwen (3.5 Plus, 3 Max, Coder Plus), Zhipu GLM (5, 4.7, 4.6, 4.5)
- Multi-Turn Optimization β Iterative prompt refinement through AI-guided conversations
- Model Presets β Creative / Balanced / Precise temperature presets for different use cases
- Auto-Fallback β Seamless failover between providers if one is unavailable
- Bounded Attachment Parsing β Local PDF extraction and Chinese/English OCR in the production image, with a finite OCR work queue
- Public Prompt Library β Browse, search, and collect community-shared prompts
- 15 Curated Categories β Writing, Programming, Education, Marketing, Creative Design, Data Analysis, Life Assistant, Translation, Productivity, AI Art, Academic Research, Social Media, Role-Playing, Content Creation, and more
- Favorites & Likes β Save and engage with the best community prompts
- One-Click Publish β Share your prompts to the public library instantly
- Dark Mode β Light / Dark / System-following theme with smooth transitions
- Admin Dashboard β Full platform management: user management, content moderation, usage statistics, featured content curation
- JWT Authentication β Secure registration/login with bcrypt password hashing (12 rounds)
- Email Verification β Optional email verification with rate-limited, brute-force-protected verification codes
- Rate Limiting β Redis-backed rate limiting on all sensitive endpoints
- Responsive Design β Fully optimized for desktop, tablet, and mobile
| Layer | Technology |
|---|---|
| Frontend | Next.js 15, React 18, TypeScript, Tailwind CSS 3.4 |
| UI Components | shadcn/ui, Radix UI, Lucide Icons |
| Backend | Next.js App Router API Routes (Node.js) |
| Database | MySQL 8.0 |
| Caching | Redis 7 |
| Authentication | JWT + bcrypt |
| Nodemailer | |
| AI Providers | DeepSeek, Kimi (Moonshot), Qwen (DashScope), Zhipu GLM |
| Deployment | Docker Compose + Nginx + SSL |
- Node.js 24 LTS
- MySQL >= 8.0
- Redis >= 6 (optional only for local development; mandatory in production)
- At least one AI provider API key
git clone https://github.com/computersciencefreshmen/NotePrompt.git
cd NotePromptnpm cicp .env.example .env.localEdit .env.local with your configuration:
# ββ Long-running application database account (DML only) ββ
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=note_prompt_app
MYSQL_PASSWORD=local_app_password
MYSQL_DATABASE=agent_report
# ββ One-shot migration account (DML + reviewed schema DDL) ββ
MYSQL_MIGRATION_USER=note_prompt_migrator
MYSQL_MIGRATION_PASSWORD=local_migration_password
# ββ Authentication ββββββββββββββββββββββββββ
JWT_SECRET=your_jwt_secret_at_least_32_chars
PROVIDER_KEY_ENCRYPTION_SECRET=an_independent_encryption_secret
VERIFICATION_CODE_SECRET=an_independent_verification_hmac_secret
NEXTAUTH_URL=http://localhost:3000
ENABLE_CONTRIBUTION_UPGRADES=false
PRO_AI_MONTHLY_LIMIT=100
# ββ Redis (recommended locally, required in production) ββ
# REDIS_URL=redis://localhost:6379/0
RATE_LIMIT_ALLOW_MEMORY_FALLBACK=true
# ββ AI API Keys (configure at least one) ββββ
DEEPSEEK_API_KEY=sk-xxx
KIMI_API_KEY=sk-xxx
QWEN_API_KEY=sk-xxx
ZHIPU_API_KEY=xxx.xxx
# ββ Email (optional) ββββββββββββββββββββββββ
EMAIL_HOST=smtp.example.com
EMAIL_PORT=587
EMAIL_SECURE=false
EMAIL_USER=your_email@example.com
EMAIL_PASS=your_password_or_app_token
EMAIL_FROM=your_email@example.com
EMAIL_FROM_NAME=Note Prompt
ENABLE_EMAIL_VERIFICATION=falseThe application and migration usernames must differ and neither may be root. The application account receives only SELECT, INSERT, UPDATE, and DELETE; see DEPLOY.md for production grants.
npm run db:plan
npm run db:status
npm run db:migrate
npm run db:statusdatabase/migrations/*.cjs is the only schema source of truth. The server does not perform request-time DDL. Never replace production with a checked-in schema dump; back up first and apply the ordered, checksummed migrations using the dedicated account.
npm run devOpen http://localhost:3000 in your browser.
Production is not a one-command latest deployment. Follow DEPLOY.md for the required backup, full commit-SHA image build, one-shot migration, readiness, TLS validation, rollback, credential rotation, and cache cleanup workflow.
The Docker Compose stack includes:
- note-prompt-migrate β one-shot schema migration using a dedicated DDL account
- note-prompt-app β read-only Next.js runtime using a DML-only account
- nginx β pinned reverse proxy with TLS termination and readiness dependency
MySQL and Redis are private external dependencies and are deliberately not exposed or bootstrapped by this Compose file.
NotePrompt/
βββ src/
β βββ app/ # Next.js App Router
β β βββ page.tsx # Landing page
β β βββ admin/ # Admin dashboard
β β βββ api/v1/ # RESTful API routes
β β β βββ auth/ # Authentication (register, login, verify-email)
β β β βββ ai/ # AI optimization endpoints
β β β βββ prompts/ # User prompts CRUD
β β β βββ public-prompts/ # Public prompt library
β β β βββ folders/ # Folder management
β β β βββ favorites/ # Favorites system
β β β βββ search/ # Global search
β β β βββ tags/ # Tag management
β β βββ prompts/ # Prompt workspace pages
β β βββ public-prompts/ # Public library pages
β β βββ folders/ # Folder view pages
β β βββ settings/ # User settings
β βββ components/ # Reusable React components
β β βββ ui/ # shadcn/ui base components
β β βββ AIOptimizeDialog.tsx # AI optimization dialog
β β βββ Header.tsx # Navigation header
β β βββ ... # 40+ components
β βββ config/
β β βββ ai.ts # AI provider & model configuration
β βββ contexts/ # React Context providers
β β βββ AuthContext.tsx # JWT authentication state
β β βββ ThemeContext.tsx # Theme management
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utilities & services
β β βββ mysql-database.ts # Database access layer
β β βββ rate-limit.ts # Rate limiting
β β βββ email-service.ts # Email service
β βββ types/ # TypeScript type definitions
βββ database/
β βββ migrations/ # Ordered, checksummed CJS migrations
β βββ schema-requirements.json# Runtime schema contract
β βββ README.md # Migration lifecycle and recovery rules
βββ scripts/
β βββ mysql-migrate.cjs # plan / status / up migration CLI
βββ nginx/
β βββ nginx.conf # Nginx config (Cloudflare-ready)
βββ docker-compose.yml # Docker Compose orchestration
βββ Dockerfile # Multi-stage production build
βββ package.json
All API endpoints are prefixed with /api/v1/.
| Method | Endpoint | Description |
|---|---|---|
POST |
/auth/register |
Register a new account |
POST |
/auth/login |
Login and receive JWT token |
POST |
/auth/verify-email |
Verify email with 6-digit code |
GET |
/prompts |
List user's prompts |
POST |
/prompts |
Create a new prompt |
PUT |
/prompts/:id |
Update a prompt |
DELETE |
/prompts/:id |
Delete a prompt |
GET |
/public-prompts |
Browse public prompt library |
POST |
/public-prompts |
Publish a prompt |
GET |
/folders |
List user's folders |
POST |
/folders |
Create a new folder |
POST |
/ai/optimize |
AI-powered prompt optimization |
GET |
/search |
Global search |
GET |
/favorites |
List favorites |
POST |
/favorites |
Add to favorites |
GET |
/categories |
List all categories |
GET |
/tags |
List all tags |
| Provider | Models | Highlights |
|---|---|---|
| DeepSeek | V3.2 Chat, R1 (Reasoner) | Top-tier reasoning capability |
| Kimi (Moonshot) | K2.5, K2 Thinking, Moonshot V1 (32K/128K) | 128K context window |
| Qwen (Alibaba) | 3.5 Plus, 3 Max, Coder Plus, Long, 3.5 Flash | Best Chinese language support |
| Zhipu GLM | GLM-5, GLM-4.7, GLM-4.7-Flash, GLM-4.6, GLM-4.5 | 128K context, up to 131072 tokens |
- Password Hashing β bcrypt with 12 salt rounds (OWASP recommended)
- JWT Authentication β Secure token-based auth with httpOnly cookies
- Rate Limiting β Redis-backed rate limiting on auth and API endpoints
- Input Validation β Server-side validation on all user inputs
- CSRF Protection β SameSite cookie policy
- Brute Force Protection β Lockout after 5 failed verification attempts
- Timing-Safe Comparison β
crypto.timingSafeEqualfor verification codes
π Screenshots coming soon β visit noteprompt.cn for the live experience.
This project is licensed under the MIT License.
Built with β€οΈ using Next.js, TypeScript, and Tailwind CSS