@defai/api
v1.0.1
Published
DEFAI API service for estate management and notifications
Readme
@defai/api
DEFAI API service for estate management and notifications.
Installation
npm install @defai/apiUsage
As a module
const { server, config, services } = require('@defai/api');
// Access configuration
console.log(config.apiBaseUrl);
// Use services
const { logger, solanaService } = services;As a standalone server
# Clone the repository
git clone https://github.com/defaiza/api.git
cd api
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Edit .env with your configuration
# Run the server
npm startEnvironment Variables
MONGODB_URI- MongoDB connection stringAPI_BASE_URL- Base URL for the API (default: https://api.defai.gg)CORS_ORIGINS- Comma-separated list of allowed CORS originsSOLANA_RPC_URL- Solana RPC endpointNODE_ENV- Environment (development/production)PORT- Server port (default: 3001)
API Endpoints
/api/auth- Authentication endpoints/api/billing- Billing and subscription management/api/estates- Estate management/api/tenants- Tenant management/api/profile- User profile management
Development
# Run in development mode
npm run dev
# Run linter
npm run lint
# Run type checking
npm run type-check
# Run tests
npm testLicense
MIT
