- Node.js 20+
- pnpm 9+
- PostgreSQL 16+
- Redis 7+
The easiest way to get started is using Docker Compose:
# Start all services
docker-compose up -d
# Run migrations
docker-compose exec backend pnpm prisma migrate deploy
# Verify it's running
curl http://localhost:3000/healthpnpm installCopy the example environment file:
cp .env.example .env.localConfigure the following variables:
DATABASE_URL: PostgreSQL connection stringREDIS_URL: Redis connection stringSTELLAR_NETWORK: Set totestnetfor developmentSTELLAR_HORIZON_URL: Stellar horizon endpointSTELLAR_SERVER_SECRET_KEY: Your server's Stellar secret keyJWT_SECRET: JWT signing secret (change in production)
Initialize Prisma:
pnpm prisma:generateRun migrations:
pnpm prisma:migrate devpnpm devThe server will start on http://localhost:3000
pnpm testpnpm test:watchpnpm test -- integrationpnpm test -- --coveragepnpm lintpnpm lint -- --fixpnpm formatpnpm buildpnpm startdocker build -t Dorisio-backend:latest .docker run -p 3000:3000 \
-e DATABASE_URL="postgresql://user:pass@host:5432/db" \
-e REDIS_URL="redis://host:6379" \
Dorisio-backend:latestpnpm prisma migrate dev --name migration_namepnpm prisma migrate resetpnpm prisma:studio- Visit https://laboratory.stellar.org
- Create a new account or use your existing keypair
- Add your secret key to
.env.local:
STELLAR_SERVER_SECRET_KEY=your_secret_key_here
- Get testnet lumens from https://friendbot.stellar.org
curl -X POST http://localhost:3000/api/v1/wallet/nonce \
-H "Authorization: Bearer your_jwt_token" \
-H "Content-Type: application/json" \
-d '{"publicKey":"GBBD47AB2EB00E041B61C1B7AD184E687E24658D52EDFFDD118F5E6221D60EFF"}'See API.md for endpoint documentation.
Ensure PostgreSQL is running and the DATABASE_URL is correct:
psql $DATABASE_URLEnsure Redis is running on the configured port:
redis-cli pingRegenerate the Prisma client:
pnpm prisma:generateChange the PORT in .env.local:
PORT=3001
- Create a feature branch
- Make your changes
- Run tests:
pnpm test - Run linter:
pnpm lint - Commit with descriptive messages
- Push and create a pull request
- Use database indexes for frequently queried fields
- Enable Redis caching for read-heavy operations
- Monitor query performance with
EXPLAIN ANALYZE - Use pagination for large result sets
- Keep environment variables in
.env.local(never committed)
- Change JWT_SECRET in production
- Use strong database passwords
- Enable HTTPS in production
- Rotate API keys regularly
- Use environment variables for secrets
- Enable rate limiting
- Validate all user inputs
- Use CORS carefully
- Keep dependencies updated
- Monitor error logs for suspicious activity
For issues or questions:
- Check existing documentation
- Review error logs
- Check GitHub issues
- Contact the development team