Skip to content

Backend for a cards game. Build with PHP 8, Laravel 8 and PostgreSQL 13.

Notifications You must be signed in to change notification settings

guizoxxv/actocards-api

Repository files navigation

ACTOCARDS API

Backend for a cards game.

Frontend in https://github.com/guizoxxv/actocards-app

Tools

Installation

Using local machine

  1. Clone or download this repository to your machine

  2. Create two databases in PostgreSQL: actocards and actocards_test

actocards_test will be used for testing and must be referenced in the .env.testing file in DB_DATABASE_TEST

  1. Copy the content of .env.example to a new file .env
cp .env.example .env
  1. Provide your databases information to the DATABASE section in the .env and .env.testing

  2. Follow the steps in the Common section bellow

  3. Start the application

php artisan serve

Using docker

  1. Clone or download this repository to your machine

  2. Create the containers

docker-compose up -d

The application will run on host port 8001 and the database on port 3001 by default.

  1. Access the app container
docker-compose exec app bash
  1. Copy the content of .env.docker to a new file .env
cp .env.docker .env
  1. Follow the steps in the Common section bellow

Common

  1. Install the dependencies
composer install
  1. Generate the application key (used for cookies)
php artisan key:generate
  1. Run the migrations (create tables)
php artisan migrate
  1. Set permissions to write in the storage folder
sudo chmod -R 777 storage

Avoid using 777 permission in production.

Testing

Execute the following command in this project root directory to run the tests:

php artisan test

About

Backend for a cards game. Build with PHP 8, Laravel 8 and PostgreSQL 13.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages