Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 934 Bytes

File metadata and controls

44 lines (30 loc) · 934 Bytes

Setting up .env

Duplicate the .env.sample file and rename it to .env, fill in the missing values.

For question service (./question-service/.env.sample):

ENV=PROD
DB_CLOUD_URI=<MongoDB Atlas URL>

For question service's scraper (./question-service/scraper/.env.sample):

DB_CLOUD_URI=<MongoDB Atlas URL>

Populating the Question DB

# Navigate to the scraper directory 
cd question-service/scraper

# Scrape questions from LeetCode and store to MongoDB 
# Parameters will default to 200 if not provided
python main.py <NUMBER_OF_EASY_QUESTIONS> <NUMBER_OF_MEDIUM_QUESTIONS> <NUMBER_OF_HARD_QUESTIONS>

Run Independently

To run question-service independently (i.e. without other services running), run the following commands:

Navigate to the ./question-service directory

# Install dependencies
npm i

# Run question-service
npm run dev

# Run test
npm run test