Node.JS is required to run the frontend.
npm start
---------
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
- Install the requirements for the project.
pip install -r requirements.txt
- Install MongoDB
- Ensure the environmental variables include MongoDB.
- Run
mongod
to start the MongoDB server. - In another terminal, run
mongo
to run the MongoDB CLI. - Copy and paste the following to the CLI:
db.getCollection('kwic')
.createIndex(
{
lookupKey: 1
/*
* Keys
*
* Normal index
* fieldA: 1, //ascending
* fieldB: -1 //descending
*
* Wildcard index
* '$**': 1, //wildcard index on all fields and subfields in a document
* 'path.to.field.$**': 1 //wildcard index on a specific field and its subpaths
*
* Text index
* fieldA: 'text',
* fieldB: 'text'
*
* Geospatial Index
* locationField: '2dsphere'
*
* Hashed Index
* fieldA: 'hashed'
*/
}, {
/*
* Options (https://docs.mongodb.com/manual/reference/method/db.collection.createIndex/#options-for-all-index-types)
*
* background: true, //ignored in 4.2+
* unique: false,
* name: 'some name',
* partialFilterExpression: {},
* sparse: false,
* expireAfterSeconds: TTL,
* collation: {}
*/
}
);
- Run
app.py
to start the Flask server. - Use Postman or run
dummy_client.py
to send requests to the server.