Skip to content

Commit

Permalink
task done
Browse files Browse the repository at this point in the history
  • Loading branch information
ErasoftSenior committed Jan 13, 2025
0 parents commit af137b2
Show file tree
Hide file tree
Showing 80 changed files with 12,262 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2

[docker-compose.yml]
indent_size = 4
68 changes: 68 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_TIMEZONE=UTC
APP_URL=http://localhost

API_KEY=88005553535

APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US

APP_MAINTENANCE_DRIVER=file
# APP_MAINTENANCE_STORE=database

PHP_CLI_SERVER_WORKERS=4

BCRYPT_ROUNDS=12

LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=example_app
DB_USERNAME=root
DB_PASSWORD=

SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null

BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database

CACHE_STORE=database
CACHE_PREFIX=

MEMCACHED_HOST=127.0.0.1

REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=log
MAIL_SCHEME=null
MAIL_HOST=127.0.0.1
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

VITE_APP_NAME="${APP_NAME}"
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
* text=auto eol=lf

*.blade.php diff=html
*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php

/.github export-ignore
CHANGELOG.md export-ignore
.styleci.yml export-ignore
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/.phpunit.cache
/node_modules
/public/build
/public/hot
/public/storage
/storage/*.key
/storage/pail
/vendor
.env
.env.backup
.env.production
.phpactor.json
.phpunit.result.cache
Homestead.json
Homestead.yaml
auth.json
npm-debug.log
yarn-error.log
/.fleet
/.idea
/.nova
/.vscode
/.zed
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
Organizations Directory API
REST API приложение для справочника Организаций, Зданий и Деятельности.

Требования:

Docker(сделал через Laravel Sail)

Установка:

Клонируйте репозиторий

Скопируйте .env.example в .env

Запустите Docker контейнеры(alias sail='sh $([ -f sail ] && echo sail || echo vendor/bin/sail)'
, после sail up)


Установите зависимости:

sail composer install

Запустите миграции и сиды:

sail artisan migrate --seed


API Endpoints:

Организации

GET /api/organizations/by-building/{building} - список организаций в здании
GET /api/organizations/by-activity/{activity} - список организаций по виду деятельности
GET /api/organizations/by-location - список организаций в заданном радиусе/области
GET /api/organizations/{organization} - информация об организации
GET /api/organizations/search - поиск организаций

Параметры поиска по локации
jsonCopy{
"latitude": float,
"longitude": float,
"radius": float (в километрах)
}

или

jsonCopy{
"bounds": {
"sw_lat": float,
"sw_lng": float,
"ne_lat": float,
"ne_lng": float
}
}
Swagger Documentation:

Swagger UI доступен по адресу: http://localhost/api/documentation

API-KEY:

header: X-API-Key

key: 88005553535

PS. для удобства тестинга прописал его так же в экзампл файле)
28 changes: 28 additions & 0 deletions app/Docs/OpenApi.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace App\Docs;

use OpenApi\Annotations as OA;

/**
* @OA\Info(
* version="1.0.0",
* title="API Documentation",
* description="This is the API documentation for the project.",
* @OA\Contact(
* email="[email protected]"
* ),
* @OA\License(
* name="MIT",
* url="https://opensource.org/licenses/MIT"
* )
* )
*
* @OA\Server(
* url="http://localhost",
* description="Local development server"
* )
*/
class OpenApi
{
}
Loading

0 comments on commit af137b2

Please sign in to comment.