Skip to content

Lawhive/technical-assessment-sandbox

Repository files navigation

Lawhive Technical Assessment Sandbox

This project is built using the T3 stack, which includes Next.js, TypeScript, Tailwind CSS, tRPC, and Prisma.

Getting Started

  1. Clone the repository
  2. Install dependencies: pnpm install
  3. Set up your environment variables in .env by copying the .env.example file and filling in the missing values
  4. Setup the database: pnpm run db:push
  5. Run the development server: pnpm run dev
  6. Open http://localhost:3000 in your browser
  7. Open http://localhost:5555 in your browser to view the Prisma database studio

Important files in the project structure

root/
├── prisma/
│ ├── schema.prisma          # Database schema
├── src/
│ ├── components/
│ │ ├── cases/
│ │ │ ├── CreateCase.tsx      # Form component to create a Case
│ │ │ ├── CaseList.tsx        # Component to list all Cases
│ │ ├── ui/                  # Shared UI components with Shadcn
│ ├── pages/
│ │ ├── index.tsx            # The main page of the application
│ ├── server/
│ │ ├── api/
│ │ │ ├── cases/
│ │ │ │ ├── case.ts           # Backend procedures for creating a Case
│ │ │ │ ├── task.ts          # Backend procedures for managing long-running tasks
│ │ ├── inngest/
│ │ │ ├── client.ts          # Familiarity is not required - mocks a long-running background task
├── .env.example             # Initial environment variables
├── package.json
├── README.md

Technologies

Running the app

You'll be able to run the app and interact with the database using the following commands:

# Development
npm dev # Start the development server, with the app on port 3000 and the database studio on 5555

# Managing the database
npm db:push # Push the database schema to the database

For more information on the T3 stack, visit create.t3.gg.

The Application

You’ve been given an an application for a Legal Case Platform that allows a lawyer to create and manage their Cases with their clients.

The application is a sandbox with basic features implemented, it can be changed and critiqued as necessary.

(You don't need to worry about authentication or permissions. You can assume there will only be a single user of the application.)

The Domain

A Case describes a piece of legal work a lawyer is helping their client with.

A Case has a Payment Type which describes how the lawyer will be paid for their work.

There are two types of Payment Type:

  • Fixed Fee: A fixed amount is paid for the case
  • No Win No Fee: A percentage of future compensation is paid for the case (if successful), e.g. "20% of any compensation"

Lawyers can create Cases on the platform, and they specify the Payment Type for each Case.

Lawyers will collect payment from clients, and mark their Case as Paid.

When a case is paid, lawyers will also pay a fee to the platform for facilitating the case.

Depending on the Payment Type of a Case, the fee paid to the platform changes:

  • Fixed Fee Cases are charged a 20% fee of the payment amount
  • No Win No Fee Cases are charged a 40% fee of the payment amount

A Case has a Title, Description, Status, a Payment Type and payment information depending on the Payment Type.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published