A responsive log viewer interface with filtering, pagination and sorting.
-
Comprehensive Log Display
- Timestamp parsing and formatting
- Color-coded log messages (ERROR, WARN, INFO)
- Responsive table layout
-
Advanced Filtering
- Search across all fields (message, trace, authorId)
- Exact log message filtering
- Date range selection
-
Client-Side Pagination
- Dynamic page sizing (10, 25, 50, 100 items)
- Smart page number rendering
- Performance-optimized rendering
-
API Integration
- Error handling with fallback UI
- Type-safe response parsing
-
Frontend Architecture
- Next.js App Router
- TypeScript interfaces for all data structures
- TailwindCSS for styling
-
API Key Handling
- Base64 encoding to prevent special character issues
- Runtime decoding for header injection
- Environment variable configuration
-
Performance Optimizations
- Memoized filtered results
- Solved API key truncation from special characters
- Implemented responsive table with overflow handling
- Created reusable pagination component
-
Clone repository:
git clone [https://github.com/ellacmd/assessment] cd betterstudio-assessment -
Install dependencies:
npm install
-
Set up environment variables:
# Create a .env.local file in the project root touch .env.localYou'll need to encode your API key in Base64 format. You can do this by:
a. Opening your browser's developer console (F12)
b. Run the following command:
btoa('your-api-key-here');
c. Copy the resulting Base64 string
Add the encoded key to your
.env.localfile:NEXT_PUBLIC_API_KEY_BASE64="your-base64-encoded-key-here"Note: Replace "your-base64-encoded-key-here" with the actual Base64 string you generated.
-
Run development server
npm run dev
