Skip to content

web application for Global Classrooms - facilitating environmental education activities, QR verification, and GoodDollar rewards for students.

Notifications You must be signed in to change notification settings

Cooperation-org/global-classrooms-app

Repository files navigation

Global Classrooms - Online Learning Platform

A modern, scalable online learning platform built with Next.js 15, TypeScript, and Tailwind CSS.

πŸš€ Features

  • Modern Tech Stack: Next.js 15, TypeScript, Tailwind CSS
  • Responsive Design: Mobile-first approach with beautiful UI
  • Authentication System: Complete auth flow with context management
  • Component Library: Reusable UI components with consistent design
  • Type Safety: Full TypeScript coverage for better development experience
  • Performance Optimized: Built with Next.js App Router and optimized for speed

πŸ“ Project Structure

global-classrooms-app/
β”œβ”€β”€ app/                          # Next.js App Router
β”‚   β”œβ”€β”€ components/               # Reusable components
β”‚   β”‚   β”œβ”€β”€ ui/                   # Base UI components (Button, Input, etc.)
β”‚   β”‚   β”œβ”€β”€ layout/               # Layout components (Header, Footer)
β”‚   β”‚   β”œβ”€β”€ forms/                # Form components
β”‚   β”‚   β”œβ”€β”€ cards/                # Card components
β”‚   β”‚   └── sections/             # Page sections (Hero, Features, etc.)
β”‚   β”œβ”€β”€ context/                  # React Context providers
β”‚   β”œβ”€β”€ hooks/                    # Custom React hooks
β”‚   β”œβ”€β”€ services/                 # API services and external integrations
β”‚   β”œβ”€β”€ types/                    # TypeScript type definitions
β”‚   β”œβ”€β”€ utils/                    # Utility functions and helpers
β”‚   β”œβ”€β”€ globals.css               # Global styles
β”‚   β”œβ”€β”€ layout.tsx                # Root layout
β”‚   └── page.tsx                  # Home page
β”œβ”€β”€ lib/                          # Shared libraries and utilities
β”œβ”€β”€ public/                       # Static assets
β”œβ”€β”€ package.json                  # Dependencies and scripts
β”œβ”€β”€ tsconfig.json                 # TypeScript configuration
β”œβ”€β”€ tailwind.config.js            # Tailwind CSS configuration
└── README.md                     # Project documentation

πŸ› οΈ Tech Stack

  • Framework: Next.js 15 with App Router
  • Language: TypeScript
  • Styling: Tailwind CSS v4
  • State Management: React Context + Custom Hooks
  • HTTP Client: Fetch API with custom service layer
  • Code Quality: ESLint, TypeScript strict mode
  • Package Manager: npm

πŸš€ Getting Started

Prerequisites

  • Node.js 18.18.0 or higher
  • npm 8.19.3 or higher

Installation

  1. Clone the repository:
git clone <repository-url>
cd global-classrooms-app
  1. Install dependencies:
npm install
  1. Start the development server:
npm run dev
  1. Open http://localhost:3000 in your browser.

πŸ“ Available Scripts

  • npm run dev - Start development server with Turbopack
  • npm run build - Build the application for production
  • npm run start - Start the production server
  • npm run lint - Run ESLint to check code quality

🎨 Design System

The project uses a consistent design system with:

  • Color Palette: Semantic colors (primary, secondary, accent, etc.)
  • Typography: Geist Sans and Geist Mono fonts
  • Spacing: Consistent spacing scale using Tailwind CSS
  • Components: Reusable UI components with variants and sizes

πŸ”§ Configuration

Environment Variables

Create a .env.local file in the root directory:

NEXT_PUBLIC_API_URL=http://localhost:3001/api

TypeScript

The project uses strict TypeScript configuration with:

  • Strict mode enabled
  • Path mapping for clean imports
  • Custom type definitions for better DX

Tailwind CSS

Configured with:

  • Custom color palette
  • Responsive breakpoints
  • Custom utilities and components

πŸ“š Component Guidelines

Creating New Components

  1. Location: Place components in appropriate directories under app/components/
  2. Naming: Use PascalCase for component names
  3. Props: Define TypeScript interfaces for all props
  4. Styling: Use Tailwind CSS classes with consistent patterns
  5. Accessibility: Include proper ARIA labels and semantic HTML

Component Structure

import React from 'react';
import { cn } from '@/lib/utils';

interface ComponentProps {
  // Define props here
}

const Component: React.FC<ComponentProps> = ({ /* props */ }) => {
  return (
    // JSX here
  );
};

export default Component;

πŸ” Authentication

The app includes a complete authentication system:

  • Context Provider: AuthContext manages user state
  • Custom Hooks: useAuth for easy access to auth functions
  • Local Storage: Persistent user sessions
  • Type Safety: Full TypeScript support for auth types

🌐 API Integration

  • Service Layer: Centralized API calls in app/services/
  • Type Safety: API responses are fully typed
  • Error Handling: Consistent error handling across all requests
  • Environment Config: Configurable API endpoints

πŸ“± Responsive Design

The application is built with a mobile-first approach:

  • Breakpoints: Tailwind CSS responsive utilities
  • Flexible Layouts: CSS Grid and Flexbox for layouts
  • Touch-Friendly: Optimized for mobile interactions
  • Performance: Optimized images and lazy loading

πŸ§ͺ Testing

To add testing to the project:

  1. Install testing dependencies:
npm install --save-dev jest @testing-library/react @testing-library/jest-dom
  1. Create test files alongside components
  2. Run tests with npm test

πŸ“¦ Deployment

Vercel (Recommended)

  1. Push your code to GitHub
  2. Connect your repository to Vercel
  3. Deploy automatically on every push

Other Platforms

The app can be deployed to any platform that supports Next.js:

  • Netlify
  • Railway
  • DigitalOcean App Platform
  • AWS Amplify

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License.

πŸ†˜ Support

For support and questions:

  • Create an issue in the repository
  • Check the documentation
  • Review the code examples

Built with ❀️ using Next.js, TypeScript, and Tailwind CSS

About

web application for Global Classrooms - facilitating environmental education activities, QR verification, and GoodDollar rewards for students.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages