Skip to content
View app-generator's full-sized avatar
🎯
Focusing
🎯
Focusing

Highlights

  • Pro

Block or report app-generator

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
app-generator/README.md

Open-Source Tools for solo-devs, students and companies - Generate Digital Products, Update legacy code by chat, Inject new modules, Software Auto-healing, AI, Deployment automation (any provider), Docker, K8s.


Features


Stack

  • Python/Django
  • React
  • Docker
  • CI/CD - LIVE Deploy on Digital Ocean

Manual Build

Step #1 - Download the code

$ git clone https://github.com/app-generator/app-generator.git
$ cd app-generator

Step #2 - Install modules

$ virtualenv env
$ source env/bin/activate
$ pip install -r requirements.txt

Step #3 - Set Up Database

$ python manage.py makemigrations
$ python manage.py migrate

Step #4 - Create the ENV file

The .env can be created from the env.sample file, provided in the root of the project

$ cp env.sample .env

Step #5 - Compile UI (that uses Tailwind)

$ pnpm i
$ pnpm run build

Step #5 - Execute collectstatic for Django statics

$ python manage.py collectstatic
$ python manage.py migrate

Start the APP

$ python manage.py createsuperuser # create the admin
$ python manage.py runserver       # start the project

At this point, the app runs at http://127.0.0.1:8000/.


The Documentation being generated by , the compilation requires a linux box

$ cd docs && rm -rf build && make html
# Or via a while loop
$ cd docs ; while true ; do rm -rf build/ ; make html ; sleep 10 ; done

The output is saved on docs/build and rendered on /docs/ URI


CLI Interface

All CLI tools are listed by dev_tools subcommand:

$ python manage.py dev_tools

Below sections explains each dev_tool added to the codebase - If somethings is not working in your environment, please contact support.

Generate Code

For now, only Django code is supported.

$ python manage.py tool_generator -i # Print HELP 
$ python manage.py tool_generator -f sources/input-template-volt.json

The generated code is saved in generated_code DIR. Open the sources using your favorite editor and start the project. The easier way is to use Docker:


Generate Project Template

Using this tool, we can generate a JSON template used later by the generator

$ python manage.py tool_generator_interactive -i # Print HELP 
$ python manage.py tool_generator_interactive    # Generate JSON File  
...
# (Truncated Output)
$ python manage.py tool_generator_interactive

[?] Project Friendly Name: Some Django project
[?] The Backend Framework:                                                                                                               
 > django
   flask (soon)
   nodejs (soon)

[?] The UI Kit:                                                                                                                          
 > datta
   volt
   soft-dashboard

[?] The Database:                                                                                                                        
 > sqlite
   mysql
   pgsql
...
# (Truncated Output)
...
> File saved = sources\Nt5QWHGI_django_template.json
> HOW to generate code:
    |-- python manage.py tool_generator -f sources/Nt5QWHGI_django_template.json   

By running the sugegsted command, we should be able to generate a valid Django Project.


Upload to GitHub

Note: For having SUCCESS on this operation, a GITHUB_KEY is required in .env - read more.

$ python manage.py tool_github_uploader -i # Print HELP 
$ python manage.py tool_github_uploader -d generated_code/GENERATED_PROJECT -k GITHUB_KEY 

Once the operation is finished, the generated project should be saved under the account associated with the GITHUB_KEY.


Inspect DB (sqlite, MySql, PgSql)

# SQLite scan 
$ python manage.py tool_db_processor -f media/tools/db_inspect/db_sqlite.json
# OR
# MySql scan
$ python manage.py tool_db_processor -f media/tools/db_inspect/db_mysql.json
...
# (Truncated Output)
> Processing media/tools/db_inspect/db_sqlite.json
    |-- type      : db
    |-- DB driver : SQLITE
    |-- DB name   : media/tools/common/sample.sqlite3
    |-- DB host   : None
    |-- DB port   : None
    |-- DB user   : None
    |-- DB pass   : None

 > Dump data for [api_user_user]
 > Dump data for [api_authentication_activesession]
 > Dump data for [auth_group]
 > Dump data for [api_user_user_groups]
 > Dump data for [django_content_type]
 > Dump data for [auth_permission]
 > Dump data for [api_user_user_user_permissions]
 > Dump data for [auth_group_permissions]
 > Dump data for [django_admin_log]
 > Dump data for [django_migrations]
 > Dump data for [django_session]

The SQL dump is done in the tmp DIRECTORY

ROOT
  |-- tmp
      |-- 05_27_58_SQLITE.sql
      |-- 05_28_04_SQLITE_api_user_user 

Migrate DB

Note: the feature works with SQLite, MySql and PostgreSQL.

The source and target DB credentials should be provided in JSON format. Here are the provided samples

How to use it:

$ python manage.py tool_db_migrator -s DB_SOURCE.json -t DB_TARGET.json           # Perform Checks
$ python manage.py tool_db_migrator -s DB_SOURCE.json -t DB_TARGET.json --migrate # Migrate the data 

CSV processor

Authenticated users can process CSV files and apply transformers.

