Skip to content

p-carrillo/project_diteria-blogs

Repository files navigation

Digital Writer

Digital Writer is an automated publishing platform built with Symfony 6. Originally conceived as an experiment exploring the early potential of large language models (LLMs), it uses OpenAI to generate content, integrates with Twitter and WordPress, and stores data in MySQL through Doctrine ORM. The project follows a layered Domain‑Driven Design architecture, keeping the domain logic separate from infrastructure concerns.

Directory overview

src/
  DigitalWriter/
    Application/    – Application services, actions and DTOs
    Domain/         – Entities and repository interfaces
    Infrastructure/ – Adapters, persistence and UI layers
config/             – Symfony configuration
migrations/         – Doctrine database migrations
public/             – Web entry point

Application layer

  • Service classes orchestrate tasks such as generating post structure, creating tweets, or writing articles.
  • Action classes expose use cases used by console commands.
  • Dto objects move data between layers without coupling the domain.

Domain layer

  • Models such as Author, PublishTarget and WriteTopic encapsulate business data.
  • Repository interfaces live here so that the application can depend on abstractions.

Infrastructure layer

  • Adapter implementations connect to external services (OpenAI, Twitter, WordPress, image providers, news feeds).
  • Domain repositories use Doctrine to persist domain models in MySQL.
  • UI contains Symfony console commands and the admin controllers built with EasyAdmin.
  • Symfony service configuration is under Infrastructure/Framework/Symfony/Resources.

Console commands

The main functionality is triggered through Symfony console commands:

  • digital-writer:wordpress-publish – Publish articles to all configured WordPress targets.
  • digital-writer:tweet-topics-publish – Tweet content generated from topics.
  • Additional commands exist under the UI/Console namespace for playing with data and managing targets.

Admin interface

An admin panel is provided at /admin (see DashboardController). Through EasyAdmin you can manage authors, publish targets and writing topics.

Environment variables

API keys and credentials are required for external services. The most relevant variables are:

  • OPENAI_API_KEY – Access token for the OpenAI API.
  • UNSPLASH_API_KEY – API key for fetching images.
  • TWITTER_API_KEYS – JSON with credentials for Twitter accounts.
  • WORDPRESS_API_USER / WORDPRESS_API_PASSWORD – Credentials used to publish posts.
  • GOOGLE_NEWS – Endpoint for retrieving news seeds.

These can be defined in .env.local or your server environment.

Database

Doctrine migrations define the schema for the core tables:

  • dw_author – Authors with prompts and personality information.
  • dw_publish_target – Target blogs or social accounts.
  • dw_topic – Writing topics to be processed.

Run migrations with:

php bin/console doctrine:migrations:migrate

Running tests

Unit tests live under the tests/ directory. Execute them with PHPUnit:

php bin/phpunit

Getting started

  1. Install PHP dependencies using Composer.
  2. Configure the environment variables listed above.
  3. Execute migrations to create the database schema.
  4. Use the console commands or the admin panel to start generating content.

Digital Writer automates the workflow of generating articles, tweets and images. The project began as a proof of concept for early LLM-driven writing experiments.

About

Automated Publisher

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors