Skip to content
This repository has been archived by the owner on Mar 21, 2021. It is now read-only.

NightWing1998/insaaf

Repository files navigation

The insaaf(impartial notion suggestion and astute functioning) companion. It is a system designed to accelerate the court hearings by giving suggestions to the judges of the indian judicial system.

Tech Stack and Directory structure:

The system is using a microservice based architecture and this repo contains the frontend, backend, AI/ML and proxy services. Each folder is a service and might relies on different tech:

Service Tech
Backend Node.Js
ML Python3
Frontend (web) React.Js
Proxy Nginx
Database MongoDB

Refer to individual docs.MD inside these folders for more information on them

Installation

The installation can be tricky as the system architecture is micro-service based.

  • Local or development environment:
    • Clone the repo or your fork:
      git clone https://github.com/NightWing1998/insaaf.git
                          #OR
      git clone https://github.com/<username>/insaaf.git
    • Using docker: REQUIREMENT : YOU NEED DOCKER AND DOCKER-COMPOSE INSTALLED Just clone/download the repo and run docker-compose up --build. That's it!! Your application shoud be up and running on http://localhost
    • Using installed languages REQUIREMENT: NODE.JS, YARN/NPM, PYTHON3, PIP, MONGODB
      • For backend:
        cd backend
        yarn install #or npm install
        #take a look at config before runnig
        yarn run server #or npm run server
      • For AI/ML:
        cd ml
        venv env
        source env/bin/activate
        pip3 install --no-cache-dir -r requirements.txt #or python3 -m pip install --no-cache-dir -r requirements.txt
        python3 app.py
      • For Frontend:
        cd web
        yarn install #or npm install
        yarn web
      • For Proxy: Not required
      • For database: Install MongoDB Documentation
  • For deploying in cloud:
    • The repo contains a file docker-compose.prod.yml
    • Set the following environment variables:
      CONTAINER_REGISTRY= #URL TO YOUR REGISTRY
      VERSION="latest" #OR SPECIFIC VERSION FOR EG: 1.0.0
      MONGO_USERNAME= #MONGODB USERNAME
      MONGO_PASSWORD= #MONGODB PASSWORD
    • Run docker-compose -f docker-compose.prod.yml build to build the images.
    • Then run docker-compose -f docker-compose.prod.yml push to push the images to your registry.
    • Go to your cloud console and run instances of these images
  • For deploying in cloud(directly via docker-compose):
    • The repo contains a file docker-compose.deploy.yml
    • Set the following environment variables:
      CONTAINER_REGISTRY= #URL TO YOUR REGISTRY
      VERSION="latest" #OR SPECIFIC VERSION FOR EG: 1.0.0
      MONGO_USERNAME= #MONGODB USERNAME
      MONGO_PASSWORD= #MONGODB PASSWORD
    • Run command docker-compose -f docker-compose.deploy.yml up and it's up and running on port 80 and 443

TODOs

  • Add a configuration section to the README.md to configure the installations
  • Add docs.md to individual service folders to state it's purpose, stack and API endpoints if any.

Contributors

License

MIT