Starter repository for the frontend authentication code-along of a MERN stack app (React + TypeScript + Vite).
- Install dependencies:
npm install - Create a
.envfile based on.env.exampleand set the backend URL:VITE_SERVER_URL=http://localhost:5005 - Run the app:
npm run dev
src/
├── components/
│ └── Navbar.tsx # navigation links + logout button
├── context/
│ └── auth.context.tsx # AuthContext and AuthWrapper (completed during the lesson)
├── pages/
│ ├── auth/
│ │ ├── LoginPage.tsx # login form (handleLogin completed during the lesson)
│ │ └── SignupPage.tsx # signup form (handleSignup completed during the lesson)
│ ├── HomePage.tsx
│ ├── ProfilePage.tsx # getData requests completed during the lesson
│ └── UserListPage.tsx # getData requests completed during the lesson
├── App.tsx # routes
└── main.tsx # entry point
| Path | Page |
|---|---|
/ |
HomePage |
/signup |
SignupPage |
/login |
LoginPage |
/profile |
ProfilePage |
/users |
UserListPage |