Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restructuring, debugging #381

Open
wants to merge 86 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
23044b8
Create main.py
grlkrash Feb 7, 2025
5001167
artist manager onboarding wizard
grlkrash Feb 7, 2025
d171f62
team management script
grlkrash Feb 7, 2025
9869339
env example file
grlkrash Feb 7, 2025
a681bcf
artist manager-agent
grlkrash Feb 7, 2025
95feefc
telegram bot integration
grlkrash Feb 7, 2025
b891870
artist health tracking feature created
grlkrash Feb 7, 2025
9a61a90
music api and social integrations
grlkrash Feb 7, 2025
0e83f2b
ai mastering service
grlkrash Feb 7, 2025
b77e8c4
music distribution
grlkrash Feb 7, 2025
541eeac
artist onboarding wizard
grlkrash Feb 7, 2025
4138ba0
release planning
grlkrash Feb 7, 2025
76b04c8
artist schedule management
grlkrash Feb 7, 2025
c1a9cd4
social media manager
grlkrash Feb 7, 2025
210f829
team management
grlkrash Feb 7, 2025
befc3ec
basic usage examples
grlkrash Feb 7, 2025
8357572
bot usage example
grlkrash Feb 7, 2025
c24e5cb
full int example
grlkrash Feb 7, 2025
d28e3a5
artist manager main
grlkrash Feb 7, 2025
06a677a
testing suite
grlkrash Feb 7, 2025
f087a05
testing
grlkrash Feb 7, 2025
8116b70
testing
grlkrash Feb 7, 2025
a6fcafe
testing
grlkrash Feb 7, 2025
d1b45b4
testing team management
grlkrash Feb 7, 2025
3547c6c
enhanced payment/financial/budget tracking features
grlkrash Feb 7, 2025
ff7803c
enhanced scheduling
grlkrash Feb 7, 2025
cef4c6e
payments testing
grlkrash Feb 7, 2025
2ea699f
payments
grlkrash Feb 7, 2025
7961799
update team management payments
grlkrash Feb 7, 2025
d0180a3
testing finalization and docs
grlkrash Feb 7, 2025
2d558c3
finalizing , testing , cleanup, consolidation
grlkrash Feb 7, 2025
a16e4b1
update imports
grlkrash Feb 7, 2025
4bf571f
blockchain feats, final integration tests, unit tests etc
grlkrash Feb 8, 2025
9dcc75a
Merge branch 'coinbase:master' into master
grlkrash Feb 8, 2025
10a1159
team mgmt
grlkrash Feb 8, 2025
a2755a5
debugging
grlkrash Feb 9, 2025
752f922
debugging
grlkrash Feb 9, 2025
e508577
Merge branch 'master' of https://github.com/grlkrash/artistmanager00
grlkrash Feb 9, 2025
28573eb
production
grlkrash Feb 9, 2025
568d4c3
debugging
grlkrash Feb 9, 2025
892a11f
debugging deploy
grlkrash Feb 9, 2025
0a317f6
debugging deployment
grlkrash Feb 9, 2025
180b1cc
bot persistance
grlkrash Feb 9, 2025
e367dae
debugging and testing telegram interface
grlkrash Feb 9, 2025
1ca81f4
goal-driven autonomous management system
grlkrash Feb 9, 2025
d01ad60
input handling and onbaording/user flow
grlkrash Feb 9, 2025
dbaa043
artist onboarding flow/ user experience
grlkrash Feb 9, 2025
3b386d2
telegram debugging
grlkrash Feb 9, 2025
ec69d6b
onboarding wizard fixes
grlkrash Feb 10, 2025
f29b232
telegram interface debugging
grlkrash Feb 10, 2025
db48fc6
bot
grlkrash Feb 10, 2025
4430324
Create task_manager.py
grlkrash Feb 10, 2025
494adc3
task manager updates
grlkrash Feb 10, 2025
2a56f70
restructured to use handlers
grlkrash Feb 10, 2025
bd0da16
music handlers
grlkrash Feb 10, 2025
efbd42d
handler updates
grlkrash Feb 10, 2025
83434b1
handler updates
grlkrash Feb 10, 2025
0e970a9
handler updates
grlkrash Feb 10, 2025
4928e98
handler updates
grlkrash Feb 10, 2025
cdf2b98
debugging
grlkrash Feb 10, 2025
79ec676
debugging
grlkrash Feb 11, 2025
5cee90a
onboarding handlers
grlkrash Feb 11, 2025
230976f
onboarding handlers
grlkrash Feb 11, 2025
a980f90
debugging
grlkrash Feb 11, 2025
0c25565
handler updates
grlkrash Feb 11, 2025
403a879
debugging, user flow testing, peristence development
grlkrash Feb 11, 2025
7cc607c
peristance
grlkrash Feb 11, 2025
a486a5a
pickle
grlkrash Feb 11, 2025
aa07217
ux flow debugging
grlkrash Feb 11, 2025
287b163
ux testing
grlkrash Feb 11, 2025
be4c13b
main
grlkrash Feb 11, 2025
12d3bae
ux testing
grlkrash Feb 11, 2025
d5cc0d5
ux testing
grlkrash Feb 11, 2025
a30569b
debugging , debugging, debugging
grlkrash Feb 11, 2025
6fb19fc
debugging
grlkrash Feb 11, 2025
0a5909f
debugging
grlkrash Feb 13, 2025
2f6b0b4
handler debugging
grlkrash Feb 13, 2025
3f833c5
main.py
grlkrash Feb 13, 2025
4b23ccf
debugging
grlkrash Feb 13, 2025
d33f05a
debugging
grlkrash Feb 13, 2025
4a1c9bb
debugging
grlkrash Feb 14, 2025
3718a13
debugging going well
grlkrash Feb 14, 2025
2756ac6
much needed debugging (bot runs again)
grlkrash Feb 14, 2025
f46ea11
user flow debugging (success)
grlkrash Feb 14, 2025
e5e1aa2
handler updates
grlkrash Feb 14, 2025
e9b5a3d
user flow debugging
grlkrash Feb 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Test environment configuration
TELEGRAM_BOT_TOKEN=test_token
OPENAI_API_KEY=test_key
SUPABASE_URL=test_url
SUPABASE_KEY=test_key
AI_MASTERING_KEY=test_key

# Test database configuration
TEST_DB_HOST=localhost
TEST_DB_PORT=5432
TEST_DB_NAME=artist_manager_test
TEST_DB_USER=test_user
TEST_DB_PASSWORD=test_password

# Test API endpoints
TEST_MASTERING_API=http://localhost:8000/mastering
TEST_DISTRIBUTION_API=http://localhost:8000/distribution
TEST_SOCIAL_API=http://localhost:8000/social

# Test feature flags
ENABLE_MOCK_SERVICES=true
ENABLE_TEST_MODE=true
56 changes: 56 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# Virtual Environment
.env
.venv
env/
venv/
ENV/

# IDE
.idea/
.vscode/
*.swp
*.swo
.DS_Store

# Project specific
bot_persistence
*.db
*.db-journal
*.log
.vercel

**/.DS_Store

**/.python-version
Expand Down Expand Up @@ -131,3 +174,16 @@ api.json
# TS Docs
**/typescript/docs/
docs/

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Bot persistence backups
bot_persistence.bak.*
*.bak
39 changes: 39 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-ast
- id: check-json
- id: check-merge-conflict
- id: detect-private-key

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black"]

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies: [flake8-docstrings]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
hooks:
- id: mypy
additional_dependencies:
- types-python-dateutil
- types-requests
- types-aiohttp
180 changes: 180 additions & 0 deletions DEPLOY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
# Deployment Guide

This guide explains how to deploy the Artist Manager Bot in a production environment.

## Prerequisites

