A modern and reusable Admin Dashboard built with React and Tailwind CSS. This dashboard offers various administrative functionalities, including user management, system stats, reports, and more. The project leverages React Router for navigation and is designed to be scalable, flexible, and easy to integrate into any project.
Every page is fully dynamic — all data (users, orders, products, messages, reports, revenue, audit logs, profile, settings) is fetched from a REST API at runtime and supports create / update / delete operations. A bundled json-server mock backend lets you run the whole thing locally with zero setup, and it can be swapped for a real API by changing a single environment variable.
- Add, edit, and delete users.
- View user details and perform CRUD operations.
- Role-based access control (Admin, Manager, User).
- Search, filter, and paginate through user lists.
- Display KPIs like total users, active users, and revenue.
- Real-time data updates for system stats.
- Interactive charts and graphs for data visualization.
- View various reports related to users, orders, revenue, etc.
- Export and download reports as needed.
- View and manage system messages.
- Message details and conversation threads.
- Support for real-time notifications.
- Track and display user activities, such as logins, actions taken, and errors.
- View and filter audit logs by user, action type, or date range.
- View and edit user profiles.
- Profile settings for admins, users, and managers.
- Ability to update profile information.
- Manage content such as posts, articles, and other media.
- View content details and edit as needed.
- View real-time revenue statistics.
- Analyze and track orders cost.
- Configure application settings (site name, theme, etc.).
- Access support resources for troubleshooting.
- Frontend:
- React (component-based UI)
- Tailwind CSS (responsive, customizable styling)
- React Router (navigation)
- Axios (HTTP client)
- Chart.js / react-chartjs-2 (data visualization)
- Mock Backend:
- json-server — a zero-config REST API served from
frontend/db.json. Used for local development; replace it with a real API by settingVITE_API_URL.
- json-server — a zero-config REST API served from
- Deployment:
- The frontend can be deployed to Vercel, Netlify, or any static host. The mock backend is for development only — point the app at a production API for deployment.
React pages ──▶ src/services/api.js (axios, baseURL = /api)
│
▼
Vite dev proxy /api/* ──▶ http://localhost:5000/*
│
▼
json-server (reads/writes frontend/db.json)
src/services/api.js— a single shared axios instance. Its base URL is/apiby default, or whateverVITE_API_URLis set to.vite.config.js— proxies/api/*requests to the json-server backend on port 5000 in development.db.json— the mock database. Every collection (users,orders,products,messages,posts,auditLogs,reports,ordersCost,revenue,profile,settings, …) is a REST resource supportingGET,POST,PUT,PATCH, andDELETE.
To use a real backend instead, create frontend/.env with:
VITE_API_URL=https://your-api.example.com
git clone https://github.com/Njoxpy/dashboard
cd dashboard/frontendnpm installnpm run serverThis starts json-server on http://localhost:5000, serving the data in db.json.
npm run devVite starts the app (default http://localhost:5173) and proxies API calls to the backend. Open the dashboard at http://localhost:5173/admin.
Note: Run both commands — the app fetches its data from the backend, so without
npm run serverrunning, pages will show loading/error states.
The dashboard utilizes React Router to manage navigation within the admin interface. Below is the routing setup:
const router = createBrowserRouter(
createRoutesFromElements(
<Route>
<Route path="admin/*" element={<DashboardLayout />}>
<Route index element={<DashboardOverview />} />
<Route path="users">
<Route index element={<UsersPage />} />
<Route path=":id" element={<UserDetailsPage />} />
<Route path="create" element={<AddUserPage />} />
</Route>
<Route path="dashboard" element={<DashboardOverview />} />
<Route path="reports" element={<ReportsPage />} />
<Route path="revenue" element={<RevenueDashboard />} />
<Route path="contents" element={<ContentDashboard />} />
<Route path="contents/:id" element={<ContentDetails />} />
<Route path="messages" element={<Messages />} />
<Route path="messages/:id" element={<MessageDetail />} />
<Route path="orders" element={<OrdersPage />} />
<Route path="orders/:id" element={<OrderDetailsPage />} />
<Route path="products" element={<ProductsPage />} />
<Route path="products/add" element={<AddProduct />} />
<Route path="products/:id/edit" element={<EditProduct />} />
<Route path="settings" element={<Settings />} />
<Route path="support" element={<Support />} />
<Route path="logs" element={<AuditLogs />} />
<Route path="profile" element={<ProfilePage />} />
<Route path="profile/edit" element={<EditProfilePage />} />
<Route path="orders-cost" element={<OrdersCostDashboard />} />
<Route path="*" element={<NotFound />} />
</Route>
</Route>,
),
);DashboardLayout: The main layout for the dashboard that contains the sidebar, top bar, and dynamic content area.DashboardHome,UsersPage,ReportsPage, etc.: These are individual pages/components representing sections of the admin dashboard.AddUserPage,UserDetailsPage,EditProfilePage, etc.: Pages for adding/editing users, viewing user details, and updating user profiles.- Dynamic Routes: The routes like
users/:idandmessages/:idhandle dynamic user or message details. - 404 Route (
NotFound): A fallback route for when a user navigates to a non-existent page.
If you'd like to contribute to this project, follow these steps:
- Fork the repository.
- Clone your fork to your local machine.
- Create a new branch for your feature or fix.
- Implement your changes.
- Commit your changes with descriptive messages.
- Push your branch to your forked repository.
- Open a pull request.
- Real Backend: Swap the json-server mock for a production API (an Express + MongoDB structure is sketched in
docs/backend.md). - Authentication: Implement user authentication and protected routes for admin access.
- Advanced Analytics: Add more complex charts, data filters, and user statistics.
- Multilingual Support: Add support for multiple languages to serve a global audience.
This dashboard was created with the help of React and Tailwind CSS, along with React Router for navigation. The goal was to create a highly reusable, flexible admin dashboard that can easily be customized and deployed.
Here are some images of the dashboard in action:







