StrellerMinds Backend is a modern NestJS-based API server that powers a blockchain education platform built on the Stellar network. This backend provides a robust foundation for educational platforms focused on blockchain technology, offering secure user management, course delivery, and seamless Stellar blockchain integration for on-chain learning verification and credentialing.
The platform is designed for educational institutions, online learning platforms, and blockchain training providers who want to offer verifiable, on-chain certificates and credentials while maintaining a traditional learning management system experience.
- Modern Architecture: Built with NestJS for scalable, maintainable code
- Stellar Integration: Seamless blockchain interactions for credential verification
- RESTful APIs: Clean, well-documented endpoints for all platform features
- TypeScript: Full type safety and enhanced developer experience
- Modular Design: Clean separation of concerns with NestJS modules
- Auto-generated Documentation: Interactive Swagger/OpenAPI documentation
- Comprehensive Testing: Unit and integration tests with Jest
- Environment Configuration: Flexible configuration management
- Framework: NestJS (Node.js)
- Language: TypeScript
- Database: PostgreSQL with TypeORM
- Blockchain: Stellar Network
- Authentication: JWT-based auth
- Documentation: Swagger/OpenAPI
- Testing: Jest
- Code Quality: ESLint + Prettier
- Node.js v18 or higher
- npm or yarn package manager
- PostgreSQL database (v12 or higher)
- Git for version control
git clone https://github.com/https://github.com/StarkMindsHQ/strellerminds-backend.git
cd strellerminds-backendnpm install# Copy the example environment file
cp .env.example .env
# Edit .env with your configuration
# Required: Database connection, JWT secret, Stellar network settingsEnsure PostgreSQL is running and create the database:
CREATE DATABASE strellerminds;# Development mode with hot reload
npm run start:dev
# Production mode
npm run build
npm run start:prodThe API will be available at http://localhost:3000
# Check if server is running
curl http://localhost:3000
# Should return: {"message": "Hello World!"}# Development
npm run start:dev # Start in development mode with hot reload
npm run start:debug # Start in debug mode
npm run start # Start in production mode
# Building
npm run build # Build the application
npm run build:prod # Build for production
# Testing
npm run test # Run unit tests
npm run test:cov # Run tests with coverage report
npm run test:e2e # Run end-to-end tests
npm run test:watch # Run tests in watch mode
# Code Quality
npm run lint # Lint the codebase
npm run lint:fix # Fix linting issues automatically
npm run format # Format code with PrettierCreate a .env file from .env.example and configure these essential variables:
# Database Configuration
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_USER=postgres
DATABASE_PASSWORD=your_password
DATABASE_NAME=strellerminds
# JWT Authentication
JWT_SECRET=your_super_secret_jwt_key_here
JWT_EXPIRES_IN=24h
# Stellar Blockchain
STELLAR_NETWORK=TESTNET
SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
# Application
PORT=3000
NODE_ENV=developmentFor a complete list of all available environment variables, refer to .env.example.
src/
├── app.controller.ts # Main application controller
├── app.module.ts # Root application module
├── app.service.ts # Core application service
├── main.ts # Application entry point
├── common/ # Shared utilities and decorators
│ ├── decorators/
│ └── errors/
├── config/ # Configuration files
├── modules/ # Feature modules
│ ├── auth/ # Authentication & authorization
│ ├── users/ # User management
│ ├── courses/ # Course management
│ ├── blockchain/ # Stellar integration
│ └── enrollment/ # Course enrollment
└── utils/ # Helper utilities
Once the server is running, access the interactive API documentation:
- Swagger UI:
http://localhost:3000/api - JSON Spec:
http://localhost:3000/api-json
The project includes comprehensive test coverage:
# Run all tests
npm run test
# Run tests with coverage
npm run test:cov
# Run specific test file
npm run test -- auth/auth.service.spec.ts
# Run tests in watch mode for development
npm run test:watch- All sensitive data should be stored in environment variables
- JWT secrets must be strong and unique
- Database connections should use SSL in production
- API endpoints should implement proper authentication and authorization
- Regular security audits are recommended
# Build the application
npm run build
# Start production server
npm run start:prod# Build Docker image
docker build -t strellerminds-backend .
# Run container
docker run -p 3000:3000 strellerminds-backend- Development: Hot reload, detailed logging, relaxed security
- Staging: Production-like environment for testing
- Production: Optimized performance, enhanced security
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes with proper testing
- Follow the existing code style and patterns
- Run tests and ensure they pass:
npm run test - Commit your changes with descriptive messages
- Push to your fork:
git push origin feature/amazing-feature - Create a Pull Request
- Follow TypeScript best practices
- Write meaningful commit messages
- Include tests for new functionality
- Ensure all tests pass before submitting
- Follow the existing code formatting (Prettier)
- Use the GitHub issue tracker
- Provide detailed reproduction steps
- Include environment details
- Add relevant logs or screenshots
- NestJS Documentation: https://docs.nestjs.com/
- Stellar Developers: https://developers.stellar.org/
- TypeORM Documentation: https://typeorm.io/
- TypeScript Handbook: https://www.typescriptlang.org/docs/
-
Database Connection Errors
- Verify PostgreSQL is running
- Check database credentials in
.env - Ensure database exists
-
Module Import Errors
- Run
npm installto ensure dependencies - Check TypeScript configuration
- Verify file paths and module names
- Run
-
Port Already in Use
- Change PORT in
.envfile - Kill existing processes:
lsof -ti:3000 | xargs kill
- Change PORT in
- Check existing GitHub issues
- Review the documentation
- Join our community discussions
- Contact maintainers for support
This project is UNLICENSED - all rights reserved.
- NestJS team for the excellent framework
- Stellar Development Foundation for blockchain infrastructure
- Open source community for valuable tools and libraries
Built with ❤️ for the blockchain education community