Welcome to Galaxy DevKit! This guide will help you get up and running with the complete development framework for Stellar ecosystem.
Before you begin, make sure you have the following installed:
- Node.js 18+ - Download here
- npm or yarn - Package manager
- Git - Version control
- Supabase CLI - Install here
-
Clone the repository:
git clone https://github.com/galaxy-devkit/galaxy-devkit.git cd galaxy-devkit -
Install dependencies:
npm install
-
Bootstrap the monorepo:
npm run bootstrap
-
Start development:
npm run dev
Galaxy DevKit is organized as a monorepo with the following structure:
galaxy-devkit/
βββ packages/ # Core packages
β βββ core/ # Core functionality
β βββ contracts/ # Smart contracts
β βββ api/ # API packages
β βββ sdk/ # SDK packages
β βββ templates/ # Project templates
βββ tools/ # Development tools
βββ docs/ # Documentation
βββ examples/ # Example projects
βββ tests/ # Test suites
-
Create environment file:
cp .env.example .env
-
Configure environment variables:
# Galaxy API Configuration GALAXY_API_URL=http://localhost:3001 GALAXY_WEBSOCKET_URL=ws://localhost:3001 GALAXY_NETWORK=testnet # Supabase Configuration SUPABASE_URL=your-supabase-url SUPABASE_ANON_KEY=your-supabase-anon-key SUPABASE_SERVICE_ROLE_KEY=your-supabase-service-role-key # Stellar Configuration STELLAR_NETWORK=testnet STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org
-
Create Supabase project:
- Go to supabase.com
- Create a new project
- Get your project URL and API keys
-
Initialize Supabase:
supabase init
-
Start Supabase locally:
supabase start
-
Run migrations:
supabase db push
-
Build the CLI:
npm run build
-
Create a new project:
node tools/cli/dist/tools/cli/src/index.js create my-dapp --template basic
-
Or link the CLI globally:
cd tools/cli npm run build npm link cd ../..
-
Now you can use the
galaxycommand:galaxy create my-dapp --template basic
-
Navigate to project:
cd my-dapp -
Install dependencies:
npm install
-
Start development server:
npm run dev
-
Install Galaxy CLI globally:
npm install -g @galaxy/cli
-
Create a new project:
galaxy create my-dapp --template basic
-
Navigate to project:
cd my-dapp -
Install dependencies:
npm install
-
Start development server:
npm run dev
-
Create project directory:
mkdir my-dapp cd my-dapp -
Initialize project:
galaxy init --template basic
-
Install dependencies:
npm install
-
Start development:
npm run dev
A simple Stellar DApp with wallet connection and basic operations.
Features:
- Wallet connection
- Balance display
- Send payments
- Transaction history
A DeFi application with advanced features.
Features:
- Smart contracts
- Automated trading
- Liquidity management
- Price oracles
An NFT marketplace template.
Features:
- NFT creation
- Marketplace functionality
- Royalty management
- Metadata handling
An enterprise-grade application template.
Features:
- Multi-tenant architecture
- Advanced security
- Compliance features
- Analytics dashboard
-
Navigate to package:
cd packages/core/stellar-sdk -
Start development:
npm run dev
-
Run tests:
npm run test -
Build package:
npm run build
-
Create feature branch:
git checkout -b feature/my-feature
-
Make changes:
- Add new functionality
- Write tests
- Update documentation
-
Test changes:
npm run test npm run lint -
Commit changes:
git add . git commit -m "feat: add my feature"
-
Push changes:
git push origin feature/my-feature
# Run all tests
npm run test
# Run tests for specific package
cd packages/core/stellar-sdk
npm run test
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode
npm run test:watchtests/
βββ unit/ # Unit tests
β βββ stellar-sdk.test.ts
β βββ invisible-wallet.test.ts
β βββ automation.test.ts
βββ integration/ # Integration tests
β βββ api.test.ts
β βββ contracts.test.ts
β βββ sdk.test.ts
βββ e2e/ # End-to-end tests
β βββ wallet-flow.test.ts
β βββ payment-flow.test.ts
βββ setup.ts # Test setup
# Build all packages
npm run build
# Build specific package
cd packages/core/stellar-sdk
npm run build# Deploy to testnet
galaxy deploy --network testnet
# Deploy to mainnet
galaxy deploy --network mainnet
# Deploy specific contract
galaxy deploy --contract my-contract-
VS Code Extensions:
- TypeScript
- ESLint
- Prettier
- Stellar
-
Browser DevTools:
- Network tab for API calls
- Console for logs
- Application tab for storage
-
Stellar Laboratory:
-
Connection Issues:
- Check network configuration
- Verify API endpoints
- Check firewall settings
-
Build Issues:
- Clear node_modules
- Check TypeScript errors
- Verify dependencies
-
Test Issues:
- Check test environment
- Verify mocks
- Check test data
Now that you have Galaxy DevKit set up, here are some next steps:
-
Explore the Examples:
- Check out the
examples/directory - Run example projects
- Study the code
- Check out the
-
Read the Documentation:
-
Join the Community:
-
Contribute:
- Fork the repository
- Create a feature branch
- Submit a pull request
If you run into issues:
-
Check the Documentation:
- This getting started guide
- API reference
- SDK documentation
-
Search Issues:
-
Ask for Help:
Happy coding with Galaxy DevKit! π