This is a portfolio web application built using Yii2's Advanced Application Template, developed as part of the Yii 2: From Beginner to Expert
The database dump, which includes both structure and data, can be found in the "database" directory.
To run the command "composer update", follow these steps:
-
Open your terminal or command prompt.
-
Navigate to the root directory of your project. You can use the "cd" command to change the directory. For example, if your project is located in the "C:\XAMPP\htdocs" directory, you can use the following command:
cd C:\XAMPP\htdocs
-
Once you are in the project directory, type "composer update" and press enter. This will start the process of updating your project dependencies.
composer update
-
Wait for the command to finish executing. It may take a few minutes to complete, depending on the size of your project and the number of dependencies.
-
After the command has completed, you should see a success message indicating that the dependencies have been updated.
In the project's root directory you should see a ".env.example" file. Rename this file to .env, since this web application relies on environment variables for setting up the database connection.
-
Execute the following command:
php init
-
Choose "0" for Development environment or "1" for Production environment, and press enter.
-
Type "yes" do confirm and press enter.
-
After the command has completed, you should see a success message indicating that the initialization has been completed.
-
Execute the following command to create the tables necessary to use RBAC (Role Based Access Control):
yii migrate --migrationPath=@yii/rbac/migrations
If you get an error, try adding "php" at the beginning of the command and press enter:
php yii migrate --migrationPath=@yii/rbac/migrations
-
Apply the app's migrations through the following command:
yii migrate
If you get an error, try adding "php" at the beginning of the command and press enter:
php yii migrate
-
Type "yes" to confirm, and press enter.
To import the database created during the course, please follow these steps:
- Open PHPMyAdmin in your web browser by visiting "http://localhost/phpmyadmin/" (assuming you have XAMPP installed on your local machine).
- In the left-hand panel, click on the database where you want to import the database dump file. If you haven't created a database yet, you can do so by clicking on the "Databases" tab and entering a name for the database.
- Once you are inside the database, click on the "Import" tab.
- Under the "File to import" section, click on the "Choose File" button and select the "database/portfolio.sql" file.
- Finally, click on the "Go" or "Import" button.
The database import process may take a few minutes, depending on the size of the database and the speed of your computer. Once the process is complete, you should see a success message indicating that the database has been imported successfully. If you encounter any issues during the import process, you can check the PHPMyAdmin error log for more information.
If you plan to use docker, don't forget to rename the docker-compose.example.yml file to docker-compose.yml after deploying this repository to your development or production environment.