This is a guide for new developers to start developing Phantom and other repositories. This guide will be fully fixated on Phantom hence other repositories might need some tweaks to work.
Phantom uses several stacks in order to work:
- Laravel 8.x
- PHP 7.4
- PostgresSQL 13.5
- Lando
Refer to this guide by Irfan for your local device setup : Virgin MacOS Guide
- Generate your SSL keys with
ssh-keygen -t ed25519 -b 4096 -C "{username@kestrl.io}" -f {your-name}
and paste it in your work BitBucket account.
- If you are logged in to your BitBucket, simply click this link.
- The easiest way to copy your SSL key is with this command
cat ~/.ssh/id_rsa.pub | pbcopy
.
- Clone your repository to your directory with
git clone git@bitbucket.org:kestrl/phantom.git
.
- Preferably your directory should be
/Users/{username}/workspace
.
- Test it out with
code .
at the directory.
- Navigate to it with
cd workspace
or your chosen directory.
- Proceed to copy
.env.example
in 'phantom' directory and paste it as your current.env
.
- In your
.env
, most of the details are pre-filled for you. However, certain sensitive keys and passwords are not available so you must request from other developers if needed.
- Now you must install and initialise Lando. First, run this command in your terminal.
brew install lando
. Lando's official download site. If there is an error regarding Docker, you may remove it from your/Applications
and re-run the command.
- Initialise Lando by running
lando start
in your terminal.
-
Lando will start building and running commands for you. To read more about Lando, please read it here.
-
Now, let's try and see whether Lando created the database correctly for you. Go ahead to Postico and fill in as the picture below.
- If there's an error, make sure your
.lando.yml
parameters are the same as.env
parameters. You may runlando info
for further information.
- Run
lando artisan phantom:custom-migration
for the true ultimate migration.
- Errors involved may require you to create schema phantom and ob_truelayer and re-run the migration
- To check if your local server is running as intended, go to
https://phantom.lndo.site/v1/status
.
- If it returns debug and 'Bob', you have successfully initialised your local development setup.
- When everything is finally done, you may start your local environment server with
lando start
and code away!
- Lando has already been initialised by your first time setup just now.
- Kestrl's developer Postman have collections ready-made for you with our own Postman account. Request it from our supportive group of developers.
- It might be outdated so use it at your own risk. It is better to write tests anyway.
- To generate client ID & client Secret, run
php artisan phantom:generate-api-client-with-secret
or if you are using Lando then runlando artisan phantom:generate-api-client-with-secret
. Paste it in your Postman Local environment accordingly.
- Install PHP Intelephense by Ben Mewburn in VS Code for better code visibility and PHP Namespace Resolver by Mehedi Hassan to import classes easily.
CHANGELOG
- 1 Mar 2023 : First write-up
- 2 Mar 2023 : Added phantom's repo deets and cosmetics
- 7 Mar 2023 : Added instructions for Postman use.
Done!