How noahlearner/teamwork-tasks-automation works
Project type and purpose
• This is a standalone, server-side Node.js automation tool, scheduled via cron, whose sole purpose is to build monthly recurring tasklists in Teamwork projects.
• At 00:00 on the first of each month it:
• Queries Teamwork’s Projects API for projects in designated categories
• Fetches each project’s roles via the Roles API
• Creates a new tasklist from a pre-built template and assigns each task based on role
File structure
• index.js – the single entry-point script
• package.json & package-lock.json – declare dependencies (node-fetch, moment, btoa)
• node_modules – installed libraries
• No frontend, no database, no microservices—just one service
README for additional insights
• All configuration (company name, API key, category IDs, role-to-user mappings, template IDs) is hard-coded in index.js.
• The script runs on Linux (e.g., Ubuntu on DigitalOcean) and is invoked by a cron entry:
0 0 1 * * cd /root/auto && node index.js > /tmp/project.log
Main components
a. Cron Scheduler (Linux cron daemon)
b. Ubuntu VM / DigitalOcean Droplet (host)
c. Node.js Runtime & index.js (the automation script)
d. Configuration block (company, key, catIds, role names, template IDs)
e. External Teamwork API (Projects, Roles, Tasklists endpoints)
f. Log sink (/tmp/project.log)
Relationships & interactions
• Cron scheduler → triggers → Node.js script
• Script reads its in-code config → initiates HTTP GET to /projects.json
• Receives project list → loops with delays → GET /{projectId}/roles.json
• Builds JSON payload → POST /{projectId}/tasklists.json
• Captures response → writes timestamped entries to the log file
Architectural patterns & design principles
• Scheduled batch processing (cron)
• Rate-limit management via incremental setTimeout delays
• Template method for constructing tasklist payloads
• Single responsibility: one script, one function
Elements
• Arrowheads showing call direction
• A side-attached “Config” block connected to the Script
• A “Log file” sink connected to the Script’s stdout