Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ server/dist

# prompts
prompts/debug

venv
.env
.env.local
1 change: 1 addition & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ share/python-wheels/
*.egg
MANIFEST


# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Generated by Django 5.0.2 on 2026-01-29 18:22

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("authentication", "0001_initial"),
("chat", "0004_uploadedfile_uploaded_by"),
]

operations = [
migrations.AddField(
model_name="customuser",
name="role",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="users",
to="chat.role",
),
),
migrations.AlterField(
model_name="customuser",
name="is_active",
field=models.BooleanField(default=True),
),
]
2 changes: 1 addition & 1 deletion backend/backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@
]

MIDDLEWARE = [
"corsheaders.middleware.CorsMiddleware",
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"corsheaders.middleware.CorsMiddleware",
]

ROOT_URLCONF = "backend.urls"
Expand Down
17 changes: 17 additions & 0 deletions backend/chat/migrations/0002_conversation_summary.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 5.0.2 on 2026-01-27 06:27

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("chat", "0001_initial"),
]

operations = [
migrations.AddField(
model_name="conversation",
name="summary",
field=models.TextField(blank=True, null=True),
),
]
26 changes: 26 additions & 0 deletions backend/chat/migrations/0004_uploadedfile_uploaded_by.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 5.0.2 on 2026-01-29 09:40

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("chat", "0003_uploadedfile"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.AddField(
model_name="uploadedfile",
name="uploaded_by",
field=models.ForeignKey(
default=1,
on_delete=django.db.models.deletion.CASCADE,
related_name="uploaded_files",
to=settings.AUTH_USER_MODEL,
),
preserve_default=False,
),
]
15 changes: 15 additions & 0 deletions backend/chat/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def __str__(self):
class Conversation(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
title = models.CharField(max_length=100, blank=False, null=False, default="Mock title")
summary = models.TextField(blank=True, null=True)
created_at = models.DateTimeField(auto_now_add=True)
modified_at = models.DateTimeField(auto_now=True)
active_version = models.ForeignKey(
Expand All @@ -31,6 +32,20 @@ def version_count(self):

version_count.short_description = "Number of versions"

#Generate_summary
def generate_summary(self):
if not self.active_version:
return ""

messages = self.active_version.messages.all()
full_text = " ".join(message.content for message in messages)

return full_text[:200] + "..." if len(full_text) > 200 else full_text

def save(self, *args, **kwargs):
self.summary = self.generate_summary()
super().save(*args, **kwargs)


class Version(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
Expand Down
4 changes: 2 additions & 2 deletions backend/dependencies.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
aiohttp==3.8.5
aiohttp>=3.9.5
aiosignal==1.3.1
asgiref==3.7.2
async-timeout==4.0.3
Expand All @@ -24,7 +24,7 @@ identify==2.5.30
idna==3.4
isort==5.12.0
mccabe==0.7.0
multidict==6.0.4
multidict>=6.1.0
mypy-extensions==1.0.0
nodeenv==1.8.0
openai==0.28.1
Expand Down
Binary file not shown.
Binary file not shown.
Binary file added backend/uploads/dummy_bank_statement.pdf
Binary file not shown.
Binary file added backend/uploads/dummy_long_document.pdf
Binary file not shown.
Binary file added backend/uploads/dummy_long_document_HzEBVgj.pdf
Binary file not shown.
Binary file added backend/uploads/dummy_long_document_m33PNEx.pdf
Binary file not shown.
Binary file added backend/uploads/dummy_long_document_mvo33o8.pdf
Binary file not shown.
Binary file added backend/uploads/dummy_marksheet.pdf
Binary file not shown.
Binary file added backend/uploads/dummy_offer_letter.pdf
Binary file not shown.
Binary file added backend/uploads/dummy_offer_letter_MM5JbC2.pdf
Binary file not shown.
Binary file added backend/uploads/invoice.pdf
Binary file not shown.
Binary file added backend/uploads/resume.pdf
Binary file not shown.
Binary file added backend/uploads/rrb.pdf
Binary file not shown.
Binary file added backend/uploads/rrb_zL40WDI.pdf
Binary file not shown.
6 changes: 6 additions & 0 deletions comands.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
backend - python manage.py runserver
frontend - npn run dev
cronjob - (to remove) python manage.py crontab remove
(to add)-python manage.py crontab add
psql - psql soulpage_db
(tabels)-\dt
Loading