Automatically generate and publish WordPress articles based on Git activity using AI (Ollama).
Note: This README is also available in Polish below.
github/*/* structure.env filegit clone https://github.com/your-username/wordpress-git-publisher.git
cd wordpress-git-publisher
cp .env.example .env
# Edit .env with your WordPress credentials and other settings
docker compose up -d
http://localhost:9000
git clone https://github.com/your-username/wordpress-git-publisher.git
cd wordpress-git-publisher
make install
cp .env.example .env
# Edit .env with your configuration
make start
.env filestart.sh and stop.sh scripts for easier service management.env file# Start all services
docker compose up -d
# View logs
docker compose logs -f
# Stop services
docker compose down
# Start all services
make start
# Start frontend only
make frontend
# Start backend only
make backend
http://localhost:9000/settings.htmlhttp://localhost:9000github/*/* structurehttp://localhost:9000/healthhttp://localhost:3001/api/healthlogs directory# Replace YYYY-MM-DD with your target date
make publish date=YYYY-MM-DD
Example:
make publish date=2025-06-05
logs/frontend.loglogs/backend.loghttp://localhost:9000/healthhttp://localhost:3001/api/healthCopy .env.example to .env and update the values:
cp .env.example .env
nano .env # or use your preferred text editor
# Server Configuration
PORT=3001
NODE_ENV=development
# Frontend Configuration
FRONTEND_PORT=8088
API_URL=http://localhost:3001
# WordPress Configuration
WORDPRESS_URL=https://your-wordpress-site.com
WORDPRESS_USERNAME=your_username
WORDPRESS_PASSWORD=your_application_password
# Ollama Configuration
OLLAMA_BASE_URL=http://localhost:11434
DEFAULT_MODEL=mistral:7b
# Git Configuration
GIT_SCAN_DEPTH=3
GIT_PATH=/path/to/your/repositories
# Logging
LOG_LEVEL=debug
LOG_FILE=logs/app.log
Skopiuj plik .env.example do .env i zaktualizuj wartości:
cp .env.example .env
nano .env # lub inny edytor tekstu
# Server Configuration
PORT=3001
NODE_ENV=development
# Frontend Configuration
FRONTEND_PORT=8088
API_URL=http://localhost:3001
# WordPress Configuration
WORDPRESS_URL=https://twoja-strona.com
WORDPRESS_USERNAME=twoj_uzytkownik
WORDPRESS_PASSWORD=twoje_haslo_lub_application_password
# Ollama Configuration
OLLAMA_BASE_URL=http://localhost:11437
DEFAULT_MODEL=mistral:7b
# Git Configuration
GIT_SCAN_DEPTH=3
GIT_PATH=/sciezka/do/twoich/repozytoriow
# Logging
LOG_LEVEL=debug
LOG_FILE=logs/app.log

git clone https://github.com/your-username/wordpress-git-publisher.git
cd wordpress-git-publisher
make install
# or
npm install
# Linux/macOS
curl -fsSL https://ollama.ai/install.sh | sh
# Or download from https://ollama.ai/download for Windows
# Start Ollama
ollama serve
# Download a model (in a separate terminal)
ollama pull mistral:7b
# Install dependencies
make install
# Start the application
make start
# Stop the application
make stop
# Restart the application
make restart
# Start in development mode with auto-reload
make dev
# Clean up temporary files
make clean
# Remove node_modules and logs
make distclean
# Show help
make help
https://your-wordpress-site.comhttp://localhost:11434 (default)mistral:7b)/path/to/your/github/repos or C:\Users\username\githubhttps://twoja-domena.comhttp://localhost:11434 (domyślne)mistral:7b)/home/user/github lub C:\Users\user\githubwordpress-git-publisher/
├── server.js # Backend Express.js
├── package.json # Node.js dependencies
├── package-lock.json # Lock file for dependencies
├── public/ # Frontend assets
│ ├── css/
│ │ └── styles.css # Frontend styles
│ ├── js/
│ │ └── app.js # Frontend JavaScript
│ └── index.html # Frontend application
├── logs/ # Application logs
├── .env.example # Example environment variables
├── .gitignore # Git ignore rules
├── Makefile # Development tasks
├── start.sh # Startup script
├── stop.sh # Shutdown script
└── README.md # This documentation
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)This project is licensed under the MIT License - see the LICENSE file for details.
github/*/*.envgit clone https://github.com/your-username/wordpress-git-publisher.git
cd wordpress-git-publisher
make install
cp .env.example .env
# Edytuj plik .env zgodnie z konfiguracją
make start
http://localhost:3001
# Instalacja zależności
make install
# Uruchomienie aplikacji
make start
# Zatrzymanie aplikacji
make stop
# Restart aplikacji
make restart
# Uruchomienie w trybie developerskim z automatycznym przeładowywaniem
make dev
# Czyszczenie plików tymczasowych
make clean
# Usunięcie node_modules i logów
make distclean
# Wyświetlenie pomocy
make help
Ten projekt jest dostępny na licencji MIT - szczegóły w pliku LICENSE.
| Endpoint | Method | Description |
|---|---|---|
/api/health |
GET | Check server status |
/api/test-wordpress |
POST | Test WordPress connection |
/api/test-ollama |
POST | Test Ollama connection |
/api/scan-git |
POST | Scan Git repositories |
/api/generate-article |
POST | Generate AI article |
/api/publish-wordpress |
POST | Publish to WordPress |
The application analyzes the following commit information:
<h1>Project Updates - 2025-06-04</h1>
<p>Today was a productive day in my development projects...</p>
W projekcie wordpress-publisher zrealizowałem następujące zadania:
Łącznie dzisiaj wykonałem 5 commitów w 2 projektach...
## 🛡️ Bezpieczeństwo
- **Application Passwords** zamiast zwykłych haseł WordPress
- **Lokalne przetwarzanie** - dane Git nie opuszczają Twojego serwera
- **HTTPS zalecane** dla produkcji
- **Walidacja danych** na wszystkich endpointach API
## 🚀 Uruchamianie aplikacji
### Rozpoczęcie pracy
```bash
# Instalacja zależności
make install
# Uruchomienie serwerów (backend i frontend)
make start
# W przeglądarce otwórz:
# - Frontend: http://localhost:8088
# - Backend API: http://localhost:3001
# Zatrzymanie wszystkich usług
make stop
# Restart usług
make restart
# Tryb developerski z automatycznym przeładowaniem
make dev
# Czyszczenie plików tymczasowych
make clean
# Pełne czyszczenie (włącznie z node_modules)
make distclean
# Sprawdź czy Ollama działa
ollama list
# Uruchom Ollama jeśli nie działa
ollama serve
# Pobierz wymagany model
ollama pull mistral:7b
# Sprawdź dostępne modele
ollama list
npm run dev # Nodemon z auto-restartowaniem
npm test
npm run lint
MIT License - zobacz plik LICENSE
W razie problemów:
Aby zaktualizować aplikację:
git pull origin main
npm install
npm restart
Autor: Twój Developer
Wersja: 1.0.0
Data: 2025-06-04