FlavorShare is a modern, responsive web application that allows food enthusiasts to share, discover, and rate recipes from around the world. Built with PHP, MySQL, and vanilla JavaScript, it provides a seamless experience for managing culinary creations.
- Recipe Sharing: Upload and share your favorite recipes with the community
- Browse & Search: Discover recipes by category or search functionality
- Rating System: Rate recipes and see average ratings from the community
- Featured Recipes: Highlight exceptional recipes in a dedicated section
- Category Filtering: Filter recipes by categories (Breakfast, Lunch, Dinner, Dessert, Vegetarian, Vegan, Quick & Easy)
- User registration and authentication
- Secure login/logout functionality
- User-specific features (delete own recipes, rate recipes)
- Session management
- Responsive design that works on desktop, tablet, and mobile devices
- Modern UI with Tailwind CSS
- Smooth animations and transitions
- Interactive modals for login, registration, and recipe upload
- Toast notifications for user feedback
- Video background on hero section
- Newsletter subscription
- Recipe image upload with drag-and-drop support
- Dynamic ingredient and step management
- Category-based recipe organization
- HTML5: Semantic markup
- CSS3: Custom styles with Tailwind CSS framework
- JavaScript: Vanilla JS for dynamic functionality
- Font Awesome: Icons
- Tailwind CSS: Utility-first CSS framework
- PHP: Server-side scripting
- MySQL: Database management
- Session Management: User authentication
FlavorShare/
├── index.html # Main landing page
├── app.js # Frontend JavaScript logic
├── styles.css # Custom CSS styles
├── setup.php # Database and directory setup script
├── api/ # Backend API endpoints
│ ├── auth.php # Authentication (login/register/logout)
│ ├── categories.php # Category management
│ ├── check_login.php # Login status verification
│ ├── delete_recipe.php # Recipe deletion
│ ├── feature_recipe.php # Mark recipes as featured
│ ├── newsletter.php # Newsletter subscription
│ ├── rate_recipe.php # Recipe rating system
│ ├── recipe_detail.php # Individual recipe details
│ └── recipes.php # Recipe CRUD operations
├── config/
│ └── database.php # Database configuration and connection
├── uploads/ # User-uploaded content
│ ├── categories/ # Category images
│ └── recipes/ # Recipe images
└── utils/
└── functions.php # Helper functions
- PHP 7.4 or higher
- MySQL 5.7 or higher
- Apache or Nginx web server
- GD Library (for image processing)
-
Clone or Download the Repository
git clone <repository-url> cd FlavorShare
-
Configure Database
- Open
config/database.php - Update database credentials:
$host = 'localhost'; $dbname = 'flavorshare'; $username = 'your_username'; $password = 'your_password';
- Open
-
Run Setup Script
- Navigate to
http://localhost/FlavorShare/setup.phpin your browser - This will:
- Create necessary directories
- Initialize database tables
- Generate placeholder category images
- Navigate to
-
Configure Web Server
- Ensure the
uploads/directory has write permissions:chmod -R 777 uploads/
- Ensure the
-
Access the Application
- Open
http://localhost/FlavorShare/in your web browser
- Open
The application uses the following main tables:
id: Primary keyname: User's full nameemail: User's email (unique)password: Hashed passwordcreated_at: Registration timestamp
id: Primary keyuser_id: Foreign key to userstitle: Recipe titledescription: Recipe descriptioncategory_id: Foreign key to categoriesingredients: JSON array of ingredientssteps: JSON array of preparation stepsimage: Image file pathfeatured: Featured status (0/1)created_at: Creation timestamp
id: Primary keyname: Category nameimage: Category image path
id: Primary keyrecipe_id: Foreign key to recipesuser_id: Foreign key to usersrating: Rating value (1-5)created_at: Rating timestamp
id: Primary keyemail: Subscriber email (unique)subscribed_at: Subscription timestamp
POST /api/auth.php?action=register- Register new userPOST /api/auth.php?action=login- User loginPOST /api/auth.php?action=logout- User logout
GET /api/recipes.php- Get all recipesGET /api/recipes.php?featured=1- Get featured recipesGET /api/recipes.php?category=<id>- Get recipes by categoryPOST /api/recipes.php- Create new recipe (requires authentication)POST /api/delete_recipe.php- Delete recipe (owner only)GET /api/recipe_detail.php?id=<id>- Get recipe details
GET /api/categories.php- Get all categories
POST /api/rate_recipe.php- Rate a recipe (requires authentication)
POST /api/feature_recipe.php- Mark recipe as featured (owner only)
POST /api/newsletter.php- Subscribe to newsletter
-
Creating an Account
- Click "Login" or "Create Account" button
- Fill in the registration form
- Login with your credentials
-
Uploading a Recipe
- Click "Share Recipe" in the navigation
- Fill in recipe details:
- Title and category
- Description
- Ingredients (add multiple with amounts)
- Preparation steps
- Upload an image
- Click "Share Recipe" to publish
-
Browsing Recipes
- Scroll through all recipes on the homepage
- Use category filters to narrow down results
- Click "View Recipe" to see full details
-
Rating Recipes
- Open any recipe detail
- Click on the stars to rate (1-5 stars)
- Your rating is saved immediately
-
Managing Your Recipes
- Your recipes show a "Delete Recipe" button
- Click "Get Featured" to highlight exceptional recipes
- Featured recipes appear in the featured section
-
Adding New Features
- API endpoints are in the
/apidirectory - Frontend logic is in
app.js - Database functions are in
config/database.php
- API endpoints are in the
-
Customizing Styles
- Modify
styles.cssfor custom CSS - Tailwind utility classes are used throughout
- Update color scheme in both CSS and Tailwind classes
- Modify
-
Database Modifications
- Update table schemas in
config/database.php - Run
setup.phpto apply changes
- Update table schemas in
- Password hashing using PHP's
password_hash() - SQL injection prevention using prepared statements
- Session-based authentication
- File upload validation
- CSRF protection considerations
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Mobile browsers (iOS Safari, Chrome Mobile)
- Image uploads limited to standard web formats (JPG, PNG, GIF)
- No email verification for user registration
- Basic search functionality (full-text search not implemented)
- No recipe editing functionality
- Recipe editing functionality
- User profile pages
- Recipe comments and discussions
- Social sharing features
- Email notifications
- Advanced search with filters
- Recipe collections/favorites
- Print-friendly recipe view
- Ingredient shopping list generator
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.
For issues, questions, or suggestions:
- Email: [email protected]
- Create an issue in the repository
- Icons: Font Awesome
- CSS Framework: Tailwind CSS
- Fonts: System fonts for optimal performance
Special thanks to all contributors and the open-source community for making this project possible.
Enjoy cooking and sharing with FlavorShare! 🍳👨🍳👩🍳