alexohre/Nestera

โ˜… 0Forks 0TypeScriptGitHub โ†—Compare

Project website โ†—

README

Nestera

Decentralized Savings & Investment Platform on Stellar

Nestera is a decentralized savings and investment protocol built on Stellar using Soroban smart contracts. It enables individuals and communities to save transparently using stablecoins, with flexible, locked, goal-based, and group savings mechanisms enforced fully on-chain.

The project solves the problem of opaque, centralized savings platforms in emerging markets by providing a non-custodial, transparent alternative where users maintain full control of their funds. Nestera is designed for developers, contributors, and financial communities interested in building open, composable savings infrastructure using low-fee, fast-finality blockchain primitives.


๐Ÿš€ Core Features

  • Non-custodial savings via Soroban smart contracts
  • Flexible and locked savings with deterministic interest logic
  • Goal-based savings with automated milestones
  • Group savings pools with shared rules and governance
  • Native USDC-based savings on Stellar testnet
  • Web interface for seamless contract interaction

๐Ÿ— Architecture Overview

  • Frontend (apps/web)
    Next.js application for interacting with Nestera smart contracts. Provides user interface for creating savings accounts, depositing funds, and tracking progress.

  • Backend (apps/api)
    Node.js API for off-chain services such as indexing contract events, sending notifications, managing user metadata, and aggregating analytics.

  • Smart Contracts (contracts/)
    Soroban smart contracts written in Rust that manage all savings logic, fund custody, interest calculations, and withdrawal rules.


๐Ÿ“ Repository Structure

/
โ”œโ”€โ”€ apps/
โ”‚   โ”œโ”€โ”€ web/              # Next.js frontend
โ”‚   โ””โ”€โ”€ api/              # Node.js backend API
โ”œโ”€โ”€ contracts/            # Soroban smart contracts (Rust)
โ”œโ”€โ”€ packages/             # Shared utilities and types
โ”œโ”€โ”€ scripts/              # Deployment and automation scripts
โ”œโ”€โ”€ tests/                # Integration and E2E tests
โ””โ”€โ”€ README.md

๐Ÿ›  Setup Instructions

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v18 or higher) - Download
  • npm or yarn - Comes with Node.js
  • Rust (stable toolchain) - Install
  • Soroban CLI - Instructions below
  • Stellar testnet account - We'll create this in setup

Installation Overview

  1. Clone the repository
  2. Set up smart contracts
  3. Set up backend API
  4. Set up frontend
  5. Run tests

๐Ÿ“ฆ 1. Clone the Repository

git clone https://github.com/your-org/nestera.git
cd nestera

๐Ÿ”— 2. Smart Contracts Setup (Soroban)

Install Soroban CLI

cargo install --locked stellar-cli --features opt

Or use the install script:

curl -fsSL https://github.com/stellar/stellar-cli/raw/main/install.sh | sh

Verify installation:

stellar --version

Configure Stellar Testnet

stellar network add --global testnet \
  --rpc-url https://soroban-testnet.stellar.org:443 \
  --network-passphrase "Test SDF Network ; September 2015"

Generate Identity & Fund Account

stellar keys generate --global alice --network testnet

Get your address:

stellar keys address alice

Fund your account using Friendbot:

curl "https://friendbot.stellar.org?addr=$(stellar keys address alice)"

Verify balance:

stellar account balance --id alice --network testnet

Build Contracts

cd contracts
cargo build --target wasm32-unknown-unknown --release

Deploy Contracts

stellar contract deploy \
  --wasm target/wasm32-unknown-unknown/release/nestera_contract.wasm \
  --source alice \
  --network testnet

Save the contract ID output - you'll need it for frontend and backend setup.

Initialize Contract (if required)

stellar contract invoke \
  --id YOUR_CONTRACT_ID \
  --source alice \
  --network testnet \
  -- initialize \
  --admin $(stellar keys address alice)

๐Ÿ–ฅ 3. Backend Setup (Node.js API)

cd apps/api
npm install

Create Environment File

Create .env in apps/api/:

PORT=3001
NODE_ENV=development

# Stellar Network
STELLAR_NETWORK=testnet
SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
HORIZON_URL=https://horizon-testnet.stellar.org

# Contract
CONTRACT_ID=YOUR_DEPLOYED_CONTRACT_ID

# Database (if using)
DATABASE_URL=postgresql://user:password@localhost:5432/nestera

# Optional
REDIS_URL=redis://localhost:6379

Run Database Migrations (if applicable)

npm run migrate

Start Backend Server

npm run dev

Backend should now be running at http://localhost:3001

Verify Backend

curl http://localhost:3001/health

๐ŸŒ 4. Frontend Setup (Next.js)

cd apps/web
npm install

