feat: Initialize project and Phase 1 MyMach Social Next-Gen module structure

This commit is contained in:
cerenX9
2026-07-27 12:46:58 +03:00
commit 75c390d1a4
13 changed files with 257 additions and 0 deletions

12
.gitignore vendored Normal file
View File

@@ -0,0 +1,12 @@
# Python
__pycache__/
*.py[cod]
*$py.class
venv/
.venv/
env/
.env
# Docker / Veritabanı Volume verileri (Sadece klasör açılmışsa)
odoo-web-data/
odoo-db-data/

12
Dockerfile Normal file
View File

@@ -0,0 +1,12 @@
FROM odoo:19.0
USER root
# Gereksinimleri Odoo container'ı içine kopyala
COPY requirements.txt /etc/odoo/
# Gerekli Python paketlerini kur
RUN pip3 install --no-cache-dir -r /etc/odoo/requirements.txt
# Odoo kullanıcısına geri dön
USER odoo

12
config/odoo.conf Normal file
View File

@@ -0,0 +1,12 @@
[options]
addons_path = /mnt/extra-addons
data_dir = /var/lib/odoo
admin_passwd = mymach_master_admin_password_123
db_host = db
db_port = 5432
db_user = odoo
db_password = odoo_secret_db_pass
# Geliştirme modunu ve log seviyesini açıyoruz
log_level = info
limit_time_cpu = 600
limit_time_real = 1200

35
docker-compose.yml Normal file
View File

@@ -0,0 +1,35 @@
version: '3.8'
services:
web:
build: .
container_name: mymach_odoo19
depends_on:
- db
ports:
- "8069:8069" # Odoo Web Arayüzü (http://localhost:8069)
- "8072:8072" # Longpolling / Websocket Portu (Canlı sohbet/bildirimler)
volumes:
- odoo-web-data:/var/lib/odoo
- ./config:/etc/odoo
- ./extra-addons:/mnt/extra-addons
environment:
- HOST=db
- USER=odoo
- PASSWORD=odoo_secret_db_pass
restart: always
db:
image: postgres:16
container_name: mymach_postgres16
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=odoo
- POSTGRES_PASSWORD=odoo_secret_db_pass
volumes:
- odoo-db-data:/var/lib/postgresql/data
restart: always
volumes:
odoo-web-data:
odoo-db-data:

View File

@@ -0,0 +1 @@
from . import models

View File

@@ -0,0 +1,33 @@
{
'name': 'MyMach Next-Gen Social Engine',
'version': '1.0.0',
'category': 'Marketing',
'summary': 'Advanced Social Media Management, AI Assistant, and CRM Integration',
'description': """
MyMach Next-Gen Social Engine
==============================
A complete social media automation tool that does not require Enterprise licenses.
Features:
- Multi-Platform API & OAuth2 Connection (Meta, LinkedIn, X, YouTube)
- Drag-and-Drop Scheduler & Calendar
- AI-Based Text and Trend Hashtag Assistant
- Dynamic Templates & Auto Watermarking
- Vertical Video Render Engine
- Otonom Trend Analytics
- Competitor Social Media Tracking
- Social Listening & CRM Lead Generation
- Approval Workflow
- n8n Webhook & External Service Triggering
""",
'author': 'MyMach',
'website': 'https://www.mymach.com',
'depends': ['base', 'web', 'crm', 'mail'],
'data': [
'security/ir.model.access.csv',
],
'installable': True,
'application': True,
'auto_install': False,
'license': 'LGPL-3',
}

View File

@@ -0,0 +1,4 @@
from . import social_account
from . import social_post
from . import social_media
from . import social_competitor

View File

@@ -0,0 +1,31 @@
from odoo import models, fields, api
class SocialAccount(models.Model):
_name = 'social.account'
_description = 'Social Media Account'
name = fields.Char(string='Account Name', required=True)
platform = fields.Selection([
('facebook', 'Facebook'),
('instagram', 'Instagram'),
('linkedin', 'LinkedIn'),
('x', 'X (Twitter)'),
('youtube', 'YouTube')
], string='Platform', required=True)
active = fields.Boolean(default=True)
access_token = fields.Char(string='Access Token', groups="base.group_system")
refresh_token = fields.Char(string='Refresh Token', groups="base.group_system")
token_expiration = fields.Datetime(string='Token Expiration Date')
# Optional fields for user info
platform_account_id = fields.Char(string='Platform Account ID')
profile_image_url = fields.Char(string='Profile Image URL')
def action_authenticate(self):
# Placeholder for OAuth2 authentication flow
pass
def action_refresh_token(self):
# Placeholder for refreshing the OAuth2 token
pass

View File

