This is a rebuild of the football team cards project of the updated JavaScript curriculum for the article collaboration between freeCodeCamp and MongoDB. It uses MongoDB Atlas for the database and Tailwind CSS for styling.
- Displays Footballers Based on the option selected (goalkeepers, defenders, midfielders, forwards)
- 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 Starter Branch of the Repository
git clone https://github.com/Ksound22/football-team-cards-php-rebuild.git
Or
gh repo clone Ksound22/football-team-cards-php-rebuild
-
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 of 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 footballers (players).mongo_atlas_setup.php
: MongoDB connection setup..env
: environment variables (not included in the repository).vendor/
: composer dependencies (not included in the repository).