- Linux server with systemd
- Python 3.9 or higher
- Root access
- Telegram Bot Token
- OpenAI API Key

## Quick Start

1. Clone the repository:
```bash
git clone https://github.com/yourusername/artistmanager00.git
cd artistmanager00
```

2. Create and configure the environment file:
```bash
cp .env.example .env
# Edit .env with your API keys and configuration
```

3. Run the setup script:
```bash
sudo ./setup_production.sh
```

4. Start the service:
```bash
sudo systemctl start artist_manager
```

## Manual Setup

If you prefer to set up manually or the setup script doesn't work for your environment:

1. Create user and directories:
```bash
sudo groupadd -r artistmanager
sudo useradd -r -g artistmanager -d /opt/artistmanager -s /bin/bash artistmanager
sudo mkdir -p /opt/artistmanager
sudo mkdir -p /var/log/artistmanager
```

2. Copy files and set permissions:
```bash
sudo cp -r . /opt/artistmanager/
sudo chown -R artistmanager:artistmanager /opt/artistmanager
sudo chown -R artistmanager:artistmanager /var/log/artistmanager
```

3. Set up Python environment:
```bash
cd /opt/artistmanager
sudo -u artistmanager python3 -m venv .venv
sudo -u artistmanager .venv/bin/pip install -r requirements.txt
```

4. Install systemd service:
```bash
sudo cp artist_manager.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable artist_manager
```

## Configuration

Edit `/opt/artistmanager/.env`:

```ini
# Required API Keys
TELEGRAM_BOT_TOKEN=your_telegram_token_here
OPENAI_API_KEY=your_openai_key_here

# Optional Configuration
OPENAI_MODEL=gpt-3.5-turbo
LOG_LEVEL=INFO
DATABASE_URL=sqlite:///artist_manager.db
METRICS_PORT=9090

# Optional External Services
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key
AI_MASTERING_KEY=your_ai_mastering_key
```

## Monitoring

1. View logs:
```bash
# Service logs
journalctl -u artist_manager -f

# Application logs
tail -f /var/log/artistmanager/output.log
tail -f /var/log/artistmanager/error.log
```

2. Check metrics:
- Prometheus metrics are available at `http://your-server:9090/metrics`
- Monitor CPU, memory, request counts, and error rates

3. Check service status:
```bash
systemctl status artist_manager
```

## Troubleshooting

1. If the service fails to start:
```bash
journalctl -u artist_manager -n 50
```

2. Check permissions:
```bash
ls -la /opt/artistmanager
ls -la /var/log/artistmanager
```

3. Verify environment:
```bash
sudo -u artistmanager /opt/artistmanager/.venv/bin/python -c "import sys; print(sys.path)"
```

4. Test configuration:
```bash
sudo -u artistmanager /opt/artistmanager/.venv/bin/python /opt/artistmanager/deploy_prod.py --test
```

## Security Notes

1. The service runs with limited privileges
2. File permissions are restricted
3. The service cannot access user home directories
4. System protection is enabled through systemd

## Backup

1. Database:
```bash
cp /opt/artistmanager/artist_manager.db /backup/artist_manager_$(date +%Y%m%d).db
```

2. Configuration:
```bash
cp /opt/artistmanager/.env /backup/env_$(date +%Y%m%d)
```

## Updates

1. Stop the service:
```bash
sudo systemctl stop artist_manager
```

2. Backup current version:
```bash
sudo cp -r /opt/artistmanager /opt/artistmanager_backup_$(date +%Y%m%d)
```

3. Update files:
```bash
sudo cp -r /path/to/new/version/* /opt/artistmanager/
sudo chown -R artistmanager:artistmanager /opt/artistmanager
```

4. Update dependencies:
```bash
sudo -u artistmanager /opt/artistmanager/.venv/bin/pip install -r /opt/artistmanager/requirements.txt
```

5. Restart service:
```bash
sudo systemctl restart artist_manager
```
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Artist Manager Bot

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading