Skip to content

Instantly share code, notes, and snippets.

@synysterash
Last active March 8, 2023 05:42
Show Gist options
  • Save synysterash/c47c33d9627d33334b27589d560390d7 to your computer and use it in GitHub Desktop.
Save synysterash/c47c33d9627d33334b27589d560390d7 to your computer and use it in GitHub Desktop.
Phantom First Time Setup

PHANTOM INITIAL SETUP

DOCUMENTATION

INITIALISATION

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

  1. 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.
  1. Clone your repository to your directory with git clone git@bitbucket.org:kestrl/phantom.git.
  • Preferably your directory should be /Users/{username}/workspace.
  1. Test it out with code . at the directory.
  • Navigate to it with cd workspace or your chosen directory.

Phantom Environment Setup

  1. 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.
  1. 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.
  1. Lando will start building and running commands for you. To read more about Lando, please read it here.

  2. 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.

Postico config

  • If there's an error, make sure your .lando.yml parameters are the same as .env parameters. You may run lando info for further information.
  1. 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
  1. 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.
  1. 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.

Optional

  1. 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 run lando artisan phantom:generate-api-client-with-secret. Paste it in your Postman Local environment accordingly.
  1. Install PHP Intelephense by Ben Mewburn in VS Code for better code visibility and PHP Namespace Resolver by Mehedi Hassan to import classes easily.

Make sure to read Phantom's docs too for initial setup such as Passport and coding conventions.

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.
Rev1.2
Kestrl LTD
@synysterash
Copy link
Author

  • provide link to Lando installation please
  • provide link to Phantom's repository and cloning instructions

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment