JobScout is a backend application built with NestJS that scrapes job postings from itviec.com and stores them in a PostgreSQL database. It provides an API to fetch these job listings.
itviec.com based on a provided keyword.dotenv for managing environment variables.Clone the repository:
git clone https://github.com/phambaophuc/JobScout.git
cd JobScout
Install dependencies:
npm install
# or
pnpm install
Configure environment variables:
Create a .env file in the root directory based on .env.example:
cp .env.example .env
Edit the .env file with your PostgreSQL database credentials:
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=your_db_username
DB_PASSWORD=your_db_password
DB_DATABASE=job_finder
Run database migrations:
This will create the necessary tables in your PostgreSQL database.
npm run migration:run
# or
pnpm migration:run
Build the project:
npm run build
# or
pnpm build
Run the application:
# Development mode (with watch)
npm run start:dev
# or
pnpm start:dev
# Production mode
npm run start:prod
# or
pnpm start:prod
You can trigger a job scraping process by sending a POST request to the /insert endpoint with a k query parameter for the job keyword.
Example using curl:
curl -X POST "http://localhost:3000/insert?k=nestjs"
This will scrape jobs related to "nestjs" from itviec.com and store them in the database.
You can retrieve all scraped job listings by sending a GET request to the /jobs endpoint.
Example using curl:
curl -X GET "http://localhost:3000/jobs"
This will return a JSON array of all job postings currently stored in the database.
© 2023 JobScout. All rights reserved.
Back to Top ⬆️