A modern React-based frontend application for the EdTech platform, built with Vite, React Router, and Tailwind CSS. This application provides interfaces for both course providers and learners to manage and discover educational courses.
- Prerequisites
- Project Setup
- Project Structure
- Environment Configuration
- Available Scripts
- Step-by-Step Build Instructions
Before you begin, ensure you have the following installed:
- Node.js (version 20.11.1 or compatible)
- npm (comes with Node.js)
- Backend API running on
http://localhost:8080(or configured URL)
# Navigate to the project directory
cd edtech-web# Install all project dependencies
npm installThis will install:
- React & React DOM - UI library
- React Router DOM - Client-side routing
- Axios - HTTP client for API requests
- React Hook Form - Form management and validation
- date-fns - Date formatting utilities
- Tailwind CSS - Utility-first CSS framework
- Vite - Build tool and dev server
Create a .env file in the root directory:
# Create .env file
touch .envAdd the following environment variable:
VITE_API_BASE_URL=http://localhost:8080/apiNote: The
.envfile is already included in.gitignoreto prevent committing sensitive data.
# Start the development server on port 3000
npm run devThe application will be available at http://localhost:3000
# Create production build
npm run build
# Preview production build
npm run previewedtech-web/
├── public/ # Static assets
│ └── vite.svg
├── src/
│ ├── assets/ # Images, icons, and other static assets
│ │ └── react.svg
│ ├── components/ # Reusable React components
│ │ ├── CourseCard.jsx # Course card display component
│ │ ├── CourseForm.jsx # Course create/edit form
│ │ ├── CourseList.jsx # Course list display component
│ │ └── ProtectedRoute.jsx # Route protection wrapper
│ ├── context/ # React Context providers
│ │ └── AuthContext.jsx # Authentication state management
│ ├── hooks/ # Custom React hooks (currently empty)
│ ├── pages/ # Page components (routes)
│ │ ├── CourseDetailPage.jsx # Course detail view (Learner)
│ │ ├── LandingPage.jsx # Landing/home page
│ │ ├── Login.jsx # Login page
│ │ ├── ProviderDashboard.jsx # Provider dashboard
│ │ ├── SearchPage.jsx # Course search page (Learner)
│ │ └── Signup.jsx # Signup page
│ ├── services/ # API and external service integrations
│ │ └── api.js # Axios configuration and API methods
│ ├── utils/ # Utility functions (currently empty)
│ ├── App.jsx # Main app component with routing
│ ├── App.css # App-specific styles
│ ├── index.css # Global styles and Tailwind imports
│ └── main.jsx # Application entry point
├── .env # Environment variables (not in git)
├── .gitignore # Git ignore rules
├── eslint.config.js # ESLint configuration
├── index.html # HTML template
├── package.json # Project dependencies and scripts
├── package-lock.json # Locked dependency versions
├── postcss.config.js # PostCSS configuration for Tailwind
├── tailwind.config.js # Tailwind CSS configuration
├── vite.config.js # Vite build configuration
└── README.md # This file
src/components/- Reusable UI components used across multiple pagessrc/pages/- Full-page components that correspond to routessrc/context/- Global state management using React Context APIsrc/services/- API service layer with Axios configurationsrc/hooks/- Custom React hooks for shared logicsrc/utils/- Helper functions and utilities
| Variable | Description | Default |
|---|---|---|
VITE_API_BASE_URL |
Backend API base URL | http://localhost:8080/api |
In your code, access environment variables using:
const API_URL = import.meta.env.VITE_API_BASE_URL;Important: Only variables prefixed with
VITE_are exposed to the client-side code.
| Command | Description |
|---|---|
npm run dev |
Start development server (port 3000) |
npm run build |
Build for production |
npm run preview |
Preview production build locally |
npm run lint |
Run ESLint to check code quality |
- ✅ User authentication (signup/login)
- ✅ Create, edit, and delete courses
- ✅ Publish/unpublish courses
- ✅ View all created courses
- ✅ Dashboard with course management
- ✅ User authentication (signup/login)
- ✅ Search courses (with optional PIN code filtering)
- ✅ Filter courses by category, mode, price, and date
- ✅ View course details
- ✅ Browse all available courses
- React 19.2.0 - UI library
- Vite 6.0.0 - Build tool and dev server
- React Router DOM 7.12.0 - Client-side routing
- Axios 1.13.2 - HTTP client
- React Hook Form 7.70.0 - Form management
- Tailwind CSS 4.1.18 - Styling framework
- date-fns 4.1.0 - Date utilities
- The backend API should be running on
http://localhost:8080(or as configured in.env) - All API endpoints require authentication except signup/login
- Course search supports optional PIN code (1-6 digits) for location-based filtering
- PIN code can be left empty to search all courses
- JWT tokens are stored in localStorage
- Session is automatically restored on page reload