Skip to content

Akib-Raihan-4/Teacher-hub-server

Repository files navigation

πŸŽ“ Teacher Hub

A comprehensive web application for teachers to manage classrooms, students, and finances with an intuitive dashboard.

πŸ“– Overview

Teacher Hub helps teachers efficiently manage their educational and financial responsibilities. Track classrooms, students, expenses, and income all in one unified platform.

✨ Key Features

  • πŸ‘₯ Classroom Management: Create and organize classrooms
  • πŸŽ“ Student Management: Assign and track students across classes
  • πŸ’° Financial Tracking: Monitor expenses and income
  • πŸ“Š Dashboard: Visual analytics and insights
  • πŸ” Authentication: JWT and Google OAuth integration

πŸ—οΈ Architecture

Teacher Hub
β”œβ”€β”€ πŸ”§ teacher-hub-server     # Backend API (Node.js + Express)
β”œβ”€β”€ βš›οΈ teacher-hub-client    # Frontend App (React + Next.js)
β”œβ”€β”€ πŸ—„οΈ PostgreSQL            # Primary database
β”œβ”€β”€ πŸ“¦ Redis                 # Caching & job queues
└── πŸ”„ Nginx                 # Reverse proxy

πŸ”§ Backend (Teacher-hub-server)

πŸ› οΈ Tech Stack

  • Runtime: Node.js + Express + TypeScript
  • Database: PostgreSQL + Neon + Drizzle ORM
  • Cache/Queue: Redis + BullMQ
  • Authentication: Passport (JWT + Google OAuth)
  • Security: Helmet, CORS, Rate Limiting
  • Logging: Pino

πŸ“‹ Available Scripts

Command Description
npm run dev Start development server
npm run build Build TypeScript to JavaScript
npm run start Start production server
npm run db:generate Generate new database migration
npm run db:migrate Run pending migrations
npm run db:push Push schema changes to database
npm run db:studio Open Drizzle Studio
npm run lint Run ESLint
npm run lint:fix Fix ESLint issues

βš›οΈ Frontend (Teacher-hub-client)

πŸ› οΈ Tech Stack

  • Framework: React + Next.js + TypeScript
  • Styling: TailwindCSS + shadcn/ui
  • State Management: TanStack Query
  • Authentication: JWT integration

πŸ“‹ Available Scripts

Command Description
npm run dev Start development server
npm run build Build for production
npm run start Start production server

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • Docker & Docker Compose

Setup Instructions

  1. Clone both repositories in the same folder

    # Create a parent directory
    mkdir teacher-hub-project
    cd teacher-hub-project
    
    # Clone both repositories
    git clone https://github.com/Akib-Raihan-4/Teacher-hub-server
    git clone https://github.com/Akib-Raihan-4/Teacher-hub-client
  2. Set up environment files

    # Backend environment
    cd teacher-hub-server
    cp .env.example .env.development
    
    # Frontend environment
    cd ../teacher-hub-client
    cp .env.example .env
  3. Configure your environment variables

    Backend (.env.development):

    DATABASE_URL=your_postgresql_connection_string
    REDIS_URL=redis://localhost:6379
    REDIS_PASSWORD=your_redis_password
    JWT_SECRET=your_jwt_secret
    GOOGLE_CLIENT_ID=your_google_client_id
    GOOGLE_CLIENT_SECRET=your_google_client_secret
    ...

    Frontend (.env.local):

    NEXT_PUBLIC_API_URL=http://localhost:5000
    NEXT_PUBLIC_GOOGLE_CLIENT_ID=your_google_client_id
  4. Start the application with Docker

    # Navigate to server folder and run compose
    cd teacher-hub-server
    docker compose -f docker-compose.dev.yml up --build
  5. Access the application


🐳 Docker Commands

# Start all services
docker compose -f docker-compose.dev.yml up --build

# Run in background
docker compose -f docker-compose.dev.yml up -d --build

# Stop services
docker compose -f docker-compose.dev.yml down

# View logs
docker compose -f docker-compose.dev.yml logs -f

🌐 Service Access

Service URL Description
Frontend http://localhost:3000 React application
Backend http://localhost:5000 API server
Nginx http://localhost Reverse proxy
Redis localhost:6379 Cache & job queue

πŸ“ Project Structure

teacher-hub-project/
β”‚
β”œβ”€β”€ teacher-hub-server/              # Backend API
β”‚   β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ docker-compose.dev.yml      # ⚠️ Run this file
β”‚   β”œβ”€β”€ .env.example
β”‚   └── package.json
β”‚
└── teacher-hub-client/              # Frontend App
    β”œβ”€β”€ app/
    β”œβ”€β”€ Dockerfile
    β”œβ”€β”€ .env.example
    └── package.json

πŸ”‘ Features

πŸ“š Classroom Management

  • Create and organize multiple classrooms
  • Set classroom schedules and capacity
  • Track classroom utilization

πŸ‘₯ Student Management

  • Add students with detailed profiles
  • Assign students to classrooms
  • Track fees for each students
  • Track and record unpaid fees

πŸ’° Financial Management

  • Income Tracking: Record tuition fees and payments
  • Expense Tracking: Monitor supplies and materials
  • Analytics: Visual charts and reports
  • Categories: Organize transactions by type

πŸ“Š Dashboard

  • Financial overview with charts
  • Student enrollment statistics
  • Monthly and yearly reports

πŸ”§ Development

Database Operations

cd teacher-hub-server

# Generate migration
npm run db:generate

# Apply migrations
npm run db:migrate

# Open database GUI
npm run db:studio

Local Development (Alternative)

If you prefer running without Docker:

# Start backend
cd teacher-hub-server
npm install
npm run dev

# Start frontend (new terminal)
cd teacher-hub-client
npm install
npm run dev

Built for educators who need better tools to manage their teaching business.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages