๐Ÿง‘โ€โš–๏ธ 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

โš–๏ธ Case Tracking & Management

๐ŸŽ›๏ธ Admin Panel

๐Ÿ‘ค User Panel

๐Ÿ› ๏ธ 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

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

Users

๐Ÿ“œ 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/