{"id":20419463,"url":"https://github.com/risingstack/multi-process-nodejs-example","last_synced_at":"2025-10-08T10:50:15.456Z","repository":{"id":39042589,"uuid":"75627955","full_name":"RisingStack/multi-process-nodejs-example","owner":"RisingStack","description":null,"archived":false,"fork":false,"pushed_at":"2017-04-18T15:12:20.000Z","size":65,"stargazers_count":517,"open_issues_count":1,"forks_count":141,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-08-02T19:50:37.436Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RisingStack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-05T13:36:01.000Z","updated_at":"2025-07-17T15:42:06.000Z","dependencies_parsed_at":"2022-07-11T20:17:20.030Z","dependency_job_id":null,"html_url":"https://github.com/RisingStack/multi-process-nodejs-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RisingStack/multi-process-nodejs-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RisingStack%2Fmulti-process-nodejs-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RisingStack%2Fmulti-process-nodejs-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RisingStack%2Fmulti-process-nodejs-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RisingStack%2Fmulti-process-nodejs-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RisingStack","download_url":"https://codeload.github.com/RisingStack/multi-process-nodejs-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RisingStack%2Fmulti-process-nodejs-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278931653,"owners_count":26070788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T06:37:13.500Z","updated_at":"2025-10-08T10:50:15.421Z","avatar_url":"https://github.com/RisingStack.png","language":"JavaScript","readme":"# Multi-process Node.js application example\n\nThe application consists of 3 processes:\n\n  - [`twitter-stream-worker`](#twitter-stream-worker)\n  - [`social-preprocessor-worker`](#social-preprocessor-worker)\n  - [`web`](#web)\n\n## Processes\n\nUse the `PROCESS_TYPE` environment variable to select the process to be run.\n\n```shell\n$ PROCESS_TYPE=web NODE_ENV=production npm start\n```\n\n### Twitter stream worker\n\nThe process is listening on twitter for keywords and sends the tweets to a RabbitMQ queue.\n\n#### Environment variables\n\n  - `NODE_ENV` (`'development' | 'production'`): when `development`, it uses dotenv, to read the local `.env` file, that's the only difference\n  - `LOGGER_LEVEL` (`'error' | 'warn' | 'info' | 'verbose' | 'debug' | 'silly'`), default: `info`\n  - `LOGGER_ENABLED` (`'true' | 'false'`), default: `true`\n  - `TWITTER_CONSUMER_KEY`\n  - `TWITTER_CONSUMER_SECRET`\n  - `TWITTER_ACCESS_TOKEN_KEY`\n  - `TWITTER_ACCESS_TOKEN_SECRET`\n  - `TWITTER_TRACK`: comma separated keywords to track, eg. `nodejs,node.js,risingstack,microservice,micro-service`\n  - `RABBITMQ_URI`\n\n### Social preprocessor worker\n\nThe process is listening on the RabbitMQ queue and saves the tweets to Redis and removes old ones.\n\n#### Environment variables\n\n  - `NODE_ENV` (`'development' | 'production'`): when `development`, it uses dotenv, to read the local `.env` file, that's the only difference\n  - `LOGGER_LEVEL` (`'error' | 'warn' | 'info' | 'verbose' | 'debug' | 'silly'`), default: `info`\n  - `LOGGER_ENABLED` (`'true' | 'false'`), default: `true`\n  - `RABBITMQ_URI`\n  - `REDIS_URI`\n  - `REDIS_DATA_RETENTION_IN_MS`, default: `86400000` (1 day)\n\n### Web\n\nThe process is serving an HTTP API to return the tweets.\n\n  - `GET /api/v1/tweets?limit\u0026offset`\n\n#### Environment variables\n\n  - `NODE_ENV` (`'development' | 'production'`): when `development`, it uses dotenv, to read the local `.env` file, that's the only difference\n  - `LOGGER_LEVEL` (`'error' | 'warn' | 'info' | 'verbose' | 'debug' | 'silly'`), default: `info`\n  - `LOGGER_ENABLED` (`'true' | 'false'`), default: `true`\n  - `REDIS_URI`\n  - `PORT`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frisingstack%2Fmulti-process-nodejs-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frisingstack%2Fmulti-process-nodejs-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frisingstack%2Fmulti-process-nodejs-example/lists"}