- Introduction
- Latest Updates
- Technologies Required
- Fresh Installation
- Development
- Production Deployment
- Code Quality
- Troubleshooting
- References
This repository contains the frontend React application for the Interactive Tutorial System (ITSS) project. The system provides an interactive web-based authoring and playback environment for programming tutorials.
Backend Repository: InteractiveTutorialSoftwareSystem/server
- ✅ Security Fixes: All critical ESLint security issues resolved
- ✅ Production Build: Optimized build configuration with zero errors
- ✅ Code Quality: 75+ files improved with modern JavaScript practices
- ✅ Environment Configuration: Separate development and production configs
- ESLint Configuration: Production-ready linting with strict security rules
- Modern JavaScript: Migrated from React imports to React 17+ syntax
- Build Optimization: Enhanced Craco configuration for production builds
- Input Validation: Comprehensive security improvements
- Code Formatting: Prettier configuration for consistent code style
- Node.js: >= 16.0.0 (LTS recommended)
- npm: >= 8.0.0 (comes with Node.js)
- Git: Latest version
- VS Code: Recommended IDE with ESLint and Prettier extensions
- Chrome DevTools: For debugging and development
node --version # Should be >= 16.0.0
npm --version # Should be >= 8.0.0
git --version # Any recent version
git clone https://github.com/InteractiveTutorialSoftwareSystem/client.git
cd client
# Install all project dependencies
npm install
# Optional: Clean install if you encounter issues
npm ci
Create a .env
file in the root directory:
# Backend API URLs
REACT_APP_AUTH_URL=http://localhost:5001
REACT_APP_TUTORIAL_URL=http://localhost:5002
# Google OAuth Configuration
REACT_APP_GOOGLE_CLIENT_ID=your-google-client-id
# Stack Exchange API
REACT_APP_STACKEXCHANGE_KEY=your-stackexchange-key
# Development Settings
GENERATE_SOURCEMAP=false
ESLINT_NO_DEV_ERRORS=true
For production deployment, use .env.production
:
# Production API URLs
REACT_APP_AUTH_URL=https://your-production-auth-api.com
REACT_APP_TUTORIAL_URL=https://your-production-tutorial-api.com
# Production OAuth Configuration
REACT_APP_GOOGLE_CLIENT_ID=your-production-google-client-id
REACT_APP_STACKEXCHANGE_KEY=your-production-stackexchange-key
# Production Settings
GENERATE_SOURCEMAP=false
ESLINT_NO_DEV_ERRORS=false
NODE_ENV=production
- Go to Google API Console
- Create a new project or select existing
- Enable Google+ API
- Create OAuth 2.0 credentials
- Configure authorized origins:
- Development:
http://localhost:3000
- Production:
https://yourdomain.com
- Development:
- Visit Stack Apps
- Register your application
- Obtain your API key
Ensure the backend server is running:
# In a separate terminal, clone and run the server
git clone https://github.com/InteractiveTutorialSoftwareSystem/server.git
cd server
# Follow server README instructions
npm start
- Opens browser at
http://localhost:3000
- Hot reload enabled
- Development ESLint rules (lenient)
npm start # Start development server
npm run build # Build for production
npm test # Run test suite
npm run lint:check # Check ESLint issues (development)
npm run lint:fix # Auto-fix ESLint issues (development)
npm run lint:prod # Check production ESLint rules
npm run lint:prod:fix # Auto-fix production issues
# Create optimized production build
npm run build
# Test production build locally (optional)
npx serve -s build
-
Run production linting:
npm run lint:prod
-
Verify build succeeds:
npm run build
-
Test functionality:
- Authentication flow
- Tutorial creation and playback
- File upload/download
-
Security verification:
- No console.log statements in production
- All ESLint security rules passing
- Environment variables properly configured
# Build command
npm run build
# Publish directory
build/
FROM node:16-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npx", "serve", "-s", "build"]
- Development: Lenient rules in
.eslintrc.js
- Production: Strict security rules in
.eslintrc.production.js
- Modern JavaScript: ES6+ features, const/let over var
- React Best Practices: Hooks, functional components
- Security: No eval(), secure external links
- Performance: Optimized imports, code splitting
- Run
npm run lint:fix
before committing - Ensure
npm run build
succeeds - Follow existing code patterns
- Add JSDoc comments for complex functions
- Test on both development and production builds
# Clear node modules and reinstall
rm -rf node_modules package-lock.json
npm install
# Clear npm cache
npm cache clean --force
# Check development rules
npm run lint:check
# Auto-fix issues
npm run lint:fix
# Check production readiness
npm run lint:prod
- Verify
.env
file exists and has correct values - Check API endpoints are accessible
- Ensure backend server is running
- Validate Google OAuth configuration
# If port 3000 is in use
PORT=3001 npm start
- Check Issues
- Review Production ESLint Guide
- Ensure backend server is properly configured
- Code Splitting: Automatic route-based splitting
- Tree Shaking: Unused code elimination
- Minification: Optimized bundle size
- Source Maps: Disabled in production for security
- Fast Refresh: Hot reloading for React components
- ESLint: Development rules for faster iteration
- Source Maps: Enabled for debugging
- ✅ Input Validation: All user inputs properly sanitized
- ✅ XSS Prevention: No dangerous innerHTML usage
- ✅ CSRF Protection: Secure external links with rel="noreferrer"
- ✅ Code Injection: All eval() usage eliminated
- ✅ Production Hardening: Console statements removed
- Environment variables for sensitive configuration
- Secure HTTP headers in production
- Regular dependency updates
- ESLint security rules enforcement
Ouh, Eng Lieh, Benjamin Kok Siew Gan, and David Lo. "ITSS: Interactive Web-Based Authoring and Playback Integrated Environment for Programming Tutorials." Proceedings of the 2022 ACM Conference on International Computing Education Research-Volume 1. 2022. 📄 Research Paper
Repository: InteractiveTutorialSoftwareSystem/client
License: MIT
Maintained by: Interactive Tutorial Software System Team