A full-stack web application for storing, organizing, and managing AI prompts built with Go (Gin framework) and React (TypeScript + Vite). This project provides a comprehensive solution for AI prompt management with categories, tags, search functionality, sharing capabilities, and user authentication.
- Prompt Management - Create, read, update, and delete AI prompts
- Organization - Categorize prompts with custom categories and tags
- Search & Discovery - Powerful search functionality with filters
- Sharing - Share prompts with other users or make them public
- Version Control - Track prompt history and versions
- Import/Export - Backup and migrate prompt collections
- JWT Authentication - Secure token-based authentication
- OAuth Integration - Social login with Google and GitHub
- Role-based Access Control - Admin and user roles
- Protected Routes - Secure access to user data
- RESTful API - Clean API design with Gin framework
- Database Integration - PostgreSQL with migrations
- Middleware Support - Authentication and CORS middleware
- Environment Configuration - Flexible config management
- Modern React - Built with React 18 and TypeScript
- Vite Build Tool - Fast development and build process
- Ant Design - Enterprise-grade UI design language and components
- React Query - Powerful data fetching and caching
- React Router - Client-side routing
- Responsive Design - Mobile-first responsive interface
- Language: Go 1.23+
- Framework: Gin Web Framework
- Database: PostgreSQL
- ORM: SQLx
- Authentication: JWT with golang-jwt
- Configuration: Viper/godotenv
- CORS: gin-contrib/cors
- Language: TypeScript
- Framework: React 18
- Build Tool: Vite
- UI Library: Ant Design (antd)
- HTTP Client: Axios
- State Management: React Query
- Routing: React Router DOM
- Go 1.23 or higher
- Node.js 18+ and npm/yarn
- PostgreSQL database
- Git
git clone https://github.com/congdv/keeperprompt.git
cd keeperpromptgo mod downloadCreate a .env file in the root directory:
# Database
DB_HOST=localhost
DB_PORT=5432
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_NAME=keeper_prompt_db
DB_SSL_MODE=disable
# JWT
JWT_SECRET=your-super-secret-jwt-key
JWT_EXPIRY=24h
# OAuth (optional)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
# Server
PORT=8080
GIN_MODE=debug# Create database
createdb keeper_prompt_db
# Run migrations
psql -d keeper_prompt_db -f migrations/0001_init.sqlcd webappnpm install
# or
yarn install# From the root directory
go run cmd/api/main.goThe API server will start on http://localhost:8080
# From the webapp directory
cd webapp
npm run dev
# or
yarn devThe React app will start on http://localhost:5173
βββ cmd/
β βββ api/
β βββ main.go # Application entry point
βββ internal/
β βββ config/
β β βββ config.go # Configuration management
β βββ database/
β β βββ db.go # Database connection
β βββ http/
β β βββ handlers/ # HTTP request handlers
β β βββ middleware/ # HTTP middleware
β βββ models/ # Data models
β βββ repository/ # Data access layer
β βββ services/ # Business logic layer
βββ migrations/ # Database migrations
βββ webapp/
β βββ src/
β β βββ components/ # React components
β β βββ context/ # React contexts
β β βββ lib/ # Utility libraries
β β βββ pages/ # Page components
β βββ package.json
β βββ vite.config.ts
βββ go.mod
βββ go.sum
βββ README.md
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/logout- User logoutGET /api/auth/me- Get current userPOST /api/auth/refresh- Refresh JWT token
GET /api/auth/oauth/google- Google OAuth loginGET /api/auth/oauth/github- GitHub OAuth loginGET /api/auth/oauth/callback- OAuth callback handler
GET /api/prompts- Get user's promptsPOST /api/prompts- Create new promptGET /api/prompts/:id- Get prompt by IDPUT /api/prompts/:id- Update promptDELETE /api/prompts/:id- Delete promptGET /api/prompts/search- Search prompts
GET /api/categories- Get user's categoriesPOST /api/categories- Create new categoryPUT /api/categories/:id- Update categoryDELETE /api/categories/:id- Delete category
GET /api/tags- Get user's tagsPOST /api/tags- Create new tagPUT /api/tags/:id- Update tagDELETE /api/tags/:id- Delete tag
GET /api/users- Get users (admin only)GET /api/users/:id- Get user by IDPUT /api/users/:id- Update userDELETE /api/users/:id- Delete user (admin only)
| Variable | Description | Required |
|---|---|---|
DB_HOST |
Database host | Yes |
DB_PORT |
Database port | Yes |
DB_USER |
Database username | Yes |
DB_PASSWORD |
Database password | Yes |
DB_NAME |
Database name | Yes |
JWT_SECRET |
JWT signing secret | Yes |
JWT_EXPIRY |
JWT token expiry duration | Yes |
PORT |
Server port | No (default: 8080) |
GIN_MODE |
Gin mode (debug/release) | No |
GOOGLE_CLIENT_ID |
Google OAuth client ID | No |
GOOGLE_CLIENT_SECRET |
Google OAuth client secret | No |
GITHUB_CLIENT_ID |
GitHub OAuth client ID | No |
GITHUB_CLIENT_SECRET |
GitHub OAuth client secret | No |
- Create Prompts: Add new AI prompts with titles, descriptions, and content
- Organize: Assign categories and tags to your prompts for better organization
- Search: Use the search functionality to quickly find prompts by keywords, categories, or tags
- Share: Make prompts public or share them with specific users
- Version Control: Track changes and maintain different versions of your prompts
- Create custom categories to organize prompts by topic or use case
- Use tags for more granular organization and cross-category labeling
- Filter and search prompts by categories and tags
- Export your prompt collection for backup purposes
- Import prompts from other sources or migrate between accounts
go test ./...cd webapp
npm test
# or
yarn testdocker build -t keeper-prompt .
docker run --env-file .env --network host keeper-prompt
go build -o bin/api cmd/api/main.gocd webapp
npm run build
# or
yarn buildThis project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
If you have any questions or need help, please open an issue on GitHub.
AI Prompt Keeper - Organize, manage, and share your AI prompts efficiently.