React + TypeScript frontend for the LearnSpeak language learning platform.
- React 19 - UI library
- TypeScript - Type safety
- Vite - Build tool and dev server
- React Router - Client-side routing
- Axios - HTTP client
- CSS3 - Styling (based on design/html templates)
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
The app will open at http://localhost:5173
Note: Vite proxy forwards /api to http://localhost:8080 automatically.
npm run dev- Start development server with HMRnpm run build- Build for production (outputs todist/)npm run preview- Preview production buildnpm run lint- Run ESLint
The frontend uses relative paths for API calls:
- Development: Vite proxy forwards
/api/*tohttp://localhost:8080 - Production: Backend serves frontend and API from same origin
No environment variables needed!
- ✅ User registration & login
- ✅ JWT authentication
- ✅ Protected routes
- ✅ Responsive design
- ✅ Form validation
- ✅ Password visibility toggle
- ✅ Error handling
- ✅ Loading states
npm run buildOutput goes to dist/ directory. The Go backend will serve these files automatically.
Browser → http://localhost:5173 → Vite Dev Server
↓ (proxy /api/*)
Backend :8080
Browser → http://localhost:8080 → Go Server
├─ /api/* → API Handlers
└─ /* → Static Files
src/
├── components/ # Reusable components
├── contexts/ # React contexts (Auth)
├── hooks/ # Custom hooks (useAuth)
├── pages/ # Page components
├── services/ # API services
└── types/ # TypeScript types
- Based on
design/html/mockups - No CSS framework - custom CSS
- Fonts: Poppins (headings), Inter (body)
- Primary color: #22c55e (green)