Skip to content

caesar-team/caesar-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Caesar.Team server application

Here you can find all information needed to istall and run the Caesar.Team server appliction on your own.

Feel free to visit our Homepage

Requirements

Stack

  • PHP 7.4
  • PostgreSQL 9
  • RabbitMQ 3
  • Redis 5

Installation

1. Update .env:

  • Create a config file .env by .env.dist
cp .env.dist .env
  • Fill required values by instruction inside .env
  • Set DOMAIN_ADMIN_EMAIL this email used for registration domain admin

2. Generate the RSA keys for JWT:

mkdir -p var/jwt
openssl genrsa -out var/jwt/private.pem -aes256 4096
openssl rsa -pubout -in var/jwt/private.pem -out var/jwt/public.pem

Update JWT_PASSPHRASE setting in .env file

3. Start Containers and install dependencies

On Linux/Windows:

docker-compose up -d

On MacOS:

docker-sync-stack start

4. Install vendors

docker-compose exec php composer install

5. Run migrations, install required default fixtures

docker-compose exec php bin/console doctrine:migrations:migrate
docker-compose exec php bin/console doctrine:fixtures:load

6. Access to the admin panel:

Create and promote super admin user:

docker-compose exec php bin/console app:user:create [email protected] [email protected] password --super-admin

Promote an existing user:

docker-compose exec php bin/console fos:user:promote --super username ROLE_ADMIN

Available roles:

  • ROLE_ADMIN
  • ROLE_READ_ONLY_USER
  • ROLE_SUPER_ADMIN

7. Open project

Just go to http://localhost

8. Open API DOC

Auth by admin and go to http://localhost/api/doc

Tests

Run migrations

docker-compose exec php bin/console doctrine:migrations:migrate --env=test
docker-compose exec php bin/codecept build
docker-compose exec php bin/codecept run unit
docker-compose exec php bin/codecept run api

Contribution

PHP Static Analysis Tool

docker-compose exec php vendor/bin/phpstan analyse
docker-compose exec php vendor/bin/psalm --show-info=false

Coding standard

Using php-cs-fixer

docker-compose exec php vendor/bin/php-cs-fixer fix