Backend for a cards game.
Frontend in https://github.com/guizoxxv/actocards-app
- PHP v8.0.2
- Laravel v8.37.0
- PostgreSQL v13.2
- Docker v20.10.6
- docker-compose v1.28.6
- Composer v2.0.11
-
Clone or download this repository to your machine
-
Create two databases in
PostgreSQL
:actocards
andactocards_test
actocards_test
will be used for testing and must be referenced in the.env.testing
file inDB_DATABASE_TEST
- Copy the content of
.env.example
to a new file.env
cp .env.example .env
-
Provide your databases information to the
DATABASE
section in the.env
and.env.testing
-
Follow the steps in the
Common
section bellow -
Start the application
php artisan serve
-
Clone or download this repository to your machine
-
Create the containers
docker-compose up -d
The application will run on host port 8001 and the database on port 3001 by default.
- Access the
app
container
docker-compose exec app bash
- Copy the content of
.env.docker
to a new file.env
cp .env.docker .env
- Follow the steps in the
Common
section bellow
- Install the dependencies
composer install
- Generate the application key (used for cookies)
php artisan key:generate
- Run the migrations (create tables)
php artisan migrate
- Set permissions to write in the storage folder
sudo chmod -R 777 storage
Avoid using 777 permission in production.
Execute the following command in this project root directory to run the tests:
php artisan test