A command-line interface (CLI) application for managing marketing campaigns, audiences, and geographical targeting using OpenAI's GPT-4 for natural language processing.
- Natural language campaign management
- Create and manage marketing campaigns
- Define and manage target audiences
- Set up geographical targeting
- Interactive CLI interface
- PostgreSQL database integration
- OpenAI GPT-4 powered assistant
- Node.js (v22 or higher)
- PostgreSQL database
- OpenAI API key
- Bun runtime
- Clone the repository:
git clone <repository-url>
cd mediajel-mini
- Install dependencies:
bun install
- Set up environment variables:
cp .env.example .env
Update the .env
file with your credentials:
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/myapp?schema=public"
OPENAI_API_KEY=your_openai_api_key_here
- Start the PostgreSQL database using Docker:
docker-compose up -d
- Run database migrations:
bunx prisma migrate dev
Start the CLI application:
bun start
The CLI will present you with a prompt where you can interact with the marketing assistant using natural language.
Example commands:
- "Create a campaign named 'Summer Sale'"
- "Add an audience targeting young professionals"
- "Set up geographical targeting for California"
- "Pause the 'Summer Sale' campaign"
mediajel-mini/
├── prisma/ # Database schema and migrations
├── src/
│ ├── tools/ # Tool implementations
│ │ ├── audience-tools.ts
│ │ ├── campaign-tools.ts
│ │ └── geo-target-tools.ts
│ ├── chatbot.ts # OpenAI integration
│ └── index.ts # CLI entry point
├── docker-compose.yml # Docker configuration
└── package.json
The application uses Prisma ORM with PostgreSQL and includes the following models:
- Campaign: Marketing campaign details
- Audience: Target audience definitions
- GeoTarget: Geographical targeting information
- Campaign Tools:
- Create campaigns
- Update campaign status
- Delete campaigns
- Retrieve campaign information
- Audience Tools:
- Create audience definitions
- Update audience criteria
- Associate audiences with campaigns
- Delete audience definitions
- Geo-Target Tools:
- Create geographical targeting
- Update targeting regions
- Associate regions with campaigns
- Delete geographical targeting
The application uses GPT-4 to:
- Parse natural language commands
- Convert user intent into actions
- Provide human-like responses
- Handle error cases gracefully
- Define new models in
prisma/schema.prisma
- Create migrations:
bunx prisma migrate dev --name feature_name
- Implement new tools in
src/tools/
- Update the chatbot to handle new capabilities
Run the test suite:
bun test
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
MIT
For support, please open an issue in the repository.