This is a simple PHP CRUD application for the article collaboration between freeCodeCamp and MongoDB. It uses MongoDB Atlas for the database and Tailwind CSS for styling.
- Create, read, update, and delete movies
- Styling with Tailwind CSS
- Uses MongoDB Atlas for database management
Before you begin, ensure you have the following installed on your machine:
- PHP 8+
- Composer
- MongoDB PHP extension
-
Clone the Repository
git clone https://github.com/Ksound22/crud-app-for-php-fcc-article.git cd movie-list-crud-app
-
Ensure MongoDB extension is Enabled
Make sure the MongoDB PHP extension is installed and enabled. You can install it using PECL:
sudo pecl install mongodb
Then, add the following line to your php.ini file:
extension=mongodb.so
-
Install Dependencies
composer install
-
Create a
.env
File Off the Existing.env.example
File in the Root and add your Atlas URI, A.K.A Connection StringCreate .env file
cp .env.example .env
Add your Mongo URI
MDB_URI="mongodb atlas connection string"
-
Start the PHP Built-in Server
php -S localhost:port-number
index.php
: the main page that lists all movies.create.php
: the page to create a new movie.update.php
: the page to update an existing movie.delete.php
: the page to delete a movie.mongo_atlas_setup.php
: MongoDB connection setup..env
: environment variables (not included in the repository).vendor/
: composer dependencies (not included in the repository).