diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 00000000..55b1a380 --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +docs.trypost.it diff --git a/docs/contributing.md b/docs/contributing.md new file mode 100644 index 00000000..c4e513b6 --- /dev/null +++ b/docs/contributing.md @@ -0,0 +1,138 @@ +# Contributing to TryPost + +Thank you for your interest in contributing to TryPost! This guide will help you get started. + +## Ways to Contribute + +- **Report bugs** - Found a bug? Open an issue +- **Suggest features** - Have an idea? Start a discussion +- **Improve docs** - Fix typos, add examples, clarify instructions +- **Write code** - Fix bugs or implement new features + +## Development Setup + +### Prerequisites + +- PHP 8.2+ +- Node.js 18+ +- PostgreSQL or MySQL +- Redis +- Composer + +### Setup + +1. Fork and clone the repository: + +```bash +git clone https://github.com/YOUR_USERNAME/trypost.git +cd trypost +``` + +2. Install dependencies: + +```bash +composer install +npm install +``` + +3. Configure environment: + +```bash +cp .env.example .env +php artisan key:generate +``` + +4. Set up database and run migrations: + +```bash +php artisan migrate +``` + +5. Start development servers: + +```bash +# Terminal 1 - Laravel +php artisan serve + +# Terminal 2 - Vite +npm run dev + +# Terminal 3 - Queue worker +php artisan horizon:watch +``` + +## Code Style + +### PHP + +We use [Laravel Pint](https://laravel.com/docs/pint) for PHP code formatting: + +```bash +# Check code style +vendor/bin/pint --test + +# Fix code style +vendor/bin/pint +``` + +### JavaScript/TypeScript + +We use ESLint and Prettier: + +```bash +# Lint +npm run lint + +# Format +npm run format +``` + +## Testing + +Run the test suite before submitting changes: + +```bash +php artisan test +``` + +## Pull Request Process + +1. **Create a branch** from `develop`: + +```bash +git checkout -b feature/your-feature-name +``` + +2. **Make your changes** and commit with clear messages + +3. **Run tests** and ensure they pass + +4. **Run code formatters**: + +```bash +vendor/bin/pint +npm run lint +npm run format +``` + +5. **Push** and create a pull request to the `develop` branch + +6. **Describe your changes** in the PR description + +## Commit Messages + +Write clear commit messages: + +- `fix: resolve login redirect issue` +- `feat: add Pinterest scheduling support` +- `docs: update installation guide` +- `refactor: simplify post creation logic` + +## Questions? + +- [GitHub Discussions](https://github.com/trypost-it/trypost/discussions) - For questions and ideas +- [GitHub Issues](https://github.com/trypost-it/trypost/issues) - For bugs and feature requests + +## License + +By contributing, you agree that your contributions will be licensed under the same license as the project (FSL). diff --git a/docs/features/scheduling.md b/docs/features/scheduling.md new file mode 100644 index 00000000..c0cb2919 --- /dev/null +++ b/docs/features/scheduling.md @@ -0,0 +1,54 @@ +# Scheduling Posts + +TryPost makes it easy to schedule your social media content in advance. + +## Creating a Scheduled Post + +1. Click **Create Post** or click on a date in the calendar +2. Write your content +3. Add media (images or videos) if desired +4. Select the accounts you want to post to +5. Choose the date and time +6. Click **Schedule** + +## The Calendar View + +The calendar shows all your scheduled posts: + +- **Drag and drop** posts to reschedule them +- **Click** on a post to view, edit, or delete it +- **Filter** by account or status +- **Switch views** between month, week, or day + +## Post Status + +Posts can have the following statuses: + +| Status | Description | +|--------|-------------| +| **Draft** | Saved but not scheduled | +| **Scheduled** | Waiting to be published | +| **Publishing** | Currently being sent to platforms | +| **Published** | Successfully posted | +| **Failed** | Failed to publish (check error details) | + +## Multi-Platform Posting + +You can post to multiple platforms at once: + +1. Select multiple accounts when creating a post +2. TryPost will adapt the content for each platform +3. Each platform's post is tracked separately + +## Best Times to Post + +Consider your audience's timezone and activity patterns when scheduling. General guidelines: + +- **LinkedIn**: Tuesday-Thursday, 9am-12pm +- **X/Twitter**: Weekdays, 8am-10am and 6pm-9pm +- **Instagram**: Monday-Friday, 11am-1pm and 7pm-9pm +- **Facebook**: Wednesday-Friday, 1pm-4pm + +## Queue (Coming Soon) + +Future versions will support a post queue where you can add content and let TryPost automatically schedule it at optimal times. diff --git a/docs/features/team.md b/docs/features/team.md new file mode 100644 index 00000000..b4cee4b9 --- /dev/null +++ b/docs/features/team.md @@ -0,0 +1,58 @@ +# Team Management + +Invite team members to collaborate on your social media content. + +## Inviting Members + +1. Go to **Settings** > **Members** +2. Enter the email address of the person you want to invite +3. Select their role +4. Click **Send Invite** + +The invited person will receive an email with a link to join your workspace. + +## Roles + +| Role | Permissions | +|------|-------------| +| **Owner** | Full access, can delete workspace, manage billing | +| **Admin** | Can manage members, accounts, and all posts | +| **Member** | Can create and manage their own posts | + +## Managing Members + +### View Members + +Go to **Settings** > **Members** to see: + +- Current members and their roles +- Pending invites + +### Remove a Member + +1. Go to **Settings** > **Members** +2. Find the member you want to remove +3. Click the remove button +4. Confirm the action + +### Cancel an Invite + +If someone hasn't accepted their invite yet: + +1. Go to **Settings** > **Members** +2. Find the pending invite +3. Click the cancel button + +## Accepting an Invite + +When you receive an invite: + +1. Click the link in the email +2. Log in or create an account (the email will be pre-filled) +3. You'll be automatically added to the workspace + +## Best Practices + +- Use **Admin** role for managers who need full control +- Use **Member** role for content creators +- Regularly review and remove access for people who no longer need it diff --git a/docs/features/workspaces.md b/docs/features/workspaces.md new file mode 100644 index 00000000..07ccc797 --- /dev/null +++ b/docs/features/workspaces.md @@ -0,0 +1,65 @@ +# Workspaces + +Workspaces help you organize your social media accounts, especially if you manage multiple brands or clients. + +## What is a Workspace? + +A workspace is a container that holds: + +- Social media accounts +- Scheduled posts +- Team members +- Settings + +Each workspace is completely separate from others. + +## Creating a Workspace + +1. Click on your current workspace name in the sidebar +2. Click **Create Workspace** +3. Enter a name for the workspace +4. Click **Create** + +## Switching Workspaces + +Click on the workspace name in the sidebar to see all your workspaces and switch between them. + +## Use Cases + +### Agencies + +Create a workspace for each client: + +- Client A Workspace (their social accounts) +- Client B Workspace (their social accounts) +- Your Agency Workspace (your own accounts) + +### Multiple Brands + +If you manage multiple brands: + +- Brand A Workspace +- Brand B Workspace + +### Personal vs Business + +Separate your personal and business presence: + +- Personal Workspace +- Business Workspace + +## Workspace Settings + +Each workspace has its own settings: + +- **Name** - The workspace display name +- **Members** - Who has access (see [Team Management](team.md)) +- **Connected Accounts** - Social media accounts in this workspace + +## Deleting a Workspace + +1. Go to **Settings** > **Workspace** +2. Scroll to the danger zone +3. Click **Delete Workspace** + +> **Warning:** This will delete all posts and disconnect all accounts in the workspace. This action cannot be undone. diff --git a/docs/platforms/mastodon.md b/docs/platforms/mastodon.md new file mode 100644 index 00000000..75ed4bcb --- /dev/null +++ b/docs/platforms/mastodon.md @@ -0,0 +1,45 @@ +# Mastodon + +Connect your Mastodon account to TryPost. + +## How It Works + +Mastodon is a decentralized network with many instances (servers). TryPost automatically registers an OAuth app with your instance when you connect. + +## No Global Configuration Required + +Unlike other platforms, you don't need to configure environment variables for Mastodon. Each user connects to their own instance. + +## Connect Your Account + +1. In TryPost, go to **Accounts** +2. Click **Connect Mastodon** +3. Enter your Mastodon instance URL (e.g., `mastodon.social`, `fosstodon.org`) +4. Click **Authorize** +5. Log in to your Mastodon instance and authorize TryPost +6. You're ready to post! + +## Supported Features + +- ✅ Text posts (toots) +- ✅ Image posts (up to 4 images) +- ✅ Video posts +- ✅ Content warnings (CW) +- ✅ Visibility settings (public, unlisted, private, direct) +- ✅ Hashtags +- ✅ Mentions + +## Popular Instances + +Some popular Mastodon instances: + +- `mastodon.social` - The original instance +- `fosstodon.org` - For open source enthusiasts +- `hachyderm.io` - For tech professionals +- `mas.to` - General purpose + +You can connect accounts from any Mastodon-compatible instance (including Hometown, Pleroma, etc.). + +## Character Limits + +Character limits vary by instance. Most use the default 500 characters, but some instances allow more. diff --git a/docs/self-hosting/docker.md b/docs/self-hosting/docker.md new file mode 100644 index 00000000..a3ecbd41 --- /dev/null +++ b/docs/self-hosting/docker.md @@ -0,0 +1,22 @@ +# Docker Deployment + +> **Coming Soon:** Docker support is planned but not yet available. + +## Planned Features + +- Official Docker image +- Docker Compose configuration +- One-command deployment +- Auto-updates + +## Want to Help? + +If you'd like to contribute Docker support, please: + +1. Check [GitHub Issues](https://github.com/trypost-it/trypost/issues) for existing discussions +2. Open an issue to discuss your approach +3. Submit a pull request + +## Alternative: Manual Deployment + +In the meantime, follow the [Production Setup](production.md) guide for manual deployment. diff --git a/docs/self-hosting/production.md b/docs/self-hosting/production.md new file mode 100644 index 00000000..0aa10e91 --- /dev/null +++ b/docs/self-hosting/production.md @@ -0,0 +1,174 @@ +# Production Setup + +This guide covers deploying TryPost to a production environment. + +## Environment Configuration + +Set these values in your `.env` for production: + +```env +APP_ENV=production +APP_DEBUG=false +APP_URL=https://your-domain.com + +SELF_HOSTED=true +``` + +## Optimizations + +Run these commands after deployment: + +```bash +# Cache configuration +php artisan config:cache + +# Cache routes +php artisan route:cache + +# Cache views +php artisan view:cache + +# Optimize autoloader +composer install --optimize-autoloader --no-dev +``` + +## Queue Worker + +TryPost uses queues for background processing. Use Supervisor to keep the queue worker running. + +### Install Supervisor + +```bash +# Ubuntu/Debian +sudo apt install supervisor + +# CentOS/RHEL +sudo yum install supervisor +``` + +### Configure Supervisor + +Create `/etc/supervisor/conf.d/trypost-worker.conf`: + +```ini +[program:trypost-horizon] +process_name=%(program_name)s +command=php /var/www/trypost/artisan horizon +autostart=true +autorestart=true +stopasgroup=true +killasgroup=true +user=www-data +redirect_stderr=true +stdout_logfile=/var/www/trypost/storage/logs/horizon.log +stopwaitsecs=3600 +``` + +Then start it: + +```bash +sudo supervisorctl reread +sudo supervisorctl update +sudo supervisorctl start trypost-horizon +``` + +## Nginx Configuration + +Example Nginx configuration: + +```nginx +server { + listen 80; + listen [::]:80; + server_name your-domain.com; + return 301 https://$server_name$request_uri; +} + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name your-domain.com; + + root /var/www/trypost/public; + index index.php; + + ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem; + + add_header X-Frame-Options "SAMEORIGIN"; + add_header X-Content-Type-Options "nosniff"; + + charset utf-8; + + location / { + try_files $uri $uri/ /index.php?$query_string; + } + + location = /favicon.ico { access_log off; log_not_found off; } + location = /robots.txt { access_log off; log_not_found off; } + + error_page 404 /index.php; + + location ~ \.php$ { + fastcgi_pass unix:/var/run/php/php8.4-fpm.sock; + fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; + include fastcgi_params; + } + + location ~ /\.(?!well-known).* { + deny all; + } + + client_max_body_size 100M; +} +``` + +## SSL Certificate + +Use Let's Encrypt for free SSL: + +```bash +sudo apt install certbot python3-certbot-nginx +sudo certbot --nginx -d your-domain.com +``` + +## Scheduled Tasks + +Add the Laravel scheduler to cron: + +```bash +crontab -e +``` + +Add this line: + +``` +* * * * * cd /var/www/trypost && php artisan schedule:run >> /dev/null 2>&1 +``` + +## File Permissions + +Set correct permissions: + +```bash +sudo chown -R www-data:www-data /var/www/trypost +sudo chmod -R 755 /var/www/trypost +sudo chmod -R 775 /var/www/trypost/storage +sudo chmod -R 775 /var/www/trypost/bootstrap/cache +``` + +## Monitoring + +Consider setting up monitoring for: + +- Server health (CPU, memory, disk) +- Application errors (Laravel logs) +- Queue status (Horizon dashboard at `/horizon`) + +## Backups + +Regularly backup: + +- Database +- `.env` file +- Uploaded media (if using local storage) diff --git a/docs/self-hosting/requirements.md b/docs/self-hosting/requirements.md new file mode 100644 index 00000000..829e9fb2 --- /dev/null +++ b/docs/self-hosting/requirements.md @@ -0,0 +1,78 @@ +# Server Requirements + +This guide covers the requirements for self-hosting TryPost. + +## Minimum Requirements + +| Component | Minimum | Recommended | +|-----------|---------|-------------| +| CPU | 1 core | 2+ cores | +| RAM | 1 GB | 2+ GB | +| Storage | 10 GB | 20+ GB (depends on media storage) | + +## Software Requirements + +### Required + +- **PHP 8.2+** with extensions: + - BCMath, Ctype, JSON, Mbstring, OpenSSL, PDO, Tokenizer, XML + - GD or Imagick (for image processing) + - Redis extension +- **Composer** 2.x +- **Node.js** 18+ and npm +- **PostgreSQL** 14+ or **MySQL** 8+ +- **Redis** 6+ + +### Optional + +- **Nginx** or **Apache** (for production) +- **Supervisor** (for queue workers) +- **SSL certificate** (Let's Encrypt recommended) + +## PHP Configuration + +Recommended `php.ini` settings: + +```ini +upload_max_filesize = 100M +post_max_size = 100M +memory_limit = 256M +max_execution_time = 300 +``` + +## Supported Operating Systems + +TryPost can run on any OS that supports the required software: + +- Ubuntu 22.04+ (recommended) +- Debian 11+ +- CentOS/RHEL 8+ +- macOS (for development) +- Windows with WSL2 (for development) + +## Cloud Providers + +TryPost works well on: + +- DigitalOcean Droplets +- AWS EC2 +- Google Cloud Compute +- Hetzner Cloud +- Linode +- Vultr + +## Storage Considerations + +Media files (images, videos) can be stored: + +- **Locally** - On the server's disk +- **S3** - Amazon S3 +- **R2** - Cloudflare R2 +- **Any S3-compatible** - MinIO, DigitalOcean Spaces, etc. + +For production with heavy media usage, cloud storage is recommended. + +## Next Steps + +- [Production Setup](production.md) +- [Docker Deployment](docker.md)