English | 简体中文
A Flask-based web application that generates personalized greeting cards using AI (DeepSeek API). Supports multiple occasions, tones, languages, and lengths.
- 12 Occasions: Birthday, Christmas, New Year, Valentine's, Anniversary, Graduation, Get Well, Thank You, Congratulations, Apology, Friendship, Encouragement
- 5 Tones: Heartfelt, Funny, Formal, Poetic, Casual
- 3 Languages: Chinese, English, Mixed
- 3 Lengths: Short, Medium, Long
- AI-powered message generation via DeepSeek API
- Response caching for performance
- Rate limiting per IP
- Shareable card links
- Analytics tracking
- Python 3.12+
- A DeepSeek API key (or any OpenAI-compatible API)
-
Clone the repository:
git clone https://github.com/Kylekk29/WarmCard.git cd WarmCard -
Create and activate a virtual environment:
python -m venv venv .\venv\Scripts\activate # Windows source venv/bin/activate # Linux/Mac
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.envfile:AI_API_KEY=your_deepseek_api_key AI_MODEL=deepseek-chat AI_BASE_URL=https://api.deepseek.com ADMIN_KEY=your_admin_key
-
Run the application:
python app.py
The server starts at http://localhost:5000.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/occasions |
List all occasions, tones, languages, lengths |
| POST | /api/kyle-card |
Generate a greeting card |
| POST | /api/share |
Create a shareable card |
| GET | /api/share/<id> |
Retrieve a shared card |
| GET | /api/health |
Health check with stats |
| GET | /api/analytics |
Analytics (requires admin key) |
POST /api/kyle-card
{
"name": "Alice",
"occasion": "birthday",
"tone": "heartfelt",
"language": "chinese",
"length": "medium",
"sender": "Bob"
}The app is designed to run on Linux servers. Logs are stored at /home/xmascard/logs/.