Skip to content

Taufiqur71/shelfchef

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

35 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍳 ShelfChef - Smart Recipe Generator

Transform your ingredients into amazing recipes with AI-powered suggestions!

ShelfChef React FastAPI MongoDB

ShelfChef is a modern web application that transforms your available ingredients into delicious recipes using intelligent algorithms. Built with React, FastAPI, and MongoDB.

🌟 Features

  • Smart Recipe Generation: AI-powered recipe suggestions based on your ingredients
  • Beautiful Food Images: High-quality images for each recipe
  • Recipe Management: Save and manage your favorite recipes
  • Responsive Design: Works perfectly on all devices
  • Real-time Matching: See how well your ingredients match each recipe

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • Python 3.9+
  • MongoDB
  • Yarn

Local Development

  1. Clone the repository

    git clone https://github.com/yourusername/shelfchef.git
    cd shelfchef
  2. Setup Backend

    cd backend
    pip install -r requirements.txt
    cp ../.env.example .env
    uvicorn server:app --reload
  3. Setup Frontend

    cd frontend
    yarn install
    yarn start
  4. Access the application

πŸ”§ Production Deployment

Automated Deployment (CI/CD)

  1. Fork this repository

  2. Set up deployment secrets in GitHub:

    • VERCEL_TOKEN: Your Vercel API token
    • VERCEL_ORG_ID: Your Vercel organization ID
    • VERCEL_PROJECT_ID: Your Vercel project ID
    • RAILWAY_TOKEN: Your Railway API token
    • DOCKER_REGISTRY: Your Docker registry URL
    • SLACK_WEBHOOK: (Optional) Slack webhook for notifications
  3. Push to main branch

    git push origin main
  4. Automatic deployment will trigger:

    • Tests run automatically
    • Frontend deploys to Vercel
    • Backend deploys to Railway
    • Database sets up on MongoDB Atlas

Manual Deployment

  1. Using the deployment script:

    chmod +x deploy/deploy.sh
    ./deploy/deploy.sh
  2. Using Docker:

    cd backend
    docker build -t shelfchef-backend .
    docker run -p 8000:8000 shelfchef-backend
  3. Using Docker Compose:

    cd backend
    docker-compose up -d

πŸ§ͺ Testing

Backend Tests

cd backend
python -m pytest tests/ -v

Frontend Tests

cd frontend
yarn test

End-to-End Tests

yarn test:e2e

πŸ“ Project Structure

shelfchef/
β”œβ”€β”€ frontend/                 # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/      # React components
β”‚   β”‚   β”œβ”€β”€ hooks/          # Custom hooks
β”‚   β”‚   └── mock/           # Mock data
β”‚   β”œβ”€β”€ public/             # Static assets
β”‚   └── vercel.json         # Vercel configuration
β”œβ”€β”€ backend/                # FastAPI backend
β”‚   β”œβ”€β”€ server.py           # Main server file
β”‚   β”œβ”€β”€ recipe_generator.py # Recipe generation logic
β”‚   β”œβ”€β”€ tests/              # Backend tests
β”‚   β”œβ”€β”€ Dockerfile          # Docker configuration
β”‚   └── requirements.txt    # Python dependencies
β”œβ”€β”€ .github/workflows/      # CI/CD workflows
β”œβ”€β”€ deploy/                 # Deployment scripts
└── README.md              # This file

🌐 API Endpoints

Recipe Generation

  • POST /api/generate-recipes - Generate recipes from ingredients
  • GET /api/saved-recipes - Get saved recipes
  • POST /api/save-recipe - Save a recipe
  • DELETE /api/saved-recipes/{id} - Delete a recipe

Utility

  • GET /api/health - Health check
  • GET /api/ - API status

πŸ”’ Environment Variables

Create a .env file in both frontend and backend directories:

# Backend (.env)
MONGO_URL=mongodb://localhost:27017
DB_NAME=shelfchef

# Frontend (.env)
REACT_APP_BACKEND_URL=http://localhost:8000

πŸš€ Deployment Platforms

Supported Platforms

  • Frontend: Vercel, Netlify, AWS S3 + CloudFront
  • Backend: Railway, Heroku, AWS ECS, Google Cloud Run
  • Database: MongoDB Atlas, AWS DocumentDB

Platform-Specific Guides

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“Š Monitoring & Analytics

Health Checks

  • Backend: GET /api/health
  • Frontend: Built-in Vercel monitoring

Logging

  • Backend: FastAPI structured logging
  • Frontend: Console logging in development

Performance Monitoring

  • Vercel Analytics for frontend
  • Railway metrics for backend

πŸ› οΈ Development Tools

Recommended VSCode Extensions

  • Python
  • ES7+ React/Redux/React-Native snippets
  • Thunder Client (API testing)
  • Docker
  • GitLens

Code Quality

  • ESLint + Prettier for frontend
  • Black + isort for backend
  • Pre-commit hooks (optional)

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Food images from Unsplash and Pexels
  • Icons from Lucide React
  • UI components from shadcn/ui
  • Built with ❀️ using React, FastAPI, and MongoDB

πŸ“ž Support


Made with ❀️ by the ShelfChef team. Happy cooking! 🍳

About

Out of recipe ideas? Just list the ingredients you have and see the magic!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published