This project is a simple Movie Rentals application that provides a backend API built with Laravel and a frontend built with React using Vite. The application includes functionality for managing movies, placing orders, and calculating total costs based on movie tags.
- PHP >= 8.1
- Composer
- Node.js and npm
- SQLite (or another supported database)
- Initial clone
git clone git@github.com:MyTek/movie_rentals.git cd movie_rentals
- Install PHP dependencies:
composer install
- Install JavaScript dependencies:
npm install
- This creates files for caching and logs and other things
php artisan optimize
- Run migrations to create the necessary tables:
php artisan migrate
- Seed the database with sample data:
php artisan db:seed
- Start the Laravel backend in one terminal:
php artisan serve --port=8550
- Start the Vite development server for the frontend IN ANOTHER TERMINAL:
npm run dev
- Open your browser and navigate to:
- Frontend: http://localhost:8550 (or the port shown by
npm run dev
) - Backend API: http://localhost:8550/api
- Frontend: http://localhost:8550 (or the port shown by
- Open another terminal while the backend server is running and run the PHPUnit tests to ensure everything works as expected:
php artisan test
- Manage movies with adjustable pricing based on tags.
- Place orders for movies with automatic total cost calculation.
- API documentation (optional) for available endpoints.
- This project has lots of extra files in it and currently the only working one is at root.
- Make sure to update the
.env
file for your specific environment, such as database credentials. - For production deployment, ensure proper configurations for environment variables and use optimized commands:
php artisan config:cache php artisan route:cache php artisan view:cache npm run build
Enjoy working with the Movie Rentals project! 🎥🍿