This is a React + TypeScript web application scaffolded with Vite. It uses Tailwind CSS for styling, React Router for navigation, and Supabase for authentication.
npm install-
Create a Supabase account at supabase.com
-
Create a new project
-
Configure the following settings in your Supabase project:
- Authentication: Enable email/password and OTP authentication
- Database: Set up your database tables as needed
-
Create a
.envfile in the root directory with your Supabase credentials:
VITE_SUPABASE_URL=your-project-url
VITE_SUPABASE_ANON_KEY=your-anon-keynpm run devnpm run dev- start the development servernpm run build- build for productionnpm run preview- preview the production build
src/pages/– application pagessrc/components/– shared UI componentssrc/layouts/– layout wrapperssrc/auth/– authentication context and utilitiessrc/api/– centralized API logic
The Recent Activities page displays a comprehensive view of all activities across different entities (leads, incidents, tasks, mailboxes, etc.) within a selected time period. Users can:
- View activities from the last 1-7 days (default: 2 days)
- See activity details including parent type, activity type, description, creation date, and creator
- Navigate directly to the corresponding parent detail page
- Filter activities by date range with a maximum of 7 days
Key Features:
- Cross-entity Activity Tracking: Shows activities from leads, incidents, tasks, employees, mailboxes, and supplies
- Date Range Selection: Users can select from 1-7 days to view historical activities
- Activity Details: Displays parent type, activity type, description, creation timestamp, and creator information
- Direct Navigation: Each activity includes a link to view the corresponding parent detail page
- Visual Indicators: Different icons and color-coded badges for different activity types and parent types
This application uses Supabase for authentication. The authentication flow includes:
- Login: Users can login with email/password or OTP
- Protected Routes: Routes are protected using the
PrivateRoutecomponent - User Profile: User information is available through the
useAuthhook - Logout: Users can logout and are redirected back to the application
import { useAuth } from './auth/AuthContext';
function MyComponent() {
const { user, isAuthenticated, logout } = useAuth();
if (!isAuthenticated) {
return <div>Please log in</div>;
}
return (
<div>
<h1>Welcome, {user.name}!</h1>
<button onClick={logout}>Logout</button>
</div>
);
}This scaffold is ready for further extension with real authentication and API integration.