A lightweight React + TypeScript example that demonstrates basic authentication flows with context-based state management.
- Node.js 18+
- npm 9+
- Install dependencies:
npm install - Start the development server:
npm run dev - Open the local URL printed in the terminal to explore the app.
npm run dev— launch Vite in development modenpm run build— create an optimized production bundlenpm run preview— serve the build locally for inspectionnpm run lint— run ESLint checks
src/context/AuthContext.tsxhandles auth state and exposes login/logout helperssrc/pages/Login.tsxrenders the login form and demo credential hintsrc/pages/Dashboard.tsxandsrc/pages/Home.tsxshow authenticated vs. public views
- Update
AuthContextto integrate with a real backend or token service - Add route guards or session persistence as needed
This project is provided as-is for learning and experimentation.