Giter VIP home page Giter VIP logo

corpus-backend's Introduction

corpus-backend

Overview of the Architecture

flowchart LR
subgraph Internet
    D[Client]
end

subgraph DOCKER [Docker]

  D --> N{"Load Balancer <br/> (Nginx)"}

  N <==> B[Next.js server]
  N <==> C["<div style='padding: 0rem 1rem;'>api <br/> (koa) </div>  "]

  C <==> R
  C <==> G
  G <==> I

  subgraph Cache
    style Cache margin-top: 100
        R[("<div style='padding: 0rem 0.5rem;'>Redis </div>  ")]
  end

    subgraph Blacklab
    style Blacklab margin-top: 100
        G[("<div style='padding: 0rem 1rem;'>blacklab <br/> (apache lucene) </div> ")]
  end

  subgraph Indexes
    style Indexes margin-top: 100
        I["<div style='padding: 0rem 1rem;'>Indexes <br/> (by Indexer) </div>  "]
  end
end

The user only needs to put the tei files into corpus-backend/blacklab/indexer/tei-data/ and it will be automatically written into the database by the pre-written script indexer.sh when running docker-compose.

We assume here that you are familiar with the BlackLab indexing process; see indexing with BlackLab to learn more.

Setup

1. Download the both frontend and backend projects:

git clone [email protected]:Retr0327/corpus-frontend.git
git clone [email protected]:Retr0327/corpus-backend.git

Hence, the project strucutre should look like this:

corpus-frontend\        
 |-- public\              # some static files
 |-- src\                 # source files
 |-- ...
corpus-backend\
 |-- deployment\          # deployment folder
 |-- src\                 # source files
 |-- ...

3. Environment variables:

For corpus-frontend, please create a .env.local file:

NEXT_PUBLIC_API_URL=http://localhost:3000/service/api/v1
NEXT_PUBLIC_EXTERNAL_API_URL=http://api:3000/service/api/v1

As for corpus-backend, please create a .env file:

BLACKLAB_URL="http://blacklab:8080/blacklab-server"

4. Use docker to run:

  • in development mode:
    docker-compose -f docker-compose.dev.yml up
  • in production mode:
    docker-compose up

Remember to run the command in the backend folder!

Contact Me

If you have any suggestion or question, please do not hesitate to email me at [email protected]

corpus-backend's People

Contributors

retr0327 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.