- Created .gitignore to exclude sensitive files and directories. - Added API documentation in API_DOCUMENTATION.md. - Included deployment instructions in DEPLOYMENT.md. - Established project structure documentation in PROJECT_STRUCTURE.md. - Updated README.md with project status and team information. - Added recommendations and status tracking documents. - Introduced testing guidelines in TESTING.md. - Set up CI workflow in .github/workflows/ci.yml. - Created Dockerfile for backend and frontend setups. - Added various service and utility files for backend functionality. - Implemented frontend components and pages for user interface. - Included mobile app structure and services. - Established scripts for deployment across multiple chains.
3.8 KiB
3.8 KiB
ASLE Setup Guide
Complete setup instructions for the ASLE platform.
Prerequisites
- Node.js 18+ and npm
- PostgreSQL 14+
- Redis (optional, for caching)
- Docker and Docker Compose (optional)
Quick Start
1. Clone and Install
# Install backend dependencies
cd backend
npm install
# Install frontend dependencies
cd ../frontend
npm install
2. Database Setup
cd backend
# Copy environment file
cp .env.example .env
# Edit .env with your database credentials
# DATABASE_URL="postgresql://user:password@localhost:5432/asle"
# Generate Prisma client
npm run prisma:generate
# Run migrations
npm run prisma:migrate
# Initialize database with default configs
npm run setup:db
# Create initial admin user
npm run setup:admin
3. Environment Configuration
Edit backend/.env with your configuration:
Required:
DATABASE_URL- PostgreSQL connection stringJWT_SECRET- Secret key for JWT tokens (use strong random string)DIAMOND_ADDRESS- Deployed Diamond contract addressRPC_URL- Ethereum RPC endpoint
Optional (for push notifications):
FIREBASE_SERVICE_ACCOUNT- Firebase service account JSONONESIGNAL_APP_IDandONESIGNAL_API_KEY- OneSignal credentialsAWS_SNS_IOS_ARNandAWS_SNS_ANDROID_ARN- AWS SNS platform ARNsFCM_SERVER_KEY- Firebase Cloud Messaging server keyAPNS_KEY_ID,APNS_TEAM_ID,APNS_KEY_PATH- Apple Push Notification credentials
Optional (for KYC/AML):
- Provider API keys (Sumsub, Onfido, Jumio, Veriff, Persona, Chainalysis, Elliptic, CipherTrace, TRM)
4. Start Services
Backend:
cd backend
npm run dev
Frontend:
cd frontend
npm run dev
5. Access Applications
- Frontend: http://localhost:3000
- Backend API: http://localhost:4000
- Admin Dashboard: http://localhost:3000/admin
- User DApp: http://localhost:3000/dapp
- GraphQL Playground: http://localhost:4000/graphql
Production Deployment
1. Build
# Backend
cd backend
npm run build
# Frontend
cd ../frontend
npm run build
2. Environment Variables
Set all environment variables in your production environment. Use a secret management service (AWS Secrets Manager, HashiCorp Vault) for sensitive values.
3. Database Migration
cd backend
npm run prisma:migrate deploy
4. Run
# Backend
cd backend
npm start
# Frontend
cd frontend
npm start
Docker Deployment
# Build and start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
Admin Setup
Create Admin User
cd backend
npm run setup:admin
Follow the prompts to create your first admin user.
Login
- Navigate to http://localhost:3000/admin/login
- Enter your admin credentials
- Access the admin dashboard
Testing
Backend Tests
cd backend
npm test
npm run test:watch
npm run test:coverage
Frontend Tests
cd frontend
npm test
Troubleshooting
Database Connection Issues
- Verify PostgreSQL is running
- Check
DATABASE_URLin.env - Ensure database exists:
CREATE DATABASE asle;
Migration Issues
# Reset database (WARNING: deletes all data)
npm run prisma:migrate reset
# Create new migration
npm run prisma:migrate dev --name migration_name
Port Already in Use
Change PORT in .env or kill the process using the port:
# Find process
lsof -i :4000
# Kill process
kill -9 <PID>
Next Steps
- Configure push notification providers
- Set up KYC/AML provider credentials
- Deploy smart contracts
- Configure white-label instances
- Set up monitoring and alerting
Support
For issues or questions, see: