Stacked is a Solana mobile investment app that enables users to invest simply, securely, and on their terms. The app provides traditional and on-chain investment options with features including portfolio management, staking, validator interactions, and time-locked escrow functionality. Built with Expo, React Native, and Anchor smart contracts, Stacked offers a seamless mobile experience for managing Solana-based investments.
IMG_0042.1.mp4
First, navigate to the contracts directory and build the Anchor program:
cd contracts
anchor buildCreate a .env file in the root directory with the following variables:
REDIS_URL=redis://localhost:6379
PORT_POLLER=3001
PORT_WS_SERVER=3002
PROGRAM_ID=<your_program_id>
DEVNET_RPC_URL=https://api.devnet.solana.comNote: For local Redis using Docker, you can run:
docker run -d -p 6379:6379 redisThis will start Redis on redis://localhost:6379.
From the root directory, start the development servers:
bun run devThis will start the poller and WebSocket server services.
Navigate to the client app directory and install dependencies:
cd apps/client
pnpm iCreate a .env file in apps/client/ with the following environment variables:
EXPO_PUBLIC_WS_URL=ws://localhost:3002
EXPO_PUBLIC_SOLANA_RPC_URL=https://api.devnet.solana.comThe WebSocket URL should match the PORT_WS_SERVER from the root .env file.
Then, run the Android app:
pnpm run androidcontracts/- Anchor smart contractsapps/client/- Expo/React Native mobile clientapps/poller/- Background polling serviceapps/ws-server/- WebSocket server for real-time updatespackages/- Shared packages (config, db, types)