Skip to content

A simple Laravel-based Recipe Management App with user authentication, recipe CRUD, image uploads, user reviews, and password change functionality. Built using MongoDB and Query Builder for data handling. Clean and functional for learning and demonstration purposes.

Notifications You must be signed in to change notification settings

avijitca/recipe-app-laravel-mongodb

Repository files navigation

🍽️ Recipe Management App (Laravel + MongoDB)

A Laravel-based web application for managing and sharing recipes with full user authentication, CRUD operations, reviews, image uploads, and more. This app is built using Laravel with MongoDB as the backend database using the query builder.

Features

Authentication

  • User registration and login/logout using sessions
  • Custom authentication logic using Laravel’s Query Builder
  • Middleware to protect routes and restrict unauthenticated access

Recipe Management

  • Create, read, update, and delete (CRUD) recipes
  • Upload and store recipe images with validation
  • Display recipes in a paginated format on the homepage
  • Each recipe includes title, description, ingredients, and image

User Reviews

  • Logged-in users can leave reviews on recipes
  • Each review includes a rating and comment
  • Reviews are linked to users and recipes
  • MongoDB collection used to manage reviews separately

User Module

  • Admin can manage (CRUD) user accounts
  • Fields: name, email, and hashed password
  • Passwords stored securely using bcrypt hashing

Password Management

  • Logged-in users can change their password
  • Change password form includes: old password, new password, confirm password
  • Validation checks ensure old password matches before updating

Utilities

  • Helper function auth_user() to easily access session user data in views and controllers
  • Middleware for route protection
  • Flash messages for success/error handling

Tech Stack

  • Framework: Laravel
  • Database: MongoDB (via jenssegers/laravel-mongodb package)
  • Frontend: Blade templates, Bootstrap (optional)
  • Session: Laravel Session for user login tracking
  • Image Uploads: Laravel file system

Project Structure Highlights

  • routes/web.php – All routes defined here
  • app/Http/Controllers – Controllers for Recipes, Users, Reviews
  • resources/views – Blade templates for frontend
  • public/uploads – Stores uploaded recipe images

Requirements

  • PHP 8+
  • Composer
  • Laravel 10+
  • MongoDB server
  • Node.js (optional for compiling assets)

Setup Instructions

git clone https://github.com/your-username/recipe-app.git
cd recipe-app
composer install
cp .env.example .env
php artisan key:generate

Configure your MongoDB connection in .env:

DB_CONNECTION=mongodb
DB_HOST=127.0.0.1
DB_PORT=27017
DB_DATABASE=your_db_name

Serve the project:

php artisan serve

Contributions

Feel free to fork this repository and improve the app. Pull requests are welcome!

License

This project is open-sourced under the MIT License.

About

A simple Laravel-based Recipe Management App with user authentication, recipe CRUD, image uploads, user reviews, and password change functionality. Built using MongoDB and Query Builder for data handling. Clean and functional for learning and demonstration purposes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages