Skip to content

Tushar862584/advocate-diary-app

Repository files navigation

πŸ§‘β€βš–οΈ Advocate Diary App

GitHub license Version Next.js Tests

Advocate Diary Logo

An AI-powered legal case management system designed for modern law firms to streamline case management, enhance productivity, and provide AI-assisted legal insights.

🌟 Features

πŸ€– Smart Advocate Assistant

Our application combines AI-powered legal research with efficient scheduling and document management, making legal tasks more accessible and efficient.

πŸ“’ Advocate Diary

  • Firm Management: Admin case allocation, transfers, and statistical dashboards
  • Schedule Management: Automated hearing scheduling with integrated management features

βš–οΈ Case Tracking & Management

  • Comprehensive Case Information: Court details, dates, legal sections, parties
  • Document Management: Chronological document uploads with timestamps
  • History & Notes: Complete historical hearing records and note-making

🧠 AI Legal Assistant

  • Legal Research: Relevant legal articles and case law suggestions
  • Document Generation: Create standard legal drafts (adjournments, petitions)
  • 24/7 Availability: Instant access to legal information and assistance

πŸŽ›οΈ Admin Panel

  • User Management: Create, update, and remove lawyer accounts
  • Case Management: Track unallocated cases, view case distribution statistics
  • Bulk Operations: Transfer multiple cases between advocates
  • Case Overview: View, edit, reassign and manage all cases

πŸ‘€ User Panel

  • Case Dashboard: View assigned cases with hearing dates, client details
  • Progress Tracking: Update case progress, add notes, reschedule hearings
  • Document Library: Upload and access case-related documents
  • AI Assistant: Access AI-driven retrieval for similar cases and legal articles

πŸ› οΈ Technical Stack

Frontend Backend Database Auth & Security Testing
Next.js 15 Node.js PostgreSQL NextAuth.js Pytest
React Next.js API Routes Prisma ORM CSRF Protection Playwright
TypeScript Server Actions JSON JWT Requests
Tailwind CSS Bcrypt

πŸš€ Getting Started

Prerequisites

  • Node.js v18+
  • PostgreSQL database
  • Python 3.8+ (for testing)
  • npm or pnpm

Installation

  1. Clone the repository
git clone https://github.com/your-username/advocate-diary-app.git
cd advocate-diary-app
  1. Install dependencies
npm install
# or
pnpm install
  1. Configure environment variables
cp .env.example .env
# Edit .env file with your database and authentication settings
  1. Set up the database
npx prisma migrate dev
npx prisma db seed
# (quick and handy way to reset)
npx prisma migrate reset
  1. Start the development server
npm run dev
# or
pnpm dev
  1. Access the application

    The app will be available at http://localhost:3000

πŸ§ͺ Testing

Test Environment Setup

Create a Python virtual environment for testing:

python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install pytest requests playwright pytest-playwright
playwright install chromium # Setup playwright for e2e testing

Running Tests

The application includes several test suites:

API Tests

# Test user operations (create/delete users)
python -m pytest tests/test_user_operations.py

# Test case operations (create/delete cases)
python -m pytest tests/test_case_operations.py

# Test authentication API
python -m pytest tests/test_api_login.py

Unit Tests

# Auth unit tests
python -m pytest tests/test_auth_unit.py

# Form validation tests
python -m pytest tests/test_form_validation.py

E2E Tests with Playwright

# Run end-to-end login tests
python -m pytest tests/test_login_e2e.py

Run All Tests

python -m pytest

Running pytest automates testing process and generates report.html

Test Reports

View the latest automated test report: https://kshg9.github.io/advocate-diary-app/report.html

πŸ“Έ Screenshots

Cases Dashboard
Case Statistics
AI Assistant

πŸ“± Mobile Views

Cases Mobile View AI Chatbot Mobile View
Cases Dashboard AI Assistant
Personal Information

User Profile & Personal Information

πŸ”„ API Endpoints

The application provides RESTful API endpoints for cases and users:

Cases

  • GET /api/cases: Get all cases (filtered by user role)
  • POST /api/cases: Create a new case
  • GET /api/cases/:id: Get a specific case
  • PUT /api/cases/:id: Update a case
  • DELETE /api/cases/:id: Delete a case

Users

  • GET /api/admin/users: Get all users (admin only)
  • POST /api/admin/users: Create a new user (admin only)
  • GET /api/admin/users/:id: Get a specific user (admin only)
  • DELETE /api/admin/users/:id: Delete a user (admin only)

πŸ“œ License

This project is currently Unlicenced - will be changed later.

🌐 Project Website

Visit our project website for more information and documentation: https://kshg9.github.io/advocate-diary-app/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors