MerchBay
A custom merchandise and apparel design platform built with Laravel 5.0, enabling users to create, customize, and order personalized products.
🚀 Tech Stack
- Framework: Laravel 5.0
- PHP: 7.0 with native mcrypt support
- Web Server: Apache 2.4
- Database: MySQL
- Container: Docker with Apache
- Reverse Proxy: Traefik (for SSL/TLS and routing)
📋 Prerequisites
- Docker and Docker Compose
- Git
- Access to deployment server (for production/dev deployments)
🛠️ Local Development
Building the Docker Image
docker build -t merchbay:dev .
Running Locally
# Create .env file from example
cp .env.example .env
# Update .env with your local configuration
# Set database credentials, mail settings, etc.
# Run with docker-compose (customize docker-compose.yml for local setup)
docker-compose up -d
Environment Variables
The following environment variables are required:
Database Configuration
DB_HOST- Database hostDB_PORT- Database port (default: 3306)DB_DATABASE- Database nameDB_USERNAME- Database usernameDB_PASSWORD- Database password
Application URLs
APP_URL- Application base URLPROD_PRIVATE- Production private server URLIMAGES_URL- Images server URLUPLOAD_URL- Upload directory URL
Mail Configuration
MAIL_DRIVER- Mail driver (smtp)MAIL_HOST- SMTP hostMAIL_PORT- SMTP portMAIL_USERNAME- SMTP usernameMAIL_PASSWORD- SMTP passwordMAIL_ENCRYPTION- Encryption type (tls/ssl)
Third-Party Services
CAPTCHA_SITE_KEY- reCAPTCHA site keyCAPTCHA_SECRET_KEY- reCAPTCHA secret keyANALYTICS_SITE_ID- Google Analytics site IDANALYTICS_CLIENT_ID- Google Analytics client IDANALYTICS_SERVICE_EMAIL- Google Analytics service email
🚢 Deployment
Automated CI/CD with Gitea Actions
This project includes automated deployment workflows using Gitea Actions:
Development Deployment
Push to the dev branch to automatically deploy to dev environment:
git push origin dev
- Deploys to:
https://dev.merchbay.app
Production Deployment
Push to the main or master branch to automatically deploy to production:
git push origin main
- Deploys to:
https://merchbay.app
Docker Registry
Create version tags to build and push to Docker registry:
git tag -a v1.0.0 -m "Release v1.0.0"
git push origin v1.0.0
Workflow Files
.gitea/workflows/deploy-dev.yml- Development deployment.gitea/workflows/deploy.yml- Production deployment.gitea/workflows/build-push.yml- Docker image build and push
📁 Project Structure
merchbay/
├── app/ # Application core
│ ├── Http/ # Controllers, middleware, routes
│ ├── Models/ # Database models
│ └── Services/ # Business logic services
├── config/ # Configuration files
├── database/ # Migrations and seeds
├── public/ # Public assets (images, CSS, JS)
├── resources/ # Views and frontend assets
├── storage/ # Application storage
├── docker-compose.yml # Docker compose configuration
├── Dockerfile # Docker image definition
└── docker-entrypoint.sh # Container startup script
🔧 Development Notes
Storage Permissions
The Docker entrypoint automatically creates and sets proper permissions for:
storage/framework/viewsstorage/framework/cachestorage/framework/sessionsstorage/logsbootstrap/cache
PHP Extensions
The following PHP extensions are installed:
- pdo_mysql
- mbstring
- exif
- pcntl
- bcmath
- mcrypt (native in PHP 7.0)
- tokenizer
- zip
- gd (with freetype and jpeg support)
🐛 Troubleshooting
500 Internal Server Error
- Check container logs:
docker logs merchbay_app - Verify storage permissions are set correctly
- Ensure all environment variables are configured in
.env - Check database connectivity
Storage Permission Issues
The entrypoint script automatically fixes permissions on container start. If issues persist:
docker exec merchbay_app chown -R www-data:www-data storage bootstrap/cache
docker exec merchbay_app chmod -R 775 storage bootstrap/cache
📄 License
Proprietary - All rights reserved
🤝 Support
For support and questions, contact the development team.