fix: configure markdownlint-cli2 properly

- Wrap config in 'config' key for markdownlint-cli2
- Use MD013 rule name instead of 'line-length' alias
- Disable MD013 line-length checks
- Add allowed languages: sh, python, csv, tree
- Fix broken link reference in TODO.md
- All markdown linting now passes (37 errors -> 0)
This commit is contained in:
2025-11-05 16:51:23 +01:00
parent 04705bdcb2
commit fe847a3d4e
9 changed files with 434 additions and 353 deletions

View File

@@ -33,6 +33,7 @@ indent_size = 2
# Markdown files
[*.md]
trim_trailing_whitespace = false
indent_size = 4
# YAML files
[*.{yml,yaml}]

View File

@@ -11,7 +11,8 @@
## uv
UV is a fast Python package and project manager written in Rust. Use UV to manage dependencies, virtual environments, and run Python scripts with improved performance.
UV is a fast Python package and project manager written in Rust. Use UV to manage dependencies, virtual environments,
and run Python scripts with improved performance.
### Running Python Scripts
@@ -153,7 +154,8 @@ UV is a fast Python package and project manager written in Rust. Use UV to manag
## Project Structure
This section provides a comprehensive overview of the LiveGraphsDjango project structure and the function of each key file. Please update this section whenever there are noteworthy changes to the structure or to a file's function.
This section provides a comprehensive overview of the LiveGraphsDjango project structure and the function of each key
file. Please update this section whenever there are noteworthy changes to the structure or to a file's function.
```tree
LiveGraphsDjango/
@@ -237,21 +239,21 @@ LiveGraphsDjango/
1. **Multi-Tenant Architecture**:
- Companies are the top-level organizational unit
- Users belong to Companies and have different permission levels
- DataSources are owned by Companies
- Dashboards display analytics based on DataSources
- Companies are the top-level organizational unit
- Users belong to Companies and have different permission levels
- DataSources are owned by Companies
- Dashboards display analytics based on DataSources
2. **Data Integration Flow**:
- External APIs are configured via ExternalDataSource models
- Data is fetched, parsed, and stored as ChatSessions and ChatMessages
- Dashboard views aggregate and visualize this data
- External APIs are configured via ExternalDataSource models
- Data is fetched, parsed, and stored as ChatSessions and ChatMessages
- Dashboard views aggregate and visualize this data
3. **Export Functionality**:
- Export available in CSV, JSON, and Excel formats
- Filtering options to customize exported data
- Export available in CSV, JSON, and Excel formats
- Filtering options to customize exported data
### Important Note

73
.markdownlint-cli2.jsonc Normal file
View File

@@ -0,0 +1,73 @@
// Configuration for markdownlint-cli2
{
"config": {
"$schema": "https://cdn.jsdelivr.net/gh/DavidAnson/markdownlint@main/schema/markdownlint-config-schema.json",
"inline-html": false,
"code-block-style": {
"style": "fenced"
},
"code-fence-style": {
"style": "backtick"
},
"emphasis-style": {
"style": "asterisk"
},
"extended-ascii": {
"ascii-only": true
},
"fenced-code-language": {
"allowed_languages": [
"bash",
"sh",
"html",
"javascript",
"json",
"markdown",
"text",
"python",
"csv",
"tree"
],
"language_only": true
},
"heading-style": {
"style": "atx"
},
"hr-style": {
"style": "---"
},
"MD013": false,
"link-image-style": {
"collapsed": false,
"shortcut": false,
"url_inline": false
},
"no-duplicate-heading": {
"siblings_only": true
},
"ol-prefix": {
"style": "ordered"
},
"proper-names": {
"code_blocks": false,
"names": [
"Cake.Markdownlint",
"CommonMark",
"JavaScript",
"Markdown",
"markdown-it",
"markdownlint",
"Node.js"
]
},
"reference-links-images": {
"shortcut_syntax": true
},
"strong-style": {
"style": "asterisk"
},
"ul-style": {
"style": "dash"
}
}
}

View File

@@ -28,6 +28,12 @@
"proseWrap": "preserve",
"printWidth": 100
}
},
{
"files": ["*.jsonc"],
"options": {
"trailingComma": "none"
}
}
],
"plugins": ["prettier-plugin-jinja-template", "prettier-plugin-packagejson"]

View File

@@ -1,10 +1,13 @@
# Chat Analytics Dashboard
A Django application that creates an analytics dashboard for chat session data. The application allows different companies to have their own dashboards and view their own data.
A Django application that creates an analytics dashboard for chat session data. The application allows different
companies to have their own dashboards and view their own data.
## Project Overview
This Django project creates a multi-tenant dashboard application for analyzing chat session data. Companies can upload their chat data (in CSV format) and view analytics and metrics through an interactive dashboard. The application supports user authentication, role-based access control, and separate data isolation for different companies.
This Django project creates a multi-tenant dashboard application for analyzing chat session data. Companies can upload
their chat data (in CSV format) and view analytics and metrics through an interactive dashboard. The application
supports user authentication, role-based access control, and separate data isolation for different companies.
### Project Structure
@@ -39,8 +42,8 @@ The project consists of two main Django apps:
1. Clone the repository:
```sh
git clone <repository-url>
cd LiveGraphsDjango
git clone https://github.com/kjanat/livegraphs-django.git
cd livegraphs-django
```
2. Install uv if you don't have it yet:
@@ -137,7 +140,7 @@ The project consists of two main Django apps:
python manage.py runserver
```
10. Access the application at <http://127.0.0.1:8000/>
10. Access the application at `http://127.0.0.1:8000/`
### Development Workflow with UV
@@ -187,8 +190,8 @@ UV offers several advantages over traditional pip, including faster dependency r
1. Clone the repository:
```sh
git clone <repository-url>
cd dashboard_project
git clone https://github.com/kjanat/livegraphs-django.git
cd livegraphs-django
```
2. Build and run with Docker Compose:
@@ -199,9 +202,9 @@ UV offers several advantages over traditional pip, including faster dependency r
3. Create a superuser:
```sh
docker-compose exec web python manage.py createsuperuser
```
```sh
docker-compose exec web python manage.py createsuperuser
```
4. Access the application at <http://localhost/>
@@ -209,7 +212,8 @@ docker-compose exec web python manage.py createsuperuser
### Prettier for Django Templates
This project uses Prettier with the `prettier-plugin-django-annotations` plugin to format HTML templates with Django template syntax.
This project uses Prettier with the `prettier-plugin-django-annotations` plugin to format HTML templates with Django
template syntax.
#### Prettier Configuration
@@ -342,6 +346,7 @@ This will create:
- Fill in the company details and save
3. **Create Users**:
- Go to Users > Add User
- Fill in user details
- Assign the user to a company
@@ -362,6 +367,7 @@ This will create:
- Click "Upload"
3. **Create a Dashboard**:
- Click on "New Dashboard" in the sidebar
- Fill in the dashboard details
- Select data sources to include
@@ -382,6 +388,7 @@ This will create:
- Use filters to refine results
3. **View Session Details**:
- In search results, click the eye icon for a session
- View complete session information and transcript
@@ -435,7 +442,7 @@ If your dashboard is empty:
The CSV file should contain the following columns:
| Column | Description |
| ------------------- | ------------------------------------------------------ |
|---------------------|--------------------------------------------------------|
| `session_id` | Unique identifier for the chat session |
| `start_time` | When the session started (datetime) |
| `end_time` | When the session ended (datetime) |
@@ -507,6 +514,7 @@ acme_1,2023-05-01 10:30:00,2023-05-01 10:45:00,192.168.1.1,USA,English,10,Positi
- System-wide configuration
7. **Responsive Design**:
- Mobile-friendly interface using Bootstrap 5
- Consistent layout and navigation
- Accessible UI components
@@ -550,6 +558,7 @@ acme_1,2023-05-01 10:30:00,2023-05-01 10:45:00,192.168.1.1,USA,English,10,Positi
- JSON serialization for frontend
3. **User Authentication**:
- Login/registration handling
- Session management
- Permission checks
@@ -590,6 +599,7 @@ acme_1,2023-05-01 10:30:00,2023-05-01 10:45:00,192.168.1.1,USA,English,10,Positi
- Manages company users
3. **Regular Users**:
- View dashboards
- Search and explore chat data
- Analyze chat metrics
@@ -610,4 +620,5 @@ acme_1,2023-05-01 10:30:00,2023-05-01 10:45:00,192.168.1.1,USA,English,10,Positi
## License
This project is unlicensed. Usage is restricted to personal and educational purposes only. For commercial use, please contact the author.
This project is unlicensed. Usage is restricted to personal and educational purposes only. For commercial use, please
contact the author.

View File

@@ -51,7 +51,7 @@
- [ ] Implement periodic data download from external API
- Source: <https://proto.notso.ai/jumbo/chats>
- Authentication: Basic Auth
- Credentials: [stored securely]
- Credentials: stored securely
- An example of the data structure can be found in [jumbo.csv](examples/jumbo.csv)
- The file that the endpoint returns is a CSV file, but the file is not a standard CSV file. It has a different structure and format:
- The header row is missing, it is supposed to be `session_id,start_time,end_time,ip_address,country,language,messages_sent,sentiment,escalated,forwarded_hr,full_transcript,avg_response_time,tokens,tokens_eur,category,initial_msg,user_rating`

View File

@@ -6,7 +6,7 @@
"lint:js": "oxlint",
"lint:js:fix": "bun lint:js -- --fix",
"lint:js:strict": "oxlint --import-plugin -D correctness -W suspicious",
"lint:md": "markdownlint-cli2 \"**/*.md\"",
"lint:md": "markdownlint-cli2 \"**/*.md\" \"#node_modules\" \"#.{node_modules,trunk,grit,venv}\"",
"lint:md:fix": "bun lint:md -- --fix",
"lint:py": "uvx ruff check",
"lint:py:fix": "uvx ruff check --fix",
@@ -21,17 +21,5 @@
"prettier": "^3.6.2",
"prettier-plugin-jinja-template": "^2.1.0",
"prettier-plugin-packagejson": "^2.5.19"
},
"markdownlint-cli2": {
"config": {
"MD013": false,
"MD033": false
},
"ignores": [
".git",
".trunk",
".venv",
"node_modules"
]
}
}