Skip to content

abcX27/web3-learning-platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Web3 Learning Platform

A comprehensive Web3 learning platform that helps developers learn blockchain and Web3 development from scratch. The platform includes knowledge learning, practical exercises, code examples, and an online editor.

Features

  • πŸŽ“ Systematic Learning Path: Structured courses from beginner to advanced
  • πŸ’» Online Code Editor: Write and test Solidity and JavaScript code in the browser
  • πŸ† Achievement System: Earn badges and compete on leaderboards
  • πŸ‘₯ Community Features: Discussion forum and note-taking system
  • πŸ” Web3 Authentication: Support for MetaMask wallet login
  • 🐳 Docker Deployment: Easy deployment with Docker Compose

Tech Stack

Frontend

  • Framework: Next.js 14 (React 18)
  • UI: Tailwind CSS + shadcn/ui
  • State Management: Zustand
  • Code Editor: Monaco Editor
  • Web3: Ethers.js v6

Backend

  • Runtime: Node.js 18+
  • Framework: Express 4
  • Database: PostgreSQL 15
  • ORM: Prisma
  • Authentication: JWT + Passport.js
  • Storage: MinIO (S3-compatible)

DevOps

  • Containerization: Docker + Docker Compose
  • Reverse Proxy: Nginx
  • CI/CD: GitHub Actions

Project Structure

web3-learning-platform/
β”œβ”€β”€ frontend/              # Next.js frontend application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/          # Next.js 14 App Router
β”‚   β”‚   β”œβ”€β”€ components/   # React components
β”‚   β”‚   β”œβ”€β”€ lib/          # Utility libraries
β”‚   β”‚   β”œβ”€β”€ store/        # Zustand state management
β”‚   β”‚   └── types/        # TypeScript type definitions
β”‚   β”œβ”€β”€ public/           # Static assets
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── package.json
β”œβ”€β”€ backend/              # Express backend application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/  # Request handlers
β”‚   β”‚   β”œβ”€β”€ services/     # Business logic
β”‚   β”‚   β”œβ”€β”€ middleware/   # Express middleware
β”‚   β”‚   β”œβ”€β”€ routes/       # API routes
β”‚   β”‚   β”œβ”€β”€ utils/        # Utility functions
β”‚   β”‚   └── config/       # Configuration files
β”‚   β”œβ”€β”€ prisma/           # Prisma schema and migrations
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── package.json
β”œβ”€β”€ nginx/                # Nginx configuration
β”‚   └── nginx.conf
β”œβ”€β”€ docker-compose.yml    # Docker Compose configuration
β”œβ”€β”€ .env.example          # Environment variables template
└── README.md

Getting Started

Prerequisites

  • Docker and Docker Compose
  • Node.js 18+ (for local development)
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/web3-learning-platform.git
    cd web3-learning-platform
  2. Set up environment variables

    cp .env.example .env
    # Edit .env with your configuration
  3. Start with Docker Compose

    docker-compose up -d
  4. Run database migrations

    docker-compose exec backend npm run prisma:migrate
  5. Seed initial data (optional)

    docker-compose exec backend npm run prisma:seed
  6. Access the application

Local Development

Frontend Development

cd frontend
npm install
npm run dev

The frontend will be available at http://localhost:3000

Backend Development

cd backend
npm install
npm run dev

The backend API will be available at http://localhost:4000

Environment Variables

See .env.example for all required environment variables.

Key Variables

  • DATABASE_URL: PostgreSQL connection string
  • JWT_SECRET: Secret key for JWT token generation
  • REDIS_URL: Redis connection string
  • INFURA_API_KEY: Infura API key for blockchain interaction
  • MINIO_*: MinIO storage configuration

Docker Services

The application uses the following Docker services:

  • nginx: Reverse proxy (port 80/443)
  • frontend: Next.js application (port 3000)
  • backend: Express API (port 4000)
  • postgres: PostgreSQL database (port 5432)
  • redis: Redis cache (port 6379)
  • minio: Object storage (port 9000/9001)

API Documentation

API documentation is available at /api/docs when running the backend server.

Testing

Run all tests

# Backend tests
cd backend
npm test

# Frontend tests
cd frontend
npm test

Run property-based tests

cd backend
npm run test:property

Deployment

Production Deployment

  1. Update environment variables for production
  2. Build Docker images:
    docker-compose -f docker-compose.prod.yml build
  3. Start services:
    docker-compose -f docker-compose.prod.yml up -d

CI/CD

The project uses GitHub Actions for continuous integration and deployment. See .github/workflows/ for configuration.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Support

For support, email support@web3learning.com or join our Discord community.


Version: 1.0.0
Last Updated: 2025-02-04

About

web3-learning-platform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published