@@ -0,0 +1,26 @@
from odoo import models, fields, api
class SocialCompetitor(models.Model):
_name = 'social.competitor'
_description = 'Social Media Competitor Analysis'
name = fields.Char(string='Competitor Name', required=True)
platform = fields.Selection([
('facebook', 'Facebook'),
('instagram', 'Instagram'),
('linkedin', 'LinkedIn'),
('x', 'X (Twitter)'),
('youtube', 'YouTube')
], string='Platform', required=True)
profile_url = fields.Char(string='Profile URL', required=True)
followers_count = fields.Integer(string='Followers Count', readonly=True)
engagement_rate = fields.Float(string='Engagement Rate (%)', readonly=True)
last_scraped = fields.Datetime(string='Last Scraped Date', readonly=True)
notes = fields.Text(string='Analysis Notes')
def action_scrape_data(self):
# Placeholder for BeautifulSoup / Scrapy scraping logic
pass

View File

@@ -0,0 +1,27 @@
from odoo import models, fields, api
class SocialMedia(models.Model):
_name = 'social.media'
_description = 'Social Media Library'
name = fields.Char(string='File Name', required=True)
media_type = fields.Selection([
('image', 'Image'),
('video', 'Video'),
('template', 'Dynamic Template')
], string='Media Type', required=True)
file_data = fields.Binary(string='File', required=True)
mimetype = fields.Char(string='Mime Type')
# AI/Dynamic generation specific fields
is_ai_generated = fields.Boolean(string='AI Generated', default=False)
template_id = fields.Many2one('social.media', string='Source Template', domain=[('media_type', '=', 'template')])
def action_generate_watermark(self):
# Placeholder for PIL watermark logic
pass
def action_generate_video(self):
# Placeholder for MoviePy video generation
pass

View File

@@ -0,0 +1,42 @@
from odoo import models, fields, api
class SocialPost(models.Model):
_name = 'social.post'
_description = 'Social Media Post'
_inherit = ['mail.thread', 'mail.activity.mixin']
name = fields.Char(string='Post Title', required=True, tracking=True)
content = fields.Text(string='Content', tracking=True)
state = fields.Selection([
('draft', 'Draft'),
('approval', 'Waiting for Approval'),
('scheduled', 'Scheduled'),
('published', 'Published'),
('failed', 'Failed')
], string='Status', default='draft', tracking=True)
scheduled_date = fields.Datetime(string='Scheduled Date', tracking=True)
published_date = fields.Datetime(string='Published Date', readonly=True)
account_ids = fields.Many2many('social.account', string='Social Accounts', required=True)
media_ids = fields.Many2many('social.media', string='Media Files')
error_message = fields.Text(string='Error Message', readonly=True)
def action_submit_for_approval(self):
for record in self:
record.state = 'approval'
def action_approve(self):
for record in self:
if record.scheduled_date:
record.state = 'scheduled'
else:
record.action_publish()
def action_publish(self):
for record in self:
# Placeholder for publishing logic
record.state = 'published'
record.published_date = fields.Datetime.now()

View File

@@ -0,0 +1,9 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_social_account_user,social.account.user,model_social_account,base.group_user,1,1,1,0
access_social_account_manager,social.account.manager,model_social_account,base.group_system,1,1,1,1
access_social_post_user,social.post.user,model_social_post,base.group_user,1,1,1,0
access_social_post_manager,social.post.manager,model_social_post,base.group_system,1,1,1,1
access_social_media_user,social.media.user,model_social_media,base.group_user,1,1,1,0
access_social_media_manager,social.media.manager,model_social_media,base.group_system,1,1,1,1
access_social_competitor_user,social.competitor.user,model_social_competitor,base.group_user,1,1,1,0
access_social_competitor_manager,social.competitor.manager,model_social_competitor,base.group_system,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_social_account_user social.account.user model_social_account base.group_user 1 1 1 0
3 access_social_account_manager social.account.manager model_social_account base.group_system 1 1 1 1
4 access_social_post_user social.post.user model_social_post base.group_user 1 1 1 0
5 access_social_post_manager social.post.manager model_social_post base.group_system 1 1 1 1
6 access_social_media_user social.media.user model_social_media base.group_user 1 1 1 0
7 access_social_media_manager social.media.manager model_social_media base.group_system 1 1 1 1
8 access_social_competitor_user social.competitor.user model_social_competitor base.group_user 1 1 1 0
9 access_social_competitor_manager social.competitor.manager model_social_competitor base.group_system 1 1 1 1

13
requirements.txt Normal file
View File

@@ -0,0 +1,13 @@
# Aşama 2: API & OAuth
httpx
requests
# Aşama 4: AI & Medya İşleme
openai
anthropic
Pillow
moviepy
# Aşama 5: Scraping & Trend
beautifulsoup4
scrapy