Skip to content

RennyThompson/chainVerse-backend

 
 

Repository files navigation

Here is a professional, production-ready README.md for your NestJS migration project.

You can copy this directly into your repository.


🚀 ChainVerse Backend (NestJS)

A modular, scalable backend architecture for ChainVerse Academy built with NestJS, following clean architecture principles, role-based authentication, and production-ready standards.


📌 Overview

This project is a full backend migration from Express.js to NestJS, designed to improve:

  • ✅ Scalability
  • ✅ Maintainability
  • ✅ Modular structure
  • ✅ Role-based authorization
  • ✅ Validation & security
  • ✅ API documentation
  • ✅ Clean architecture

The system supports features such as authentication, course management, certification, gamification, reporting, financial aid, notifications, and more.


🏗 Tech Stack

  • Framework: NestJS
  • Language: TypeScript
  • Authentication: JWT (Access + Refresh Tokens)
  • Validation: class-validator / class-transformer
  • ORM: Prisma or TypeORM (configurable)
  • Documentation: Swagger
  • Database: PostgreSQL (recommended)
  • Caching: Redis (optional)
  • File Storage: Local or Cloud (S3 compatible)

📁 Project Structure

src/
│
├── auth/
├── users/
├── tutor-settings/
├── student-settings/
├── admin-settings/
├── courses/
├── reviews/
├── leaderboard/
├── gamification/
├── certification/
├── financial-aid/
├── reports/
├── notification/
├── organization/
├── subscription-plan/
├── session/
└── common/

Each module follows:

module/
├── module.module.ts
├── module.controller.ts
├── module.service.ts
├── dto/
├── entities/
└── guards/

🔐 Authentication & Authorization

  • JWT-based authentication

  • Role-based access control (RBAC)

  • Roles:

    • ADMIN
    • MODERATOR
    • TUTOR
    • STUDENT
  • Guards:

    • JwtAuthGuard
    • RolesGuard

📦 Core Modules Implemented

👤 Account & Authentication

  • Tutor Account Settings
  • Student Account Settings
  • Admin & Moderator Settings
  • JWT Authentication (Admin, Tutor, Student)

📚 Courses

  • Course Categorization
  • Advanced Filtering
  • Ratings & Feedback
  • Course Reports & Analytics

🏆 Gamification

  • Points System
  • Leaderboards
  • Badges
  • NFT Achievements

🎓 Certification

  • Certificate Issuance
  • Certificate Download
  • Social Sharing
  • Name Change Request System

💰 Financial Aid

  • Student Application
  • Admin Review & Approval

📊 Reporting

  • Tutor Analytics
  • Student Analytics
  • Course Analytics

🛎 System Modules

  • FAQ
  • Terms & Conditions
  • Privacy Policy
  • Notification System
  • Contact Message
  • Organization Management
  • Subscription Plans
  • Session Management
  • Abuse Reporting
  • Removal Requests

🛠 Installation

# Clone repository
git clone https://github.com/your-username/chainverse-backend.git

# Navigate into project
cd chainverse-backend

# Install dependencies
npm install

⚙️ Environment Variables

Create a .env file:

PORT=3000
DATABASE_URL=postgresql://user:password@localhost:5432/chainverse
JWT_SECRET=your_secret
JWT_REFRESH_SECRET=your_refresh_secret

▶️ Run Application

# Development
npm run start:dev

# Production
npm run build
npm run start:prod

📄 API Documentation

Once the server is running:

http://localhost:3000/api

Swagger UI provides full endpoint documentation.


🧪 Testing

# Unit tests
npm run test

# e2e tests
npm run test:e2e

🧩 Migration Philosophy

This backend was rebuilt from Express to NestJS to:

  • Enforce structured modular design
  • Improve dependency injection
  • Enhance validation & security
  • Provide consistent issue-based development
  • Enable microservice scalability in future

📌 Development Guidelines

  • Follow SOLID principles
  • Business logic must reside in services
  • Controllers should be thin
  • Always use DTOs for validation
  • Protect sensitive routes with guards
  • Document endpoints using Swagger decorators

🚀 Future Enhancements

  • Microservices architecture (gRPC / Redis / RMQ)
  • WebSocket notifications
  • Full blockchain NFT integration
  • Payment gateway integration
  • CI/CD pipeline setup
  • Docker containerization

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Follow the defined issue structure
  4. Submit a Pull Request

All contributions must:

  • Follow NestJS best practices
  • Include validation
  • Include Swagger documentation
  • Pass tests

📜 License

MIT License

About

ChainVerse Academy is a decentralized Web3 education platform built on the Stellar blockchain. It offers crypto-based payments, NFT certifications, and DAO governance, allowing students to learn about multiple blockchain ecosystems, earn rewards, and own their learning assets through secure, low-cost transactions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 70.8%
  • JavaScript 29.2%