Skip to content

concretizza/accounts

Repository files navigation

Accounts

Responsibilities

  • Users
  • Subscriptions

Docs

The API definition can be found in the docs folder.

Environment variables

⚠️ Create .env file from the .env.example

Generate app key

php artisan key:generate

Storage

Set permissions to storage and public folders

chmod -R 777 storage public

Create symbolic link from storage to public folders

php artisan storage:link

Database

To create the tables

php artisan migrate

It will recreate and populate the tables

php artisan migrate:fresh --seed

Create migration

php artisan make:migration <name>

Alter migration specifying table

php artisan make:migration <name> --table=<table>

Tests

Running API tests

php artisan test

Running API tests specifying environment

php artisan test --env=testing

For integration tests use the --env=integrations

Update the .env with APP_ENV=integrations

Run tests using filter to specify tests to run

php artisan test --filter AddressTest

To create a test

php artisan make:test AddressTest

E2E tests

Setup is only necessary for a fresh application.

php artisan dusk:install

If already installed, we need to install the chrome driver.

php artisan dusk:chrome-driver

Run the E2E test using integrations environment

php artisan dusk --env=integrations

Queue

php artisan queue:table
php artisan migrate
php artisan queue:work --tries=3 --queue=default
php artisan queue:work --queue=default,high
php artisan queue:work --queue=default,high --timeout=900

Stripe

stripe listen --forward-to http://localhost:8000/api/payments/stripe/webhooks

Code style

./vendor/bin/pint

Email server

https://github.com/axllent/mailpit

Tags

Create a tag

git tag v0.0.1

Tag with comment

git tag -a v0.0.1 -m "Account, users and subscriptions"

Push the tag

git push origin v0.0.1

Push all at once

git push origin --tags

Show all or specific tag

git tag
git show v0.0.1

Delete tag

git tag -d v0.0.1

Private and public keys

Private key

openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048

Public key

openssl rsa -pubout -in private_key.pem -out public_key.pem

Redis

Check incoming messages

psubscribe *