{"id":30654846,"url":"https://github.com/triptyk/tpk-n8n-ai","last_synced_at":"2025-08-31T09:08:26.750Z","repository":{"id":311632945,"uuid":"1024121081","full_name":"TRIPTYK/tpk-n8n-ai","owner":"TRIPTYK","description":"Base folder for a n8n local installation ","archived":false,"fork":false,"pushed_at":"2025-08-25T16:09:04.000Z","size":3987,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-25T17:42:35.692Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TRIPTYK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-22T08:06:45.000Z","updated_at":"2025-08-25T16:09:08.000Z","dependencies_parsed_at":"2025-08-25T17:42:37.851Z","dependency_job_id":"74b5e25e-7d23-4013-b6a5-d8114df84f78","html_url":"https://github.com/TRIPTYK/tpk-n8n-ai","commit_stats":null,"previous_names":["triptyk/tpk-n8n-ai"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/TRIPTYK/tpk-n8n-ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TRIPTYK%2Ftpk-n8n-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TRIPTYK%2Ftpk-n8n-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TRIPTYK%2Ftpk-n8n-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TRIPTYK%2Ftpk-n8n-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TRIPTYK","download_url":"https://codeload.github.com/TRIPTYK/tpk-n8n-ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TRIPTYK%2Ftpk-n8n-ai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272959553,"owners_count":25022068,"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-08-31T02:00:09.071Z","response_time":79,"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":"2025-08-31T09:08:25.979Z","updated_at":"2025-08-31T09:08:26.741Z","avatar_url":"https://github.com/TRIPTYK.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# n8n AI Docker Environment\n\n## Overview\n\nThis Docker project provides a complete self-hosted AI development environment with the following components:\n\n- **n8n**: A workflow automation platform that connects various services and APIs, providing a low-code interface for building AI-powered workflows\n- **PostgreSQL**: A powerful, open-source relational database used by n8n to store workflows, credentials, and execution data\n- **Qdrant**: A vector database for efficient similarity search and AI embeddings storage\n- **Ollama**: A framework for running large language models locally, enabling AI capabilities without relying on external APIs\n- **Deepseek Coder**: A specialized code generation model (6.7B parameters) designed for programming tasks\n\nThis documentation covers how to manage this environment, with focus on:\n\n- Installation and setup of the complete environment\n- Connecting to PostgreSQL from external tools like TablePlus\n- Backing up your n8n database\n- Restoring your n8n database from backups\n\n### System Architecture\n\nThe following diagram illustrates how the components connect together:\n\n```\n┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐\n│                 │     │                 │     │                 │\n│     Client      │     │      n8n        │     │     Ollama      │\n│     Browser     ├────►│   Workflow      ├────►│   LLM Server    │\n│                 │     │   Automation    │     │   (llama3.2)    │\n│                 │     │                 │     │   (deepseek)    │\n└─────────────────┘     └────────┬────────┘     └─────────────────┘\n                                 │\n                                 │\n                                 ▼\n                        ┌─────────────────┐     ┌─────────────────┐\n                        │                 │     │                 │\n                        │   PostgreSQL   │     │     Qdrant      │\n                        │   Database     │     │   Vector DB     │\n                        │                 │     │                 │\n                        └─────────────────┘     └─────────────────┘\n```\n\nIn this architecture:\n- **n8n** is the central workflow automation platform that orchestrates all components\n- **PostgreSQL** stores n8n workflows, credentials, and execution data\n- **Ollama** provides local LLM capabilities with models like llama3.2 and deepseek-coder\n- **Qdrant** stores vector embeddings for similarity search and AI applications\n- All components run in Docker containers with proper networking\n\n## Installation\n\n### Prerequisites\n\n- Docker and Docker Compose installed on your system\n- Git (optional, for cloning the repository)\n\n### Shared Files\n\nThis project includes a shared folder that allows you to share files between your host machine and the n8n container:\n\n- **Host location**: `./shared` (in the project root)\n- **Container location**: `/data/shared` (inside the n8n container)\n\nYou can place any files in the `./shared` directory that you want n8n to be able to read or write. This is useful for:\n\n- Input files for n8n workflows\n- Output files generated by n8n workflows\n- Configuration files\n- Data files for processing\n\n### Setup Steps\n\n1. **Clone or download the repository**\n\n   ```bash\n   git clone https://github.com/TRIPTYK/tpk-n8n-ai.git\n   cd tpk-n8n-ai\n   ```\n\n2. **Configure environment variables**\n\n   Create a `.env` file in the project root or copy from the example:\n\n   ```bash\n   cp .env.example .env\n   ```\n\n   Edit the `.env` file to set your PostgreSQL credentials:\n\n   ```\n   POSTGRES_USER=root\n   POSTGRES_PASSWORD=password\n   POSTGRES_DB=n8n\n   ```\n\n3. **Start the environment**\n\n   ```bash\n   docker-compose up --profile=cpu -d\n   ```\n\n   This will start all services including PostgreSQL, n8n, and other required components.\n\n4. **Verify PostgreSQL is running**\n\n   ```bash\n   docker ps | grep postgres\n   ```\n\n   You should see the PostgreSQL container running with port 5432 exposed.\n\n## Database Management\n\n### Connecting to PostgreSQL from External Tools\n\nThe PostgreSQL database is configured to be accessible from external tools like TablePlus, pgAdmin, or any other PostgreSQL client. This allows you to directly interact with your database for debugging, data exploration, or manual modifications.\n\n#### Connection Details\n\n```\nHost: localhost (or 127.0.0.1)\nPort: 5432\nUsername: root (or the value in your .env file's POSTGRES_USER)\nPassword: password (or the value in your .env file's POSTGRES_PASSWORD)\nDatabase: n8n (or the value in your .env file's POSTGRES_DB)\n```\n\n#### Connection Diagram\n\n```\n┌─────────────────┐      ┌─────────────────┐\n│                 │      │                 │\n│  TablePlus or   │      │   PostgreSQL    │\n│  other DB tool  ├─────►│   Container     │\n│  on your Mac    │      │   (port 5432)   │\n│                 │      │                 │\n└─────────────────┘      └─────────────────┘\n```\n\n### Database Backup and Restore\n\nTo ensure data safety and enable migration between environments, this project includes scripts for backing up and restoring your n8n database. These scripts connect directly to the PostgreSQL Docker container, so you don't need to have PostgreSQL installed on your host machine.\n\n#### Backup Script\n\nThe `backup_n8n_db.sh` script creates a backup of your PostgreSQL database directly from the Docker container.\n\n**Usage:**\n\n```bash\n./backup_n8n_db.sh\n```\n\n**What it does:**\n\n1. Connects to the PostgreSQL container\n2. Creates a SQL dump of your n8n database\n3. Saves the backup to a `backups` directory with a timestamp\n4. Creates both uncompressed (.sql) and compressed (.gz) versions\n\n**Example output:**\n\n```\nLoading environment variables from .env file...\nStarting PostgreSQL backup of n8n database...\nUsing database: n8n\nUsing username: root\nBackup will be saved to: /path/to/project/backups/n8n_backup_20250722_115054.sql\nUsing PostgreSQL container: tpk-n8n-ai-postgres-1\nBackup completed successfully!\nBackup saved to: /path/to/project/backups/n8n_backup_20250722_115054.sql\nCompressed backup saved to: /path/to/project/backups/n8n_backup_20250722_115054.sql.gz\nDone!\n```\n\n#### Restore Script\n\nThe `restore_n8n_db.sh` script restores your database from a previously created backup.\n\n**Usage:**\n\n```bash\n./restore_n8n_db.sh path/to/backup.sql\n# OR\n./restore_n8n_db.sh path/to/backup.sql.gz\n```\n\n**What it does:**\n\n1. Stops the n8n container to prevent connection issues\n2. Drops the existing database and creates a fresh one\n3. Restores the database from your backup file\n4. Restarts the n8n container\n\n**Example:**\n\n```bash\n./restore_n8n_db.sh backups/n8n_backup_20250722_115054.sql.gz\n```\n\n#### Backup and Restore Flow Diagram\n\n```\n┌─────────────┐     ┌─────────────┐     ┌─────────────┐\n│             │     │             │     │             │\n│  n8n with   │     │  Backup     │     │  Backup     │\n│  PostgreSQL ├────►│  Script     ├────►│  Files      │\n│  Database   │     │             │     │  (.sql/.gz) │\n│             │     │             │     │             │\n└──────┬──────┘     └─────────────┘     └──────┬──────┘\n       │                                        │\n       │                                        │\n       │      ┌─────────────┐                  │\n       │      │             │                  │\n       └─────►│  Restore    │◄─────────────────┘\n              │  Script     │\n              │             │\n              └─────────────┘\n```\n\n### Best Practices\n\n#### Backup and Restore Flow Diagram\n\n```\n┌─────────────┐     ┌─────────────┐     ┌─────────────┐\n│             │     │             │     │             │\n│  n8n with   │     │  Backup     │     │  Backup     │\n│  PostgreSQL ├────►│  Script     ├────►│  Files      │\n│  Database   │     │             │     │  (.sql/.gz) │\n│             │     │             │     │             │\n└──────┬──────┘     └─────────────┘     └──────┬──────┘\n       │                                        │\n       │                                        │\n       │      ┌─────────────┐                  │\n       │      │             │                  │\n       └─────►│  Restore    │◄─────────────────┘\n              │  Script     │\n              │             │\n              └─────────────┘\n```\n\n### Best Practices\n\n- **Regular Backups**: Schedule regular backups of your database, especially before making significant changes to your workflows or configurations.\n- **Version Control**: Keep your backup files in version control or a secure storage location.\n- **Test Restores**: Periodically test the restore process to ensure your backups are valid and the process works as expected.\n- **Backup Before Updates**: Always create a backup before updating n8n or any of its components.\n\n## 💬 Support\n\nJoin the conversation in the [n8n Forum](https://community.n8n.io/), where you\ncan:\n\n- **Share Your Work**: Show off what you’ve built with n8n and inspire others\n  in the community.\n- **Ask Questions**: Whether you’re just getting started or you’re a seasoned\n  pro, the community and our team are ready to support with any challenges.\n- **Propose Ideas**: Have an idea for a feature or improvement? Let us know!\n  We’re always eager to hear what you’d like to see next.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriptyk%2Ftpk-n8n-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftriptyk%2Ftpk-n8n-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriptyk%2Ftpk-n8n-ai/lists"}