Skip to main content

Getting Started (Local Development)

This guide covers setting up BASTION for local development.

Prerequisites

ToolVersionNotes
Docker20+With Docker Compose v2
Node.js20+Use nvm — system Node is often too old
Rust toolchainLatest stableFor smart contract compilation

Clone the Repository

git clone https://github.com/VitalPointAI/Bastion.git
cd Bastion

Environment Setup

Copy the example environment file and configure it:

cp .env.example .env

Edit .env and set the required values:

  • LLM provider keys — at least one of: OPENAI_API_KEY, ANTHROPIC_API_KEY, or GOOGLE_API_KEY for AI agent functionality.
  • NEAR testnetNEAR_NETWORK_ID=testnet (default) and any contract-specific configuration.
  • Database credentials — defaults work for local Docker, but can be customized.

Start Services

docker-compose up

This starts:

ServicePortDescription
Frontend5173Vite dev server (React)
Backend3001Express API server
PostgreSQL5432Primary relational database
Neo4j7474 / 7687Graph database (RAFT entities)

Seed Data

Once services are running, seed the example scenario:

bash scripts/seed-scenario.sh

This populates the database with the Pacific Strategy AY26 exercise scenario including phases, documents, and initial conditions.

For graph data (RAFT entities and relationships):

bash scripts/seed-graph-data.sh

Access the Application

NEAR Testnet Configuration

BASTION connects to NEAR testnet by default. No local NEAR node is required — the backend communicates with the public testnet RPC endpoint.

To use a custom NEAR configuration, update these .env values:

NEAR_NETWORK_ID=testnet
NEAR_NODE_URL=https://rpc.testnet.near.org
NEAR_WALLET_URL=https://testnet.mynearwallet.com

Notes

  • Node.js version: If using nvm, activate the correct version before running any scripts: nvm use 20.
  • Database migrations: Migration SQL files are committed to the repository but must be executed on the target database after deploy. For local development, the seed scripts handle initial schema setup.
  • Production deployment: Production deployment automation (Phase 17) is not yet implemented. This guide covers local development only.