APG
Code generation tool, which helps you to start a project without pain.
Contents
Installation
pip install apg
Dependencies
- make
- docker
- docker-compose
- cookiecutter
- Click
- npm (for ReactJS projects)
Usage
Create a new project in the current directory:
$ apg init <framework_name>
Available frameworks:
- flask (Flask used as basis, we added webargs, Swagger, pytest and other handy stuff)
- aiohttp (AIOHTTP used as basis, but we completely reorganized it to look more like flask. Also added Swagger, webargs and so on)
- react (Only basic functionality of ReactJS application)
Once you've done that, commands listed below will be available
Flask project:
$ make dev
$ make build
$ make up
$ make stop
$ make db
$ make migrate
$ make bash
$ make shell
$ make dbshell
$ make test
$ make test file=<folder_name>
$ make test file=<folder_name>/<file_name>
$ make test file=<folder_name>/<file_name>::<test_case_name>
AIOHTTP project:
$ make dev
$ make shell
$ make check
$ make dbshell
$ make migrate
$ make upgrade
$ make test
$ make test file=<folder_name>
$ make test file=<folder_name>/<file_name>
$ make test file=<folder_name>/<file_name>::<test_case_name>
After you run make dev
command
The API documentation will be available (SwaggerUI)
React project:
$ npm start:dev
$ npm build:prod
Add a new module to the current project (current directory):
$ apg module <name>