Create Environment File

Create .env.local in apps/web/:

# Stellar Network
NEXT_PUBLIC_STELLAR_NETWORK=testnet
NEXT_PUBLIC_SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
NEXT_PUBLIC_HORIZON_URL=https://horizon-testnet.stellar.org

# Contract
NEXT_PUBLIC_CONTRACT_ID=YOUR_DEPLOYED_CONTRACT_ID

# Backend API
NEXT_PUBLIC_API_URL=http://localhost:3001

# Wallet Connect (optional)
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=your_project_id

Run Development Server

npm run dev

Frontend should now be running at http://localhost:3000

Build for Production

npm run build
npm start

๐Ÿงช 5. Running Tests

Contract Tests

cd contracts
cargo test

Backend Tests

cd apps/api
npm test

Run with coverage:

npm run test:coverage

Frontend Tests

cd apps/web
npm test

Run E2E tests (requires running backend and deployed contracts):

npm run test:e2e

Integration Tests

From project root:

npm run test:integration

๐ŸŒ Network Configuration

Testnet

  • Network Passphrase: Test SDF Network ; September 2015
  • RPC URL: https://soroban-testnet.stellar.org:443
  • Horizon URL: https://horizon-testnet.stellar.org
  • Friendbot: https://friendbot.stellar.org

Contract Addresses (Testnet)

  • Main Savings Contract: CXXXXXX... (Update after deployment)
  • USDC Token: CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA

๐Ÿ› Troubleshooting

Contract Deployment Fails

Error: insufficient balance

Solution: Fund your account using Friendbot:

curl "https://friendbot.stellar.org?addr=$(stellar keys address alice)"

Frontend Can't Connect to Wallet

Error: Failed to connect wallet

Solution:

  1. Ensure you have Freighter wallet installed
  2. Switch wallet to Testnet network
  3. Check that NEXT_PUBLIC_STELLAR_NETWORK=testnet in .env.local

Backend Can't Index Events

Error: RPC connection timeout

Solution:

  1. Verify RPC URL is correct in .env
  2. Check Stellar testnet status: https://status.stellar.org
  3. Try alternative RPC: https://soroban-testnet.stellar.org:443

Contract Build Fails

Error: wasm32-unknown-unknown target not found

Solution: Add wasm target:

rustup target add wasm32-unknown-unknown

Tests Failing

Error: Network connection error

Solution: Ensure contracts are deployed and environment variables are set correctly in test config.


๐Ÿ“š Documentation & Resources


๐Ÿค Contributing

We welcome contributions from the community! Here's how you can help:

Getting Started

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Follow the setup instructions above
  4. Make your changes
  5. Write/update tests
  6. Ensure all tests pass (npm test in relevant directory)
  7. Commit your changes (git commit -m 'Add amazing feature')
  8. Push to your branch (git push origin feature/amazing-feature)
  9. Open a Pull Request

Coding Standards

  • Rust (Contracts): Follow Rust standard formatting (cargo fmt)
  • TypeScript (Frontend/Backend): Use ESLint and Prettier configs provided
  • Commits: Use conventional commits (e.g., feat:, fix:, docs:)
  • Tests: Write tests for new features and bug fixes

Pull Request Guidelines

  • Provide clear description of changes
  • Reference any related issues
  • Ensure CI checks pass
  • Update documentation if needed
  • Add screenshots for UI changes

Communication


๐Ÿ—บ Roadmap

Current Phase (Q1 2026)

  • โœ… Core savings contract
  • โœ… Basic web interface
  • ๐Ÿšง Group savings pools
  • ๐Ÿšง Interest calculation optimization

Next Phase (Q2 2026)

  • Goal-based savings UI
  • Notification system
  • Mobile app (Flutter)
  • Mainnet deployment

Future

  • Cross-chain savings
  • Yield strategies integration
  • DAO governance
  • Advanced analytics dashboard

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • Stellar Development Foundation for Soroban platform
  • Drips Wave for grants and support
  • Open-source contributors and testers

๐Ÿ“ž Support

Need help? Here's how to get support:

  1. Check the Troubleshooting section
  2. Search existing issues
  3. Open a new issue with detailed information
  4. Join our Discord community (if available)

Built with โค๏ธ on Stellar

Contributors

Devsol-01Olowodareycaxtonacollinstech-adriannayt9Folex1275OthmanImamGoodnessukaigweteethakingNo-bodyqBenalex8797pope-hwisdom-deeOsagieCynthiaEmeka000JoewizyBhenzdizmaOtowoSamuelalexohredinahmaccodesDemilade01DokaIzkJunirezzSudiptaPaul-31jahrulezfrancismiss-yusrahMerlinTheWhizHexstar-labsshimonenatorJayWebtech

Issues