lux1177/api-starter-kit
最新稳定版本:1.0.0
Composer 安装命令:
composer create-project lux1177/api-starter-kit
包简介
README 文档
README
Starter kit for API with Symfony, Doctrine, Maker Bundle, Migrations Bundle, VichUploader-bundle, Api-Platform and JWT-auth.
Kit has also already created User and MediaObject entities with all crud routes
Kit has 3 docker containers: php, nginx and mysql
Installation
Download the project
composer create-project lux1177/api-starter-kit --ignore-platform-reqs --no-scripts project-name
Go to the project directory
cd project-name
Run docker containers
docker compose up -d
Install composer scripts:
docker compose exec php composer install
To install project run command:
docker compose exec php bin/console ask:install
Done! You can open http://localhost:8505/api via browser.
By the way, you can change this port by changing DOCKER_NGINX_PORT variable in .env file.
Docker
For enter to php container run
docker compose exec php bash
For enter to mysql container run
docker compose exec mysql bash
For enter to nginx container run
docker compose exec nginx bash
You can change containers prefix by changing DOCKER_PROJECT_NAME variable in .env file.
Also, you can change public ports of nginx and mysql by changing DOCKER_NGINX_PORT and DOCKER_DATABASE_PORT
Database allows connections only from localhost. Because of this when you use the project on production and want to connect to database from your computer you should connect via ssh bridge.
Cron
You can use docker/php/cron-file for cron jobs.
After you must re-build php container by running command:
docker compose up -d --build
Swagger
You can change project name and description on swagger by editing file config/packages/api_platform.yaml
Git Hook
If you don't use any deploying system you can do
cp docker/other-files/git/hooks/post-merge .git/hooks
In this way git always executes command bin/console ask:deploy.
You can change this command in the file src/Command/AskDeployCommand.php.
This command will install requirements via composer,
clear caches, change owner of ./var and ./public/media folders to www-data, will run migrations.
JWT keys
For use Json Web Token system you must create private and public keys.
They are have already created when you install project. You can re-create them with:
bin/console ask:generate:jwtKeys
lux1177/api-starter-kit 适用场景与选型建议
lux1177/api-starter-kit 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 08 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 lux1177/api-starter-kit 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lux1177/api-starter-kit 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2024-08-22
