A Discord bot to automate job postings and streamline the application process.
Built using Node.js, Playwright, and JavaScript.
- Node.js installed (20.0 or higher)
- Docker (for containerized deployment)
- Environment Variables (see
.env.examplefor required variables):- Discord:
DISCORD_TOKEN,APPLICATION_ID,PUBLIC_KEY - Gmail OAuth:
GMAIL_CLIENT_ID,GMAIL_CLIENT_SECRET,GMAIL_REFRESH_TOKEN - Firebase:
FIREBASE_*credentials
- Discord:
Run the OAuth server:
node backend/config/oauthConfig.jsThen visit http://localhost:3000/auth and sign into the Google account that receives job notification emails. Copy the refresh token into your .env file as GMAIL_REFRESH_TOKEN.
Note: The refresh token is tied to a specific Google account. Make sure to authorize with the account that has the job emails.
Build and start all services:
docker compose up --buildRun in background:
docker compose up --build -dStop services:
docker compose downFirst install dependencies:
npm installScraper (dev mode with hot reload):
npm run scraper:devDiscord bot (dev mode with hot reload):
npm run discord:devProduction mode:
npm run scraper
npm run discord| Script | Description |
|---|---|
npm run scraper |
Run the email scraper once |
npm run scraper:dev |
Run scraper with hot reload (nodemon) |
npm run discord |
Run the Discord bot |
npm run discord:dev |
Run Discord bot with hot reload |
npm test |
Run tests |
npm run test:watch |
Run tests in watch mode |
npm run test:coverage |
Run tests with coverage report |
employment-bot/
├── backend/ # Shared services and utilities
│ ├── config/ # OAuth and Gmail configuration
│ ├── services/ # GmailService, ScrapeService, DatabaseService
│ └── utils/ # Logger and helpers
├── discordBot/ # Discord bot entry point and commands
├── scraperWorker/ # Standalone cron job runner for scraping
├── compose.yaml # Docker Compose configuration
└── Dockerfile # Container build configuration