SkillAgentSearch skills...

Flexhub

Server for private Symfony Flex recipes

Install / Use

/learn @sonnymilton/Flexhub
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Flexhub App build

Flexhub is a private repository of Symfony Flex recipes available for deployment on your infrastructure. Compatible with Flex serverless.

Deployment

Flexhub is distributed as a Docker image, which makes it easy to deploy.

docker pull sonnymilton/flexhub:latest

Important details:

  • The application requires PostgreSQL and Redis to run.
  • You must set environment variables:
    • DATABASE_URL - PostgreSQL database DSN.
      Example: postgresql://user:password@localhost:5432/flex_server?serverVersion=16&charset=utf8
    • REDIS_URL - Redis server DSN.
      Example: redis://localhost:6379
  • Inside the container, the application runs on port 80
<details> <summary>docker-compose.yml example</summary>
services:
    flexhub:
        image: sonnymilton/flexhub:0.1.0
        tty: true
        environment:
            REDIS_URL: redis://redis:6379
            DATABASE_URL: postgresql://postgres:postgres@postgres:5432/flex_server?serverVersion=16&charset=utf8
        ports:
            - "8080:80"
        depends_on:
            - postgres
            - redis

    redis:
        image: eqalpha/keydb:alpine_x86_64_v6.3.4

    postgres:
        image: postgres:16.2-alpine
        environment:
            POSTGRES_DB: flex_server
            POSTGRES_USER: postgres
            POSTGRES_PASSWORD: postgres
</details> <details> <summary>Kubernetes manifest example</summary>
apiVersion: v1
kind: Pod
metadata:
    name: flexhub-demo
spec:
    containers:
        - name: flexhub
          image: sonnymilton/flexhub:latest
          ports:
              - containerPort: 80
          env:
              - name: REDIS_URL
                value: "redis://localhost:6379"
              - name: DATABASE_URL
                value: "postgresql://user:password@localhost:5432/flex_server?serverVersion=16&charset=utf8"

        - name: redis
          image: redis:latest
          ports:
              - containerPort: 6379

        - name: postgres
          image: postgres:16.2
          ports:
              - containerPort: 5432
          env:
              - name: POSTGRES_USER
                value: "user"
              - name: POSTGRES_PASSWORD
                value: "password"
              - name: POSTGRES_DB
                value: "flex_server"

</details>

Configure your composer.json to use your private flex server

"extra": {
    "symfony": {
        "endpoint": [
            "https://flexhub.yourhost.lan/api/flex/index.json",
            "flex://defaults"
        ]
    }
}
  • Replace https://flexhub.yourhost.lan with the host on which your flex recipes server is deployed.
  • The extra.symfony key will most probably already exist in composer.json. In that case, add the "endpoint" key to the existing extra.symfony entry.

Development

Local deployment

docker-compose up -d.
The application runs on port 8000.

Running code quality tools locally

Use composer cq to run PHPstan + php-cs-fixer + phpunit

Made with

<div align="left"> <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/php/php-original.svg" height="40" alt="php logo" /> <img width="12" /> <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/symfony/symfony-original.svg" height="40" alt="symfony logo" /> <img width="12" /> <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/doctrine/doctrine-original.svg" height="40" alt="doctrine logo" /> <img width="12" /> <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/composer/composer-original.svg" height="40" alt="composer logo" /> <img width="12" /> <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/typescript/typescript-original.svg" height="40" alt="typescript logo" /> <img width="12" /> <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/vuejs/vuejs-original.svg" height="40" alt="vuejs logo" /> <img width="12" /> <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/bootstrap/bootstrap-original.svg" height="40" alt="bootstrap logo" /> <img width="12" /> <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/npm/npm-original-wordmark.svg" height="40" alt="npm logo" /> <img width="12" /> <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/postgresql/postgresql-original.svg" height="40" alt="postgresql logo" /> <img width="12" /> <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/redis/redis-original.svg" height="40" alt="redis logo" /> <img width="12" /> <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/nginx/nginx-original.svg" height="40" alt="nginx logo" /> <img width="12" /> <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/docker/docker-original.svg" height="40" alt="docker logo" /> </div>

✅ No outdated dependencies

View on GitHub
GitHub Stars11
CategoryDevelopment
Updated1y ago
Forks1

Languages

PHP

Security Score

75/100

Audited on May 25, 2024

No findings