This is a simple PHP project using clear php without any framework.
To run this project locally, follow these steps:
-
Clone the repository to your local machine:
git clone git@github.com:yurez/testclearphp.git
-
Navigate to the project directory:
cd testclearphp -
Copy
.env.distto.envand update it -
Build the Docker container:
docker-compose -f docker/docker-compose.yml build
-
Start the Docker container:
docker-compose -f docker/docker-compose.yml up -d
-
Run composer install
docker exec -it testclearphp composer install -
Run database migrations
docker exec -it testclearphp ./bin/run_migrations.sh -
Update
/etc/hoststo add127.0.0.1 testclearphp -
Open your web browser and visit http://testclearphp/ to access the application
The TestClearPhp project includes the following features:
- User registration and login functionality.
- User authentication and session management using PHP sessions.
- User data persistence with a MySQL database using Docker.
The project follows a simple PHP project structure:
src/: Contains all PHP source code files, including controllers, models, and services.public/: Contains the publicly accessible files, such as the front-end assets and index.php file.config/: Contains configuration files, such as routes.php, security.php, and services.php.docker/: Contains the Docker-related files, such as the Dockerfile and docker-compose.yml.
To run the PHPUnit tests for this project, run the following command:
docker exec -it testclearphp ./vendor/bin/phpunit