PreCook is a modern, responsive recipe discovery application that allows users to explore over 1000+ delicious recipes from around the world. Built with React and Firebase, this app provides a seamless cooking experience with user authentication, recipe bookmarking, and an intuitive search interface.
- π Advanced Recipe Search - Find recipes by ingredients, cuisine, or meal type
- π Bookmark System - Save your favorite recipes with user authentication
- π€ User Profiles - Personalized accounts with Google Sign-In support
- π Global Cuisine - Explore recipes from different cuisines worldwide
- π± Responsive Design - Optimized for desktop, tablet, and mobile devices
- β‘ Fast Performance - Lazy loading and code splitting for optimal speed
- π¨ Modern UI/UX - Clean, intuitive design with smooth animations
- π Secure API Management - Environment variables for sensitive data
- React.js - Component-based UI library
- React Router - Client-side routing
- React Context API - State management
- CSS Modules - Scoped styling
- React Icons - Icon components
- React Splide - Carousel/slider components
- Firebase Authentication - User authentication system
- Firebase Firestore - NoSQL database for user data
- Firebase Storage - File storage for user profile images
- Firebase Hosting - Static site hosting
- Spoonacular API - Recipe data source
- Create React App - Project scaffolding
- Figma - UI/UX design
- Git & GitHub - Version control
- Vercel/Netlify - Deployment platforms
- Firebase CLI - Firebase deployment tools
- Node.js (v14 or higher)
- npm or yarn package manager
- Firebase account
- Spoonacular API key
-
Clone the repository
git clone https://github.com/bhashitm2/PreeCook_Recipe.git cd PreeCook_Recipe -
Install dependencies
npm install
-
Set up environment variables
Copy the example environment file and add your API keys:
cp .env.example .env
Update
.envwith your actual API keys:# Spoonacular API - Get from https://spoonacular.com/food-api REACT_APP_SPOONACULAR_API=your_spoonacular_api_here # Firebase Configuration - Get from Firebase Console REACT_APP_FIREBASE_API=your_firebase_api_here REACT_APP_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com REACT_APP_FIREBASE_PROJECT_ID=your_project_id REACT_APP_FIREBASE_STORAGE_BUCKET=your_project.firebasestorage.app REACT_APP_FIREBASE_MESSAGING_SENDER_ID=your_sender_id REACT_APP_FIREBASE_APP_ID=your_app_id REACT_APP_FIREBASE_MEASUREMENT_ID=your_measurement_id
-
Start the development server
npm start
-
Open in browser Navigate to
http://localhost:3000
This project supports multiple deployment platforms with secure environment variable management.
-
Install Firebase CLI
npm install -g firebase-tools
-
Login to Firebase
firebase login
-
Initialize Firebase project
firebase init hosting
- Select your Firebase project
- Set public directory to
build - Configure as single-page app: Yes
-
Build and Deploy
npm run build firebase deploy
- Connect GitHub repo to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on every push
- Connect GitHub repo to Netlify
- Set build command:
npm run build - Set publish directory:
build - Add environment variables in Netlify dashboard
For any deployment platform, add these environment variables:
REACT_APP_SPOONACULAR_API=your_api_key
REACT_APP_FIREBASE_API=your_firebase_api
REACT_APP_FIREBASE_AUTH_DOMAIN=your_auth_domain
REACT_APP_FIREBASE_PROJECT_ID=your_project_id
REACT_APP_FIREBASE_STORAGE_BUCKET=your_storage_bucket
REACT_APP_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
REACT_APP_FIREBASE_APP_ID=your_app_id
REACT_APP_FIREBASE_MEASUREMENT_ID=your_measurement_id
β οΈ Security Note: API keys are stored as environment variables and never committed to version control.
precook-recipe-app/
βββ public/
β βββ index.html
β βββ Images/
βββ src/
β βββ components/
β β βββ AuthFormModal/ # Authentication modals
β β βββ Context/ # React Context providers
β β βββ Footer/ # Footer component
β β βββ MainHeader/ # Header with navigation
β β βββ RecipeCard/ # Recipe display cards
β β βββ UI/ # Reusable UI components
β βββ Pages/
β β βββ Home/ # Homepage with featured recipes
β β βββ Recipe/ # Individual recipe pages
β β βββ UserProfile/ # User profile management
β β βββ Welcome/ # Landing page
β β βββ Others/ # Additional pages
β βββ Helper/
β β βββ config.js # API configuration
β β βββ recipe-info.js # Recipe utilities
β βββ Images/ # Static assets
β βββ App.js # Main app component
β βββ firebase.js # Firebase configuration
β βββ index.js # App entry point
βββ .env # Environment variables (not committed)
βββ .env.example # Environment template
βββ firebase.json # Firebase configuration
βββ package.json # Dependencies and scripts
npm start- Runs the app in development modenpm run build- Builds the app for productionnpm test- Launches the test runnernpm run eject- Ejects from Create React App
- Environment Variables: All API keys are stored in
.envfile and not committed to GitHub - Firebase API Keys: Safe to expose in frontend apps (secured by Firebase rules)
- Spoonacular API: Free tier provides 150 requests/day
- Error Handling: "Request failed" errors may occur due to API rate limits
- Spoonacular Limits: Monitor usage in your Spoonacular dashboard
- Retry Logic: App includes automatic retry for failed requests
- Authentication: Google Sign-In configured for deployed domains
- Firestore Rules: Database secured with authentication-based rules
- Storage Rules: File uploads restricted to authenticated users
- Firebase Configuration: Add your deployment domain to authorized domains
- API Restrictions: Configure Firebase API key restrictions for production
This project is open source and available under the MIT License.
Bhashit M
- GitHub: @bhashitm2
- Repository: PreeCook_Recipe
- LinkedIn: Connect with me
- Spoonacular API for recipe data
- Firebase for backend services
- React community for excellent documentation
- Figma for design tools
β Star this repository if you found it helpful!