An admin dashboard I built using React and TypeScript. It's got user authentication, a complete user management system, and responsive design throughout..
Authentication
User Management
Dashboard
Settings Page
UI Stuff
Make sure you have these installed:
git clone https://github.com/YOUR_USERNAME/sveltetech-frontend-dashboard.git
cd sveltetech-frontend-dashboard
npm install
This will install:
Create a .env file in the root directory if you want to customize:
VITE_SECRET_KEY=your-custom-encryption-key
VITE_API_BASE_URL=https://jsonplaceholder.typicode.com
npm run dev
The app will open at http://localhost:5173
Use these credentials:
[email protected]admin123npm run build
This creates an optimized build in the dist folder.
To preview the production build:
npm run preview
I went with React because it's got a huge ecosystem and TypeScript adds type safety which catches bugs early. The combination makes the code more maintainable.
I used a hybrid approach:
Instead of using plain localStorage, I encrypted the session data with AES-256. It's not perfect security, but it's better than storing tokens in plain text. Sessions expire after 24 hours to limit exposure.
I built a custom API utility with retry logic. If a network request fails, it automatically retries up to 3 times with increasing delays (1s, 2s, 3s). This makes the app more resilient to flaky connections.
Tailwind CSS was the obvious choice here - it's fast to work with and keeps the bundle size small. I added dark mode support using Tailwind's dark: variants. The theme preference persists in localStorage.
I organized components by feature rather than type:
Each component does one thing well. The EditUserModal handles user editing, Toast shows notifications, etc.
I created custom hooks like useUsers and useSettings to keep data fetching logic separate from UI components. This makes testing easier and the code more reusable.
All forms use controlled components. The EditUserModal validates inputs before submission and shows error messages inline. I avoided using heavy form libraries to keep things simple.
useMemo for expensive filtering operationsI kept the structure flat and simple:
src/
├── components/ # UI components
├── pages/ # Route pages
├── hooks/ # Custom hooks
├── contexts/ # React contexts
├── store/ # Zustand store
├── utils/ # Helpers
└── types/ # TypeScript types
Everything is organized by function, not by file type. This makes it easier to find related code.
I added three levels of error handling:
Network errors show retry options. Form errors display inline. System errors log to console.
I defined types for everything - API responses, component props, state shapes. This caught a lot of bugs during development and makes refactoring safer.
src/
├── components/ # Reusable UI pieces
│ ├── layout/ # Sidebar, Header, DashboardLayout
│ ├── EditUserModal.tsx
│ ├── Toast.tsx
│ └── NotificationManager.tsx
├── pages/ # Main pages
│ ├── Login.tsx
│ ├── Dashboard.tsx
│ ├── Users.tsx
│ └── Settings.tsx
├── hooks/ # Custom React hooks
│ ├── useUsers.ts
│ └── useSettings.ts
├── store/ # Zustand store
│ └── appStore.ts
├── contexts/ # React contexts
│ ├── AuthContext.tsx
│ └── ThemeContext.tsx
├── utils/ # Helper functions
│ ├── api.ts
│ └── encryption.ts
└── types/ # TypeScript definitions
npm run dev # Start dev server at localhost:5173
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint
Tested and working on:
Port already in use? Vite will automatically try the next available port (5174, 5175, etc.)
Build errors?
Delete node_modules and package-lock.json, then run npm install again.
Types not working? Restart your TypeScript server in VS Code (Cmd/Ctrl + Shift + P → "TypeScript: Restart TS Server")
MIT
Found a bug or want to add a feature? Feel free to open an issue or submit a PR.
Built by Aishwary Dongre • Star it if you found it useful