Skip to content

Commit 344ba14

Browse files
committed
initial commit
1 parent d59cfbc commit 344ba14

25 files changed

+4839
-2
lines changed

.github/FUNDING.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# These are supported funding model platforms
2+
github: chriskapp
3+
patreon: fusio
4+
custom: https://www.paypal.me/fusioapi

.github/workflows/docker.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Docker
2+
on:
3+
push:
4+
branches:
5+
- 'master'
6+
tags:
7+
- 'v*'
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
jobs:
12+
push_to_registry:
13+
name: Push Docker image to Docker Hub
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
steps:
19+
- name: Check out the repo
20+
uses: actions/checkout@v2
21+
- name: Log in to the Container registry
22+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
23+
with:
24+
registry: ${{ env.REGISTRY }}
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
- name: Extract metadata (tags, labels) for Docker
28+
id: meta
29+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
30+
with:
31+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
32+
- name: Build and push Docker image
33+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
34+
with:
35+
context: .
36+
push: true
37+
tags: ${{ steps.meta.outputs.tags }}
38+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
FROM php:8.0-apache
2+
MAINTAINER Christoph Kappestein <christoph.kappestein@apioo.de>
3+
LABEL description="TypeAPI website"
4+
5+
ENV COMPOSER_VERSION "2.1.9"
6+
ENV COMPOSER_SHA256 "4d00b70e146c17d663ad2f9a21ebb4c9d52b021b1ac15f648b4d371c04d648ba"
7+
8+
ENV APACHE_DOCUMENT_ROOT "/var/www/html/public"
9+
10+
# install default packages
11+
RUN apt-get update && apt-get -y install \
12+
wget \
13+
git \
14+
cron \
15+
libcurl3-dev \
16+
libzip-dev \
17+
libonig-dev
18+
19+
# install php extensions
20+
RUN docker-php-ext-install \
21+
bcmath \
22+
curl \
23+
zip \
24+
mbstring
25+
26+
# install composer
27+
RUN wget -O /usr/bin/composer https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar
28+
RUN echo "${COMPOSER_SHA256} */usr/bin/composer" | sha256sum -c -
29+
RUN chmod +x /usr/bin/composer
30+
31+
# adjust apache config
32+
RUN sed -ri -e "s!/var/www/html!${APACHE_DOCUMENT_ROOT}!g" /etc/apache2/sites-available/*.conf
33+
RUN sed -ri -e "s!/var/www/!${APACHE_DOCUMENT_ROOT}!g" /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
34+
RUN a2enmod rewrite
35+
36+
# install app
37+
COPY schema /var/www/schema
38+
COPY www /var/www/html
39+
RUN cd /var/www/html && /usr/bin/composer install
40+
RUN chown -R www-data: /var/www/schema
41+
RUN chown -R www-data: /var/www/html

LICENSE

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Copyright 2017-2023 Christoph Kappestein
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
this software and associated documentation files (the "Software"), to deal in
5+
the Software without restriction, including without limitation the rights to
6+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7+
the Software, and to permit persons to whom the Software is furnished to do so,
8+
subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
# typeapi
2-
TypeAPI is a specification to generate type safe client and server code.
1+
# TypeAPI
2+
3+
## About
4+
5+
TypeAPI is a specification to generate type safe client and server code.

docker-compose.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: '3'
2+
services:
3+
typeschema:
4+
image: ghcr.io/apioo/typeapi:master
5+
restart: always
6+
ports:
7+
- "9090:80"

schema/merge.php

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
$baseDir = __DIR__ . '/output';
4+
$files = scandir($baseDir);
5+
$types = [];
6+
7+
foreach ($files as $file) {
8+
if (pathinfo($file, PATHINFO_EXTENSION) !== 'html') {
9+
continue;
10+
}
11+
12+
$types[] = file_get_contents($baseDir . '/' . $file);
13+
}
14+
15+
file_put_contents(__DIR__ . '/schema.htm', implode("\n\n", $types));

0 commit comments

Comments
 (0)