A modern bio link management API built with Hyperf framework. This application allows users to create and manage their bio pages with links, social media profiles, and customizable configurations.
- π€ User Management - Registration, authentication, and profiles
- π Link Management - Create, organize, and track link clicks
- π± Social Media Integration - Connect various social platforms
- π Collections - Group links into organized collections
- π¨ Customizable Themes - Multiple layouts and styling options
- π Analytics - Track interactions and engagement
- π§ Configuration System - Flexible settings per profile
- Docker and Docker Compose (required)
git clone https://github.com/wellsm/bio-api.git
cd bio-apiCreate your environment file:
cp .env.example .envEdit .env with your settings:
APP_NAME=bio
APP_KEY=base64:dzJkdzY1eWQxZGRmbGdtbnhwdzhscTJuYmZ5MWxiOGw=
APP_ENV=local
CORS_ALLOWED_ORIGINS=*
DB_DRIVER=mysql
DB_HOST=bio-mysql
DB_PORT=3306
DB_DATABASE=bio
DB_USERNAME=root
DB_PASSWORD=root
DB_CHARSET=utf8mb4
DB_COLLATION=utf8mb4_unicode_ci
DB_PREFIX=
REDIS_HOST=cache
REDIS_AUTH=(null)
REDIS_PORT=6379
REDIS_DB=0
SMTP_HOST=email
SMTP_AUTH=(false)
SMTP_USERNAME=dev@bio.com
SMTP_PASSWORD=
SMTP_ENCRYPTION=
SMTP_PORT=1025
SHLINK_ENABLED=false
SHLINK_API_KEY=
SHLINK_BASE_URI=# Build and start containers
docker compose up -d
# Check containers are running
docker compose psThe application will be available at:
Run migrations:
docker compose exec bio-php php bin/hyperf.php migrate --seedThis creates sample data:
- User: John Doe (
john@example.com) - Developer profile - Password:
123456 - Links: Personal blog, portfolio, resume
- Social Media: Instagram, Twitter, LinkedIn, GitHub
If you want to use the frontend, you can use bio-web repository or create your own.
Follow the instructions in https://github.com/wellsm/bio-web
# Install dependencies
docker compose exec bio-php composer install
# Run migrations
docker compose exec bio-php php bin/hyperf.php migrate
# Code style check
docker compose exec bio-php vendor/bin/php-cs-fixer fix
# Static analysis
docker compose exec bio-php vendor/bin/phpstan analyzebio-api/
βββ app/
β βββ Application/ # Application layer
β β βββ Command/ # Console commands
β β βββ Http/ # Controllers, Middleware, Requests
β β βββ Service/ # Business logic services
β βββ Core/ # Core domain logic
β β βββ Entities/ # Domain entities
β β βββ Repositories/ # Repository interfaces
β β βββ ValueObjects/ # Value objects
β βββ Infrastructure/ # Infrastructure layer
β β βββ Repositories/ # Repository implementations
β βββ Model/ # Eloquent models
βββ config/ # Configuration files
βββ migrations/ # Database migrations
βββ seeders/ # Database seeders
βββ public/ # Public assets and documentation
βββ storage/ # Logs, cache, uploads
βββ docker/ # Docker configuration
Once the application is running, visit:
- Swagger UI: http://localhost:7010/api/documentation
- API Spec:
public/documentation/api.yml
- Host: localhost (external), bio-mysql (internal)
- Port: 7011 (external), 3306 (internal)
- Database: bio
- Username: root
- Password: root
The seeder creates:
- 1 complete user profile (John Doe)
- 3 sample links
- 4 social media connections
- Custom configuration settings
- Image: Custom PHP 8.1+ with Swoole
- Port: 7010:9501
- Purpose: Main application server
- Image: Custom MySQL 8.0
- Port: 7011:3306
- Purpose: Database server
- Data: Persisted in
bio-mysql-datavolume
- PHP 8.1+
- Swoole extension >= 5.0
- MySQL 8.0+
- Composer
# Install dependencies
composer install
# Start development server
php bin/hyperf.php start
# Or watch for changes
composer watch1. Port already in use
# Check what's using the port
lsof -i :7010
# Change port in compose.yml or .env2. Database connection failed
# Check MySQL is running
docker compose ps bio-mysql
# Check logs
docker compose logs bio-mysql3. Permission issues
# Fix storage permissions
chmod -R 755 storage/4. Swoole not installed
# Install Swoole (local development)
pecl install swooleCheck application logs:
# View PHP logs
docker compose logs bio-php
# View MySQL logs
docker compose logs bio-mysql
# Follow logs in real-time
docker compose logs -f| Variable | Default | Description |
|---|---|---|
APP_ENV |
local |
Application environment |
APP_DEBUG |
true |
Debug mode |
PORT |
9501 |
Server port |
DB_HOST |
bio-mysql |
Database host |
DB_DATABASE |
bio |
Database name |
DB_USERNAME |
root |
Database user |
DB_PASSWORD |
root |
Database password |
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Check the
public/documentationdirectory - Issues: Create a GitHub issue
- API Docs: Visit
/api/documentationendpoint when running
Happy coding! π