Commit Graph

55 Commits

Author SHA1 Message Date
5c1ced5900 feat: add rawTranscriptContent field to SessionImport model
feat: enhance server initialization with environment validation and import processing scheduler

test: add Jest setup for unit tests and mock console methods

test: implement unit tests for environment management and validation

test: create unit tests for transcript fetcher functionality
2025-06-27 19:00:22 +02:00
50b230aa9b feat: Implement configurable scheduler settings and enhance CSV import functionality 2025-06-27 16:55:25 +02:00
1dd618b666 Refactor transcript fetching and processing scripts
- Introduced a new function `fetchTranscriptContent` to handle fetching transcripts with optional authentication.
- Enhanced error handling and logging for transcript fetching.
- Updated the `parseTranscriptToMessages` function to improve message parsing logic.
- Replaced the old session processing logic with a new approach that utilizes `SessionImport` records.
- Removed obsolete scripts related to manual triggers and whitespace fixing.
- Updated the server initialization to remove direct server handling, transitioning to a more modular approach.
- Improved overall code structure and readability across various scripts.
2025-06-27 16:38:16 +02:00
d7ac0ba208 feat: Refactor database schema to enhance relationships and data types for Company, User, Session, and Message models 2025-06-27 16:10:33 +02:00
ab2c75b736 feat: Add additional country coordinates for improved geographic mapping 2025-06-26 19:32:53 +02:00
8c43a35632 feat: Enhance session processing and metrics
- Updated session processing commands in documentation for clarity.
- Removed transcript content fetching from session processing, allowing on-demand retrieval.
- Improved session metrics calculations and added new metrics for dashboard.
- Refactored processing scheduler to handle sessions in parallel with concurrency limits.
- Added manual trigger API for processing unprocessed sessions with admin checks.
- Implemented scripts for fetching and parsing transcripts, checking transcript content, and testing processing status.
- Updated Prisma schema to enforce default values for processed sessions.
- Added error handling and logging improvements throughout the processing workflow.
2025-06-26 17:12:42 +02:00
8f3c1e0f7c feat: Enhance dashboard metrics with new calculations and add Top Questions Chart component 2025-06-26 12:04:51 +02:00
0e5ac69d45 feat: Add DateRangePicker component and integrate date range filtering in metrics fetching 2025-06-26 11:42:01 +02:00
f964d6a078 feat: Update session endTime based on the latest message timestamp during message storage 2025-06-26 11:12:06 +02:00
944431fea3 feat: Load environment variables from .env.local and update session processing logic 2025-06-26 10:57:05 +02:00
1afe15df85 feat: Add prisma:push script and remove obsolete migration files 2025-06-25 17:50:55 +02:00
9e095e1a43 Refactor code for improved readability and consistency
- Updated formatting in SessionDetails component for better readability.
- Enhanced documentation in scheduler-fixes.md to clarify issues and solutions.
- Improved error handling and logging in csvFetcher.js and processingScheduler.js.
- Standardized code formatting across various scripts and components for consistency.
- Added validation checks for CSV URLs and transcript content to prevent processing errors.
- Enhanced logging messages for better tracking of processing status and errors.
2025-06-25 17:46:23 +02:00
a9e4145001 feat: Implement structured message parsing and display in MessageViewer component
- Added MessageViewer component to display parsed messages in a chat-like format.
- Introduced new Message table in the database to store individual messages with timestamps, roles, and content.
- Updated Session model to include a relation to parsed messages.
- Created transcript parsing logic to convert raw transcripts into structured messages.
- Enhanced processing scheduler to handle sessions with parsed messages.
- Updated API endpoints to return parsed messages alongside session details.
- Added manual trigger commands for session refresh, transcript parsing, and processing.
- Improved user experience with color-coded message roles and timestamps in the UI.
- Documented the new scheduler workflow and transcript parsing implementation.
2025-06-25 17:45:08 +02:00
3196dabdf2 feat: Implement session processing and refresh schedulers
- Added processingScheduler.js and processingScheduler.ts to handle session transcript processing using OpenAI API.
- Implemented a new scheduler (scheduler.js and schedulers.ts) for refreshing sessions every 15 minutes.
- Updated Prisma migrations to add new fields for processed sessions, including questions, sentimentCategory, and summary.
- Created scripts (process_sessions.mjs and process_sessions.ts) for manual processing of unprocessed sessions.
- Enhanced server.js and server.mjs to initialize schedulers on server start.
2025-06-25 16:14:01 +02:00
c9e24298cd Bump node-cron from 4.0.6 to 4.0.7 (#3)
Bumps [node-cron](https://github.com/merencia/node-cron) from 4.0.6 to 4.0.7.
- [Release notes](https://github.com/merencia/node-cron/releases)
- [Commits](https://github.com/merencia/node-cron/compare/v4.0.6...v4.0.7)

---
updated-dependencies:
- dependency-name: node-cron
  dependency-version: 4.0.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-23 12:37:39 +02:00
a360f461ab Merge pull request #2 from kjanat/feature/sidebar
Feature/sidebar
2025-05-23 00:22:45 +02:00
bbcdff0ffc Update app/dashboard/company/page.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-23 00:21:24 +02:00
940b416563 Revert DonutChart.tsx 2025-05-23 00:19:55 +02:00
cb86d26786 Update components/DonutChart.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-23 00:13:16 +02:00
a265f3236c Update README.md
Typo
2025-05-23 00:10:45 +02:00
be63dba540 Update playwright.yml
renamed step
2025-05-23 00:09:00 +02:00
01f4dd60f9 Update playwright.yml 2025-05-22 23:59:47 +02:00
9fad25e5f9 Update TODO.md with new tasks and enhance README.md with project details and setup instructions 2025-05-22 23:55:30 +02:00
13d0f8ee8d Add markdownlint-cli2 for markdown linting; configure Prettier with Jinja template support and update linting scripts 2025-05-22 22:29:06 +02:00
303226e3a9 Refactor trend calculations and improve WordCloud component responsiveness; remove trend labels for cleaner display 2025-05-22 22:21:40 +02:00
cbbdc8a1dc Enhance dashboard layout and sidebar functionality; improve session metrics calculations and API error handling 2025-05-22 21:53:18 +02:00
8dcb892ae9 Add Playwright testing framework and implement initial tests; update .gitignore and package files 2025-05-22 19:46:04 +02:00
f005b2ec0a Update dashboard metrics and session handling
- Refactor DashboardContent to improve trend calculations for user metrics and session time.
- Modify SessionViewPage to ensure loading state is set before fetching session data.
- Adjust SessionsPage to clean up display of session start time and remove unnecessary comments.
- Enhance DonutChart to handle various data point types and improve percentage calculations.
- Update GeographicMap to utilize @rapideditor/country-coder for country coordinates.
- Improve safeParseDate function in csvFetcher for better date handling and error logging.
- Refactor sessionMetrics to clarify variable names and improve session duration calculations.
- Update next.config.js for better configuration clarity.
- Bump package version to 0.2.0 and update dependencies in package.json and package-lock.json.
- Clean up API handler for dashboard sessions to improve readability and maintainability.
- Adjust tsconfig.json for better module resolution and strict type checking.
2025-05-22 19:21:49 +02:00
ed6e5b0c36 Enhance session handling and improve data parsing; add safe date parsing utility 2025-05-22 16:11:33 +02:00
efb5261c7d Refactor components and enhance metrics calculations:
- Update access denied messages to use HTML entities.
- Add autoComplete attributes to forms for better user experience.
- Improve trend calculations in sessionMetrics function.
- Update MetricCard props to accept React nodes for icons.
- Integrate Next.js Image component in Sidebar for optimization.
- Adjust ESLint rules for better code quality.
- Add new properties for trends in MetricsResult interface.
- Bump version to 0.2.0 in package.json.
2025-05-22 14:44:28 +02:00
e3134aa451 Add comprehensive dashboard features
Introduce company settings, user management, and layout components
Implement session-based Company and User pages for admin access
Integrate chart components for dynamic data visualization
Add Sidebar for modular navigation
Revamp global styles with Tailwind CSS

Enhances user experience and administrative control
2025-05-22 14:12:36 +02:00
a17b66c078 Enhances data handling and geographic mapping
Refactors dashboard to use actual metrics for country data,
removing dummy data for improved accuracy. Integrates the
country-code-lookup package for geographic mapping, adding
comprehensive country coordinates. Increases performance and
data validation across API endpoints and adjusts WordCloud
component size for better visualization.

Enhances session handling with improved validation logic,
and updates configuration for allowed origins.
2025-05-22 12:51:14 +02:00
3bbb20d889 Add sanity check for session duration in sessionMetrics function 2025-05-22 10:33:51 +02:00
39fec2e2ee Implement pagination for session list and enhance filter options fetching 2025-05-22 10:27:24 +02:00
44e9631fc9 Refactor SessionDetails component: remove TranscriptViewer and update transcript handling comments 2025-05-22 10:17:54 +02:00
4d29e444ef Enhance session management with filtering, sorting, and pagination features; implement API for fetching filter options and update session API to support advanced querying. 2025-05-22 08:15:25 +02:00
97af5d9dcf Merge pull request #1 from kjanat/alert-autofix-1
Potential fix for code scanning alert no. 1: Insecure randomness
2025-05-22 07:42:05 +02:00
7a3ebc30d3 Potential fix for code scanning alert no. 1: Insecure randomness
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-05-22 07:40:24 +02:00
8284326016 Create dependabot.yml 2025-05-22 07:36:59 +02:00
2b75c53241 Enhances dashboard metrics and session handling with word cloud data and country metrics 2025-05-22 07:31:24 +02:00
7762061850 Enhances session and dashboard components with authentication checks and loading states 2025-05-22 06:28:25 +02:00
ee212e3eea Improves transcript viewer with Markdown support
Adds Markdown rendering to the transcript viewer for enhanced formatting.

This change integrates `react-markdown` to parse and render transcript content, allowing for richer text formatting, including links and other Markdown elements.  It also adds a toggle to switch between raw and formatted text, and displays a message when transcript content is unavailable. The UI of the transcript viewer has been improved to be more user-friendly with titles and descriptions.
2025-05-22 06:13:00 +02:00
8ce0b8be37 Enhances session details with transcript viewer
Adds a transcript viewer component to display transcript content within the session details page.

This change introduces a new `TranscriptViewer` component that renders the transcript content if available. It also adds logic to fetch and store transcript content from the provided URL during session data refresh. The existing link-based transcript view is now used as a fallback when only the transcript URL is available. It also fixes an issue where session ID was not properly displayed.
2025-05-22 05:44:09 +02:00
ac7cafd7b2 Improves dashboard UI and user management
Enhances the dashboard's visual presentation and user management
functionality.

- Addresses a layout issue by adding overflow hidden to the word cloud container.
- Improves user management form responsiveness on smaller screens.
- Enhances language name display in the pie chart using a dedicated function and ensures correct ISO code display.
- Refines donut chart's center text styling for better readability.
- Fixes geographic map's height and removes attribution for a cleaner look.
2025-05-22 05:05:04 +02:00
00f2f5c59b Updates dashboard UI and improves styling
Improves the dashboard's appearance and user experience by updating styles and layouts.

Changes include:
- Updates to color schemes and spacing for better readability and visual appeal.
- Implements a responsive layout for the header to adapt to different screen sizes.
- Refactors button styles for consistency and clarity.
- Adds a gradient background to the main dashboard page.
- Updates the NextAuth URL in the development environment.
2025-05-22 04:40:56 +02:00
5317b2aa39 Enhances dashboard with new metrics and charts
Improves the dashboard with additional metrics and visualizations
to provide a more comprehensive overview of application usage and performance.

Adds new charts, including:
- Word cloud for category analysis
- Geographic map for user distribution (simulated data)
- Response time distribution chart

Refactors existing components for improved clarity and reusability,
including the introduction of a generic `MetricCard` component.

Improves error handling and user feedback during data refresh and
session loading.

Adds recommended VSCode extensions for ESLint and Prettier.
2025-05-22 04:04:50 +02:00
2624bf1378 Localizes language names in the language pie chart
Uses `Intl.DisplayNames` to display localized language names in the language pie chart, enhancing user experience and readability.

Also converts country and language values from the CSV data to ISO codes for standardization and improved data handling.
Adds tooltip to display ISO language code.
2025-05-22 02:00:15 +02:00
9fa7475da7 Normalizes language and category values
Adds functions to normalize language and category values from the CSV data, mapping variations to standard names and groups.

This improves data consistency and enables more accurate analysis and reporting.
2025-05-22 01:08:57 +02:00
6d4055c4eb Improves dashboard with new metrics and charts
Enhances the dashboard with new key performance indicators (KPIs) and visualizations.

Introduces a new stat card component for displaying metrics with trends and icons.

Adds sentiment analysis, language distribution, and token usage charts to provide a more comprehensive overview of session data.

These additions provide deeper insights into user interactions and platform performance.
2025-05-22 01:00:46 +02:00
4db0104e2c Improves CSV data parsing and normalization
Normalizes data from CSV files by mapping sentiment strings to numeric scores and standardizing boolean values.

This change enhances data consistency and accuracy, ensuring reliable data processing for sentiment analysis and boolean evaluations. It also handles multiple languages for sentiment strings.
2025-05-22 00:30:01 +02:00