DEMO: https://app-generator.dev/tools/csv-processor/


Inspect CSV Files

$ python manage.py tool_inspect_source -f media/tools/csv/csv_inspect.json    # Truncated output
$ python manage.py tool_inspect_source -f media/tools/csv/csv_inspect.json -k # Print all rows 
# OR for distant CSV files
$ python manage.py tool_inspect_source -f media/tools/csv/csv_inspect_distant.json
...
# (Truncated Output)
 > Processing media/tools/csv/csv_inspect.json
       |-- file: media/tools/csv/titanic.csv
       |-- type: csv
{'PassengerId': {'type': 'int64'}, 'Survived': {'type': 'int64'}, 'Pclass': {'type': 'int64'}, 'Name': {'type': 'object'}, 'Sex': {'type': 'object'}, 'Age': {'type': 'float64'}, 'SibSp': {'type': 'int64'}, 'Parch': {'type': 'int64'}, 'Ticket': {'type': 'object'}, 'Fare': {'type': 'float64'}, 'Cabin': {'type': 'object'}, 'Embarked': {'type': 'object'}}
[1] - PassengerId,Survived,Pclass,Name,Sex,Age,SibSp,Parch,Ticket,Fare,Cabin,Embarked
[2] - 1,0,3,"Braund, Mr. Owen Harris",male,22,1,0,A/5 21171,7.25,,S
[3] - 2,1,1,"Cumings, Mrs. John Bradley (Florence Briggs Thayer)",female,38,1,0,PC 17599,71.2833,C85,C
[4] - 3,1,3,"Heikkinen, Miss. Laina",female,26,0,0,STON/O2. 3101282,7.925,,S
[5] - 4,1,1,"Futrelle, Mrs. Jacques Heath (Lily May Peel)",female,35,1,0,113803,53.1,C123,S
[6] - 5,0,3,"Allen, Mr. William Henry",male,35,0,0,373450,8.05,,S
[7] - 6,0,3,"Moran, Mr. James",male,,0,0,330877,8.4583,,Q
[8] - 7,0,1,"McCarthy, Mr. Timothy J",male,54,0,0,17463,51.8625,E46,S
[9] - 8,0,3,"Palsson, Master. Gosta Leonard",male,2,3,1,349909,21.075,,S
[10] - 9,1,3,"Johnson, Mrs. Oscar W (Elisabeth Vilhelmina Berg)",female,27,0,2,347742,11.1333,,S
...

List available commands

$ python manage.py help 
# (Truncated Output)
Type 'manage.py help <subcommand>' for help on a specific subcommand.
Available subcommands:
...
[cli]
    help_print_apps
    help_print_cfg
    help_print_models
...

List Registered Apps

$ python manage.py help_print_apps
# (Truncated Output)
 APP -> Webpack Loader
 APP -> Administration
 APP -> Authentication and Authorization
 ...

List Registered Models

$ python manage.py help_print_models
# (Truncated Output)
APP -> Github
APP -> Google
APP -> Django_Quill
APP -> Celery Results
        |--> django_celery_results.models.TaskResult
          |--> id: AutoField
          |--> task_id: CharField
          |--> periodic_task_name: CharField
          |--> task_name: CharField
          |--> task_args: TextField
          |--> task_kwargs: TextField
          |--> status: CharField
          |--> worker: CharField
          |--> content_type: CharField
          |--> content_encoding: CharField
          |--> result: TextField
          |--> date_created: DateTimeField
          |--> date_done: DateTimeField
          |--> traceback: TextField
          |--> meta: TextField
        |--> django_celery_results.models.ChordCounter
          |--> id: AutoField
          |--> group_id: CharField
          |--> sub_tasks: TextField
          |--> count: PositiveIntegerField
        |--> django_celery_results.models.GroupResult
          |--> id: AutoField
          |--> group_id: CharField
          |--> date_created: DateTimeField
          |--> date_done: DateTimeField
          |--> content_type: CharField
          |--> content_encoding: CharField
          |--> result: TextField

Celery (async tasks)

  • Make sure you have a Redis Server running: redis://localhost:6379
    • $ redis-cli and type ping
  • In the base directory inside tasks_scripts folder you need to write your scripts file.
  • Run the celery command from the CLI.
$ export DJANGO_SETTINGS_MODULE="core.settings"  
$ celery -A core worker -l info -B

Executed Tasks, tasks_scripts DIR as defined in the EXEC Schedule

The output for each task can be found in the LOGS Directory.

Here is a LOG sample generated by a critical task that runs at every 5min:


Team

Core

Developers/Contractors


LICENSE

@EULA



Crafted and actively supported by AppSeed - [email protected]

Pinned Loading

  1. intro intro Public

    App Generator - Deliver your projects faster | AppSeed

    53 13

  2. admin-dashboards admin-dashboards Public

    Admin Dashboards - Open-Source and Free | AppSeed

    390 46

  3. django-dashboards django-dashboards Public template

    Django Dashboards - Admin Panels coded in Django | AppSeed

    354 63

  4. docs docs Public

    App Generator - The Official Documentation | AppSeed

    JavaScript 1 1