Dev Env Setup
for API and Client Apps

Configuration for your local or codespaces development environment.

Prerequisites

Addnl Prereq for Local Dev

Dev Env Setup

Local Development

  1. Clone the repository:
    git clone https://github.com/Great-Sun-Group/credex-core.git
    cd credex-core
  2. Create a .env file in the root of the project based on .env.example and fill in the required environment variables (see below).
  3. git checkout -b new-branch-name to start local development

Using Devcontainers with VS Code

Devcontainers provide a consistent, reproducible development environment across different machines. This project is set up to use devcontainers, which encapsulate the development environment in a Docker container.

To use devcontainers:

  1. Ensure you have the "Remote - Containers" extension installed in VS Code.
  2. Open the project folder in VS Code.
  3. When prompted, click "Reopen in Container" or use the command palette (F1) and select "Remote-Containers: Reopen in Container".
  4. VS Code will build the devcontainer (this may take a few minutes the first time) and open the project inside the container.

GitHub Codespaces

  1. Go to your personal GitHub Settings -> Codespaces and Add New Secret for each secret listed below, giving it access to the credex-core repository.
  2. Go to the main page of the credex-core repository (dev branch), and create a new branch from dev, or from the branch of the project you are contributing to.
  3. Within the new branch, click on the "Code" button, select the "Codespaces" tab, and click "Create codespace on new-branch-name".
  4. The Codespace will automatically set up the environment within the devcontainer.

Benefits of Devcontainers

Locally, you can use VS Code's "Attach to Running Container" feature to work within the Docker container, or use docker exec to access the container's shell.

Environment Variables

NEO_4J_LEDGER_SPACE_BOLT_URL
NEO_4J_LEDGER_SPACE_PASS
NEO_4J_LEDGER_SPACE_USER
NEO_4J_SEARCH_SPACE_BOLT_URL
NEO_4J_SEARCH_SPACE_PASS
NEO_4J_SEARCH_SPACE_USER

OPEN_EXCHANGE_RATES_API

JWT_SECRET

CLIENT_API_KEY

For development environments, the NODE_ENV variable defaults to 'development'.