Skip to Content
Working locally

Working locally

End goal

By the end of the setup you should have both the web-app and the middleware running on your laptop:

Web app
Middleware

Prerequisites

You should have these installed on your work computer:

NameDescription
Node.jsFor running web-app locally
Docker

For performing docker commands on your machine

Docker Desktop

Docker Desktop or an alternative Docker image runner

EDR solution your machine

Endpoint Detection & Response.

Personally I recommend Microsoft Defender for Business + Microsoft Company Portal + Microsoft Intune.

Alternatives:

  • CrowdStrike Falcon
  • Kaspersky Endpoint Detection & Response
VPN

You will have to whitelist an IP address to Creditonline, so your VPN has to support dedicated IP addresses.

Steps

Clone repositories

Make sure your GitHub account has 2FA enabled.
  1. Go to: https://github.com/orgs/BeMyBond-Organization/repositories 
  2. Clone all of the repositories to a single folder on your machine, for example ~/bemybond
  3. Open the whole folder with an IDE.

Get access to Creditonline

  1. Get a personal account access from BeMyBond team.
  2. Get an API key from the password manager.
  3. Start your EDR.
EDR Local

Remember that while working with Creditonline you have to have an EDR solution running. More info in the Prerequisites section.

  1. Creditonine has a firewall, so you will have to whitelist your IP address of the VPN you’re using and have the VPN running.

  2. You can do this here:

Stage: https://bemybond2-lt.egroup.eu/admin.php?e=4&edit=11:api-users&nid=1 

Production: https://bemybond-lt.creditonline.eu/admin.php?e=4&edit=11:api-users&nid=1 

Start middleware locally

  1. Open a terminal

  2. cd bemybond/middleware - go to the location where you cloned the middleware project on your machine

  3. Copy .env.local.template to .env.local

  4. Add your CREDIT_ONLINE_API_KEY you got from the earlier step.

  5. Start Docker Desktop

  6. Start ./shell/docker-setup.sh. This will prepare the resources for local development.

If you run into problems while running the script, remember that it is constructed of simple shell commands that you can run yourself sequentially. You don’t have to run the whole script. You can run one command at a time and make the needed changes for your local setup.

  1. After successful start, you can visit the local middleware environment listed in Environments

  2. To load the projects for the /api/projects endpoint run docker-compose exec app php bin/console app:sync-client-cache-batched project

    This will trigger a background job to load the projects from Creditonline. Note that it may take a while as there’re hundreds of projects on staging.

Start Web app locally

  1. Open a terminal
  2. cd bemybond/web-app - go to the location where you cloned the middleware project on your machine
  3. Copy env.template to env
  4. Run npm install then npm run dev
  5. After successful start, you can visit the local Web app environment listed in Environments

That’s it!

Happy coding, next you can read about Git Flow.

Last updated on