Skip to content

Commit

Permalink
Add base structure of api project
Browse files Browse the repository at this point in the history
  • Loading branch information
Onyxmoon committed Aug 16, 2019
1 parent 05a811a commit 9fac8e7
Show file tree
Hide file tree
Showing 34 changed files with 5,601 additions and 43 deletions.
32 changes: 32 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# In all environments, the following files are loaded if they exist,
# the later taking precedence over the former:
#
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=57b2087a52c3b849114e92c42156b2a9
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2
#TRUSTED_HOSTS='^localhost|example\.com$'
###< symfony/framework-bundle ###

###> nelmio/cors-bundle ###
CORS_ALLOW_ORIGIN=^https?://localhost(:[0-9]+)?$
###< nelmio/cors-bundle ###

###> doctrine/doctrine-bundle ###
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Configure your db driver and server_version in config/packages/doctrine.yaml
DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name
###< doctrine/doctrine-bundle ###
59 changes: 18 additions & 41 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,48 +1,25 @@
# Cache and logs (Symfony2)
/app/cache/*
/app/logs/*
!app/cache/.gitkeep
!app/logs/.gitkeep

# Email spool folder
/app/spool/*

# Cache, session files and logs (Symfony3)
/var/cache/*
/var/logs/*
/var/sessions/*
!var/cache/.gitkeep
!var/logs/.gitkeep
!var/sessions/.gitkeep

# Parameters
/app/config/parameters.yml
/app/config/parameters.ini

# Managed by Composer
/app/bootstrap.php.cache
/var/bootstrap.php.cache
/bin/*
!bin/console
!bin/symfony_requirements
###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###

# Assets and user uploads
/web/bundles/
/web/uploads/
###> symfony/webpack-encore-pack ###
/node_modules/
/public/build/
###< symfony/webpack-encore-pack ###

# PHPUnit
/app/phpunit.xml
###> symfony/phpunit-bridge ###
.phpunit
/phpunit.xml
###< symfony/phpunit-bridge ###

# Build data
/build/

# Composer PHAR
/composer.phar
###> symfony/web-server-bundle ###
.web-server-pid
###< symfony/web-server-bundle ###

# Backup entities generated with doctrine:generate:entities command
**/Entity/*~

# Embedded web-server pid file
/.web-server-pid
.idea/*
50 changes: 48 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,48 @@
# optolith-cloud
This repository contains the development data of the server for a cloud infrastructure service for Optolith hero management (elyukai/optolith-client).
<h1 align="center">Welcome to Optolith Character Generator - Cloud 👋</h1>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-0.0.0-blue.svg?cacheSeconds=2592000" />
<a href="https://spdx.org/licenses/MPL-2.0.html">
<img alt="License: Mozilla Public License 2.0" src="https://img.shields.io/badge/License-Mozilla Public License 2.0-yellow.svg" target="_blank" />
</a>
<a href="https://twitter.com/onyxmoon_">
<img alt="Twitter: onyxmoon_" src="https://img.shields.io/twitter/follow/onyxmoon_.svg?style=social" target="_blank" />
</a>
</p>

> This repository contains the development data of the server for a cloud infrastructure service for Optolith Character Manager (https://github.com/elyukai/optolith-client).
### 🏠 [Homepage](cloud.optolith.app)

## Install

```sh
composer install
```

## Usage

```sh
php bin/console server:run
```

## Author

👤 **Onyxmoon (Philipp Borucki)**

* Twitter: [@onyxmoon_](https://twitter.com/onyxmoon_)
* Github: [@Onyxmoon](https://github.com/Onyxmoon)

## 🤝 Contributing

Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://github.com/Onyxmoon/optolith-cloud/issues).

## Show your support

Give a ⭐️ if this project helped you!

## 📝 License

Copyright © 2019 [Onyxmoon (Philipp Borucki)](https://github.com/Onyxmoon).<br />
This project is [Mozilla Public License 2.0](https://spdx.org/licenses/MPL-2.0.html) licensed.

***
42 changes: 42 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env php
<?php

use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;

if (false === in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.\PHP_SAPI.' SAPI'.\PHP_EOL;
}

set_time_limit(0);

require dirname(__DIR__).'/vendor/autoload.php';

if (!class_exists(Application::class)) {
throw new RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
}

$input = new ArgvInput();
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
}

if ($input->hasParameterOption('--no-debug', true)) {
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
}

require dirname(__DIR__).'/config/bootstrap.php';

if ($_SERVER['APP_DEBUG']) {
umask(0000);

if (class_exists(Debug::class)) {
Debug::enable();
}
}

$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$application = new Application($kernel);
$application->run($input);
63 changes: 63 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"api-platform/api-pack": "^1.2",
"symfony/console": "4.3.*",
"symfony/dotenv": "4.3.*",
"symfony/flex": "^1.3.1",
"symfony/framework-bundle": "4.3.*",
"symfony/yaml": "4.3.*",
"webonyx/graphql-php": "^0.13.6"
},
"require-dev": {
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.3.*"
}
}
}
Loading

0 comments on commit 9fac8e7

Please sign in to comment.