A magical wish-making application with a beautiful frontend and robust backend API.
- Magical UI: Beautiful gradient design with sparkle animations
- Wish Management: Create, view, and delete wishes
- Real-time Updates: Instant feedback when wishes are submitted
- Responsive Design: Works on desktop and mobile devices
- RESTful API: Clean backend API with full CRUD operations
- Database Storage: Persistent storage with SQLite/PostgreSQL support
- Frontend: Next.js 15 with TypeScript and Tailwind CSS
- Backend: FastAPI with SQLAlchemy ORM
- Database: SQLite (development) / PostgreSQL (production)
- Deployment: Docker, Railway, Vercel, Heroku support
# Clone the repository
git clone <your-repo-url>
cd 小狗许愿机
# Run with Docker Compose
docker-compose up -d
# Access the application
# Frontend: http://localhost:3000
# Backend: http://localhost:8000
# API Docs: http://localhost:8000/docsBackend Setup:
cd backend
pip install -r requirements.txt
python main.pyFrontend Setup:
cd frontend
npm install --legacy-peer-deps
npm run dev小狗许愿机/
├── backend/ # FastAPI backend
│ ├── main.py # Main application
│ ├── requirements.txt # Python dependencies
│ └── Dockerfile # Backend container
├── frontend/ # Next.js frontend
│ ├── app/ # Next.js app directory
│ ├── components/ # UI components
│ ├── wish-machine.tsx # Main wish machine component
│ └── Dockerfile # Frontend container
├── docker-compose.yml # Multi-container setup
├── DEPLOYMENT.md # Detailed deployment guide
└── README.md # This file
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/wishes |
Create a new wish |
GET |
/api/wishes |
Get all wishes |
GET |
/api/wishes/{id} |
Get specific wish |
DELETE |
/api/wishes/{id} |
Delete a wish |
GET |
/health |
Health check |
- Home (
/): Main wish machine interface - Wishes (
/wishes): View all submitted wishes
Backend:
DATABASE_URL=sqlite:///./wishes.db
CORS_ORIGINS=http://localhost:3000
PORT=8000Frontend:
NEXT_PUBLIC_API_URL=http://localhost:8000See DEPLOYMENT.md for detailed deployment instructions.
- Railway (Easiest): One-click deployment
- Vercel + Railway: Frontend on Vercel, Backend on Railway
- Docker: Self-hosted with Docker Compose
- Heroku: Traditional cloud deployment
- Node.js 18+
- Python 3.11+
- Docker (optional)
# Backend development
cd backend
pip install -r requirements.txt
python main.py
# Frontend development
cd frontend
npm install --legacy-peer-deps
npm run dev
# Run both with Docker
docker-compose up -d# Backend tests
cd backend
python -m pytest
# Frontend tests
cd frontend
npm test- Health Checks: Built-in health endpoints
- Logs: Docker Compose logs or platform-specific logging
- Performance: Next.js built-in optimizations
- CORS protection
- Input validation
- SQL injection protection via SQLAlchemy
- Environment variable configuration
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is open source and available under the MIT License.
- Built with Next.js and FastAPI
- Styled with Tailwind CSS
- Icons from Lucide React
- Deployed with modern cloud platforms
Made with ✨ and 🌟 by the Wish Machine Team