Skip to content

KOLLE1/Law-Help

 
 

Repository files navigation

Cameroon Legal Assistant Application

A comprehensive legal assistance platform connecting Cameroonians with legal resources and qualified lawyers.

Features

  • AI-powered legal assistance for common legal questions
  • Lawyer directory with ratings and reviews
  • Lawyer application and profile management
  • User authentication with email/SMS 2FA
  • Dark/light theme support
  • Search history tracking
  • Responsive design for all devices

Getting Started

Prerequisites

  • Node.js 18 or higher
  • XAMPP (for local development)
  • Docker (for production deployment)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/cameroon-legal-assistant.git
cd cameroon-legal-assistant
  1. Install dependencies:
npm install
  1. Set up the database:
  • Start XAMPP
  • Create a new database named lawhelp
  • Import the database schema from database/schema.sql
  1. Configure environment variables:
cp .env.example .env

Edit .env with your configuration:

DB_HOST=localhost
DB_USER=root
DB_PASS=
DB_NAME=lawhelp
JWT_SECRET=your_secret_key
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-specific-password
SMS_PROVIDER_API_KEY=your-sms-api-key
VITE_AI_MODEL_ENDPOINT=http://localhost:5000/predict
  1. Start the development server:
npm run dev

Default Login Credentials

AI Model Integration

The application uses a custom AI model for legal assistance. To integrate your trained model:

  1. Place your model files in the ai-model directory:
ai-model/
  ├── models/          # Trained model files
  ├── src/            # Model serving code
  ├── requirements.txt # Python dependencies
  └── Dockerfile      # Container configuration
  1. Update the model endpoint in .env:
VITE_AI_MODEL_ENDPOINT=http://localhost:5000/predict
  1. Build and run the Docker containers:
docker-compose up -d

Two-Factor Authentication

Email 2FA Setup

  1. Configure SMTP settings in .env:
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-specific-password
  1. For Gmail:
  • Enable 2-Step Verification in your Google Account
  • Generate an App Password for the application
  • Use the App Password in SMTP_PASS

SMS 2FA Setup

  1. Configure SMS provider in .env:
SMS_PROVIDER_API_KEY=your-sms-api-key
  1. Update SMS service configuration in services/auth/src/config/sms.js

Architecture

The application follows a microservices architecture with the following services:

  • Frontend (React + TypeScript)
  • Auth Service (with 2FA support)
  • User Service
  • Lawyer Service
  • Chat Service (with AI model integration)
  • Rating Service
  • History Service

Each service is containerized using Docker and can be deployed independently.

For detailed architecture information, see ARCHITECTURE.md.

API Documentation

Authentication

POST /api/auth/login
POST /api/auth/register
POST /api/auth/verify-2fa
POST /api/auth/logout

Lawyers

GET /api/lawyers
GET /api/lawyers/:id
POST /api/lawyers/apply
PUT /api/lawyers/:id
POST /api/lawyers/:id/rate

Users

GET /api/users/profile
PUT /api/users/profile
PUT /api/users/password
PUT /api/users/2fa

Chat

POST /api/chat/send
GET /api/chat/history

Docker Deployment

  1. Build the images:
docker-compose build
  1. Start the services:
docker-compose up -d

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

About

abdou karimu

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.6%
  • JavaScript 1.7%
  • CSS 1.3%
  • HTML 0.4%