Commit Graph

113 Commits

Author SHA1 Message Date
8ffd5a7a2c feat: refactor session processing pipeline to implement multi-stage tracking and enhance error handling 2025-06-27 23:12:04 +02:00
2dfc49f840 DB refactor 2025-06-27 23:05:46 +02:00
185bb6da58 Migrate database from SQLite to PostgreSQL
- Replace SQLite with PostgreSQL using Neon as provider
- Add environment-based database URL configuration
- Create separate test database setup with DATABASE_URL_TEST
- Reset migration history and generate fresh PostgreSQL schema
- Add comprehensive migration documentation
- Include database unit tests for connection validation
2025-06-27 21:25:48 +02:00
6f9ac219c2 feat: Refactor data processing pipeline with AI cost tracking and enhanced session management
- Updated environment configuration to include Postgres database settings.
- Enhanced import processing to minimize field copying and rely on AI for analysis.
- Implemented detailed AI processing request tracking, including token usage and costs.
- Added new models for Question and SessionQuestion to manage user inquiries separately.
- Improved session processing scheduler with AI cost reporting functionality.
- Created a test script to validate the refactored pipeline and display processing statistics.
- Updated Prisma schema and migration files to reflect new database structure and relationships.
2025-06-27 21:15:44 +02:00
601e2e4026 feat: enhance environment variable parsing to handle quotes, comments, and whitespace; add transcript parsing utility for structured message extraction 2025-06-27 20:02:16 +02:00
9a3741cd01 feat: enhance date parsing in import processor to handle European format and improve error handling 2025-06-27 19:41:54 +02:00
f3f63943a8 feat: update .env.local.example to use quotes for environment variables
chore: add @vitest/coverage-v8 dependency to package.json

chore: update pnpm-lock.yaml with new dependencies and versions

test: enhance env.test.ts to validate environment variable handling and defaults
2025-06-27 19:27:09 +02:00
49a75f5ede Migrate tests from Jest to Vitest, updating setup and test files accordingly.
- Replace Jest imports and mocks with Vitest equivalents in setup and unit tests.
- Adjust test cases to use async imports and reset modules with Vitest.
- Add Vitest configuration file for test environment setup and coverage reporting.
2025-06-27 19:14:05 +02:00
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