Backend API server for the MentorMinds Stellar platform, built with Node.js, Express, TypeScript, and PostgreSQL.
- RESTful API with Express.js
- TypeScript for type safety
- PostgreSQL database with connection pooling
- Stellar SDK integration for blockchain operations
- JWT Authentication for secure user sessions
- Input Validation with Zod
- Security with Helmet and CORS
- Logging with Morgan
- Environment Configuration with dotenv
- Node.js 18+ and npm
- PostgreSQL 14+
- Stellar account (testnet for development)
- Install dependencies:
npm install- Setup environment variables:
cp .env.example .envEdit .env with your configuration:
- Database credentials
- JWT secrets
- Stellar network settings
- CORS origins
- Setup database:
# Create database
createdb mentorminds
# Run migrations (coming soon)
npm run migratenpm run devServer runs on http://localhost:5000 with hot reload
npm run build
npm startmentorminds-backend/
├── src/
│ ├── config/ # Configuration files
│ │ ├── database.ts # PostgreSQL configuration
│ │ └── stellar.ts # Stellar SDK configuration
│ ├── controllers/ # Route controllers
│ ├── middleware/ # Express middleware
│ │ ├── errorHandler.ts
│ │ └── notFoundHandler.ts
│ ├── models/ # Database models
│ ├── routes/ # API routes
│ ├── services/ # Business logic
│ ├── utils/ # Utility functions
│ ├── types/ # TypeScript types
│ └── server.ts # Entry point
├── database/
│ └── migrations/ # Database migrations
├── .env.example # Environment variables template
├── tsconfig.json # TypeScript configuration
└── package.json
GET /health
GET /api/v1
POST /api/v1/auth/register- User registrationPOST /api/v1/auth/login- User loginGET /api/v1/users/:id- Get user profileGET /api/v1/mentors- List mentorsPOST /api/v1/bookings- Create bookingPOST /api/v1/payments- Process paymentGET /api/v1/wallets/:id- Get wallet info
| Variable | Description | Default |
|---|---|---|
NODE_ENV |
Environment (development/production) | development |
PORT |
Server port | 5000 |
DATABASE_URL |
PostgreSQL connection string | - |
JWT_SECRET |
JWT signing secret | - |
STELLAR_NETWORK |
Stellar network (testnet/mainnet) | testnet |
STELLAR_HORIZON_URL |
Horizon server URL | testnet URL |
CORS_ORIGIN |
Allowed CORS origins | * |
See .env.example for complete list.
npm testnpm run dev- Start development server with hot reloadnpm run build- Build for productionnpm start- Start production servernpm run lint- Run ESLintnpm run lint:fix- Fix ESLint errorsnpm run format- Format code with Prettier
- Helmet.js for security headers
- CORS configuration
- JWT token authentication
- Input validation with Zod
- SQL injection prevention
- Rate limiting (coming soon)
- Runtime: Node.js 18+
- Framework: Express.js 5
- Language: TypeScript 5
- Database: PostgreSQL 14+
- Blockchain: Stellar SDK
- Authentication: JWT
- Validation: Zod
- Security: Helmet, CORS
- Logging: Morgan
- Project setup
- Basic Express server
- Database configuration
- Stellar SDK integration
- Authentication endpoints
- User management
- Mentor management
- Booking system
- Payment processing
- Wallet management
- Admin dashboard API
- API Documentation (coming soon)
- Database Schema (coming soon)
- Stellar Integration (coming soon)
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
MIT License - see LICENSE file for details
For issues and questions:
- Create an issue on GitHub
- Check existing documentation
- Review the codebase
Status: 🟢 Active Development
Built with ❤️ for the MentorMinds Stellar platform