For Developers
instructions on installing the app
Prerequisites
Node.js (Latest LTS version)
Docker and Docker Compose
Git
MongoDB
Redis
Installation Steps
Clone the Repository
git clone [repository-url]
cd sshift-gpt-app
Environment Setup Create a
.env
file in the root directory with the following required variables (replace with your values):
# Database Configuration
REDIS_PWD=your_redis_password
REDIS_HOST=sshift_redis_db
MONGO_USER=your_mongo_user
MONGO_PWD=your_mongo_password
MONGO_URI=your_mongodb_uri
# API Keys
OPENAI_API_KEY=your_openai_api_key
PERPLEXITY_API_KEY=your_perplexity_api_key
CMC_API_KEY=your_cmc_api_key
INDEXER_API_KEY=your_indexer_api_key
ELVEN_API_KEY=your_eleven_labs_api_key
ELFA_API_KEY=your_elfa_api_key
HANDLE_FINDER_API_KEY=your_handle_finder_api_key
# Application Settings
MULT_RUN_ENV=prod
JWT_SECRET_KEY=your_jwt_secret_key
API_BACKEND_URL=http://localhost:3100/chat-api
URI_TOOLS=http://localhost:3400
# Blockchain Configuration
NEXT_PUBLIC_MODULE_ADDRESS=0x28af3805f23612b4dfa86202a454f5144159702559aea86393ac0d50f577568d
NEXT_PUBLIC_DECIMAL_COIN=8
NEXT_PUBLIC_QRIBBLE_NFT_ADDRESS=0x8d5a1831c9bfeb3dcf9b370eee38cee4a524624c4f3c369eb99f42b365799c42
NEXT_PUBLIC_SSHIFT_RECORD_ADDRESS=0xfce62045f3ac19160c1e88662682ccb6ef1173eba82638b8bae172cc83d8e8b8
NEXT_PUBLIC_APTOS_NETWORK=testnet
NEXT_PUBLIC_APTOS_NODE_URL=https://aptos.testnet.bardock.movementlabs.xyz/v1
NEXT_PUBLIC_APTOS_INDEXER=https://indexer.testnet.movementnetwork.xyz/v1/graphql
# API Endpoints
PERPLEXITY_BASE_URL=https://api.perplexity.ai/chat/completions
CMC_BASE_URL=https://pro-api.coinmarketcap.com/v1
INDEXER_URL=https://api.indexer.xyz/graphql
ELEVENLABS_URL=https://api.elevenlabs.io/v1/sound-generation
WIKI_URL=https://en.wikipedia.org/w/api.php
ARXIV_URL=http://export.arxiv.org/api/query
HANDLE_FINDER_BASE_URL=https://handle-finder-api-dev-r24j3.ondigitalocean.app/handle-finder-api
ELFA_BASE_URL=https://api.elfa.ai/v1
# Authentication
PROJECT_ID=project_id
AUTH_URI=auth-uri
TOKEN_URI=token_uri
AUTH_PROVIDER_X509_CERT_URL=auth_certs
CLIENT_X509_CERT_URL=client_certs
# Additional Settings
INDEXER_USER_ID=indexer_user_id
HANDLE_FINDER_ADDRESS=handle_finder_address
# Community Links
NEXT_PUBLIC_DISCORD_URL=discord_url
NEXT_PUBLIC_TELEGRAM_URL=telegram_url
# Google Cloud Storage (Base64 encoded service account key)
STORAGE_CREDENTIALS=your_base64_encoded_service_account_credentials
Install Dependencies
npm install
Development Setup
Option A: Using Docker (Recommended)
docker-compose up
Option B: Manual Setup
# Start the frontend
npm run fn-chat:dev
# In a new terminal, start the backend
npm run bn-chat:dev
# In a new terminal, start the tools API
npm run tools-api:dev
Build for Production
npm run build
Run Production
npm run prod
Accessing the Application
Frontend: http://localhost:3000
Backend API: http://localhost:3100
Tools API: http://localhost:3400
Additional Notes
Database Setup
MongoDB and Redis will be automatically set up if using Docker
If running manually, ensure MongoDB and Redis are running locally
Blockchain Integration
Make sure you have the Pontem Wallet browser extension installed for Aptos blockchain interaction
The application is configured to work with the Aptos testnet by default
API Keys
Obtain necessary API keys for OpenAI and other integrated services
Update the
.env
file with your API keys
Troubleshooting
If you encounter any port conflicts, modify the port mappings in
docker-compose.yml
For database connection issues, verify your MongoDB and Redis credentials
Check the logs using
docker-compose logs
if running with Docker
Development Tools
The project uses NX for monorepo management
TypeScript is used throughout the project
Tailwind CSS is used for styling
Security Considerations
Never commit the
.env
fileKeep your API keys secure
Use strong passwords for database access
Follow Aptos blockchain security best practices
Would you like me to elaborate on any of these steps or provide more specific information about any part of the setup process?
Last updated