Giter Site home page Giter Site logo

shopyo / shopyo Goto Github PK

View Code? Open in Web Editor NEW
73.0 4.0 27.0 16.17 MB

The package for big, scalable and modular Flask apps. More than just Flask boilerplate

Home Page: https://shopyo.readthedocs.org

License: Other

Python 84.42% HTML 13.67% CSS 1.49% JavaScript 0.42%
flask javascript fullstack python python3 django shopyo modules first-timers-friendly module

shopyo's Introduction


shopyo

Downloads Codecov Tests PyPI version shields.io Documentation Status CII Best Practices OpenSSF Scorecard

Featured on Weekly Python issue 436 ๐ŸŒŸ

A 45 mins talk was dedicated to it at EuroPython ๐ŸŒŸ

Must watch: Shopyo: Your Mega Flask Machine (short vid)

E-commerce modules transferred to ShopCube

[ DOCS | DISCORD | CONTRIBUTE | TWITTER]

What?

Your next-level modular web framework. Get organisation & scalability from day 1.

Built on top of Flask, it offers most Django features, sometimes a tidbit more with far more flexibility.

Why?

Perk
๐Ÿฅ No learning Does not get into the way, uses common flask-packages. You only need to know Flask.
๐Ÿ—๏ธ Architecture Never think about architecture of your app, just build & integrate extensions.
๐Ÿข Scalable As your app grows, Shopyo caters for your codebase with powerful features.
๐Ÿฅข Good practices Testing, docs etc are covered. Don't make those afterthoughts.
๐Ÿ”ง Ease your life We've been there. Awesome utils to ease development.
๐Ÿชœ Scaffolding Don't waste time writing boilerplate code. We've got you covered.
๐Ÿ–๏ธ Theming system You need theme in your apps? We integrate a default theme system.

Features

  • โš›๏ธ i18n setup
  • ๐Ÿ” Login & Auth
  • ๐Ÿ“ง Email
  • ๐Ÿ“ฆ 2-level modularity
  • ๐Ÿช Designed for really BIG apps
  • ๐ŸŒ… Assets management

Quick start

pip install shopyo==4.9.3
mkdir blog
cd blog
shopyo new -m # add default modules
cd blog
shopyo initialise
flask run --debug
pip install shopyo==4.9.3
mkdir blog
cd blog
shopyo new
cd blog
flask run --debug

If errors do (linux, use set <VAR> for Windows):

export SHOPYO_CONFIG_PROFILE=development
export FLASK_ENV=development # < flask 2.2.x
export ENV=development
export FLASK_DEBUG=development # < flask 2.2.x
export FLASK_APP=app.py

SHOPYO_CONFIG_PROFILE is what is defined as keys of app_config in config.py

It is recommended to use a venv in root folder.

python -m venv venv

If for dev install dev_requirements.txt also.

python -m pip install -r requirements/dev.txt

go to http://127.0.0.1:5000/dashboard with credentials [email protected] / pass

  • Not framework docs but docs for the project you are building.

First time contributing?

We have a 100% first-timers friendly policy. Check out the testimonials.

Thank you! One of the best onboarding experiences I've had. Learned a lot too (Ramon from Codesee.io)

Glimpse

Who uses Shopyo?

site name description
Maurilearn.com Elearning platform
Linkolearn.com Learn By links
FlaskCon.com Conference soft

Big??

Powered by apps / modules. Add as many as you like.

Apps are not enough, organise them in boxes and get the ultimate order you need.

You need a customised Django? This is the project. You need to build an ERP? This is the project.

Linux??

Hackable to the core. Even the dashboard is but a module.

Don't need our modules? Nuke them. Look boring? modify them

Reliable?

We don't maintain middlewares. We rely on battle tested batteries like:

  • flask_sqlalchemy
  • flask_login & co

Heck remove them if you don't want. Want to use Peewee? You can.

Rich Flask API

Common flask patterns are integrated, the structure is over the moon.

Common flask tasks are provided with an API: custom notifications, bulk form errors

Back office feel & Theme

All looks are 100% customisable with themes ~ Backend, bootstrap included by default.

Again blow it up & use what you want. It's possible

Transparent: Code your own web distro

Everything is clear, not hidden. You can 100% customise whatever you want.

We did not hardcode our choices. Our APIS are incremental. You can always use barebones.

Plug & Play

The modules are put by copy paste. No blueprint codes to write.

Contribute

We follow a 100% first-timers friendly policy.

๐Ÿ‘‰ Get started here

๐Ÿ‘‰ Join the Discord, ask questions & learn about Flask tricks during our dev talks!

๐Ÿ“š Docs

๐Ÿ‘‰ Link: shopyo.readthedocs.io/

๐Ÿ“ž Contact (inlcuding in case of vulns)

Support team if you are stuck

shopyo's People

Contributors

abdur-rahmaanj avatar arjitc12 avatar arthurarty avatar balaajimuthukumar avatar blips5 avatar bnseamster avatar damiaanh avatar dependabot[bot] avatar gurupad93 avatar hola-soy-milk avatar hsergiu avatar iamayushdas avatar imaginezero0 avatar jugmac00 avatar liyipeng123 avatar lokeshvasnik avatar mahgieeee avatar memoglr avatar mghall25 avatar mohamedmehdigara avatar ouyangjunfei avatar pre-commit-ci[bot] avatar rehmanis avatar richpryce avatar satyaki07 avatar shubham-vishwakarma avatar sid-7 avatar theimperium20 avatar touqeer121 avatar yahyakiani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

shopyo's Issues

FIX: replace `rundebug/runserver` `shopyo_cli` commands hack with click commands

Replace the shopyo_cli() function from shopyo/shopyo/api/cli.py with two separate click command as explained below:

  • For rundebug:
@cli.command("rundebug", with_appcontext=False)
def rundebug():
    """runs the shopyo flask app in development mode"""
    app_path = os.path.join(os.getcwd(), "app.py")

    if not os.path.exists(app_path):
        click.secho(f"Unable to find `app.py` in {os.getcwd()}", fg="red")
        sys.exit(1)

    os.environ["FLASK_APP"] = "app:create_app('development')"
    os.environ["FLASK_ENV"] = "development"
    run(["flask", "run"])

To test, run shopyo rundebug and shopyo runserver in shopyo/shopyo directory and go to http://127.0.0.1:5000/

Before starting this issue, make sure you have setup the repo as explained in the docs here

WARNING: default modules access must be fixed

This affects the DEFAULT application stack.

When someone registers for an account and is UNCONFIRMED they can reach and manipulate the data. The following URLs are affected.

/appadmin
/appointment
/people
/theme
/resource

REFACTOR: remove all unused files.

  • docker-compose.yml (not using but will configure later so remove it)
  • .travis.yml (unlikely to use it again since it's not free)
  • .nojekyll (since we are using readthedoc remove this. Can add again if we use github.io)
  • Dockerfile (not setup correctly so might as well remove. Will later add this)
  • shopyo/setup.cfg (should be only in root)
  • shopyo/pyproject.toml (should be only in root)
  • shopyo/file.py (added there by mistake)
  • chromedriver (will add once we setup up frontend tests)
  • shopyo/shopyo/tests/frontend_tst.py (not tested probably using very old code. Will add this file once frontend tests are added)

@Abdur-rahmaanJ in case you want to keep any, or if I missed any feel free to add/update

Add filtering options to the audit command

shopyo audit generates something like this:

Running audit ...
Checking apps ...
/home/appinv/code/shopyo/shopyo/modules/www
    warning: global.py not found

/home/appinv/code/shopyo/shopyo/modules/resource
    warning: global.py not found

/home/appinv/code/shopyo/shopyo/modules/box__default
    /home/appinv/code/shopyo/shopyo/modules/box__default/settings
        warning: forms.py not found
        warning: global.py not found
    /home/appinv/code/shopyo/shopyo/modules/box__default/dashboard
        warning: forms.py not found
        warning: models.py not found
        warning: global.py not found
    /home/appinv/code/shopyo/shopyo/modules/box__default/auth
        warning: global.py not found
    /home/appinv/code/shopyo/shopyo/modules/box__default/appadmin
        warning: forms.py not found
        warning: global.py not found
    /home/appinv/code/shopyo/shopyo/modules/box__default/base
        warning: forms.py not found
        warning: models.py not found
        warning: global.py not found
    /home/appinv/code/shopyo/shopyo/modules/box__default/theme

/home/appinv/code/shopyo/shopyo/modules/box__bizhelp
    /home/appinv/code/shopyo/shopyo/modules/box__bizhelp/people
        warning: forms.py not found
        warning: global.py not found
    /home/appinv/code/shopyo/shopyo/modules/box__bizhelp/appointment
        warning: forms.py not found
        warning: global.py not found
    /home/appinv/code/shopyo/shopyo/modules/box__bizhelp/contact
    /home/appinv/code/shopyo/shopyo/modules/box__bizhelp/page
        warning: global.py not found

Audit finished!

The command is defined here with the audit here.

It is cumbersome to view all warnings. We can add flags to filter warnings by severe like --show severe,warning

Task: Add flags to filter warnings. Feel free to modify the code!

FEAT: Shopyo packages

Design a plugins system for Shopyo which will

  • load apps when packaged as a module
  • load boxes when packaged as a module

This means loading blueprints, templates and collecting static assets.

In sum, it means that installed shopyo packages must work as well as they work in modules/

We'll have a Google meet to better explain the issue.

I have a base to get started with, needs more discussion.

Requirements

  • Know Flask API for extension development (will help)
  • Know Python packaging (knowledge of entry point for developing plugin system is a bonus)

or is a Flask user for some 4 - 5 years

Appreciation

$100 in btc

Currently my time is a bit limited and i appreciate anybody helping out. Since this is a core milestone of the project, i want someone nice to implement it. I tried putting this on bounty source but i cannot set up Metamask. So i'll be transferring it once the issue is closed. I am willing to answer any question.

How to apply?

  • Drop a comment: Interested then join the discord server. We'll then have a Google meet. If you are still interested, then we'll continue.

BUG: Allow single dot in new command

Should be able to do:

shopyo new .

so that steps are

  • create projectfolder
  • create and activate venv
  • install shopyo
  • shopyo new . does not create additional folders

BUG: fix all the badges pointing to old repo.

replace with these two (docs and pypi are up to date)
codecov : [![codecov](https://codecov.io/gh/shopyo/shopyo/branch/dev/graph/badge.svg?token=HKA0BQ76XD)](https://codecov.io/gh/shopyo/shopyo)

Tests: ![Tests](https://github.com/shopyo/shopyo/actions/workflows/tests.yaml/badge.svg)

BUG: `python manage.py initilaise` not working

Only python manage.py rundebug or python manage.py runserver works nothing else.

Source of problem:

# manage.py
def shopyo_cli():
    arguments = sys.argv[1:]
    if len(arguments) > 0:
        print(arguments)
        if arguments[0] in ['rundebug', 'runserver']:
            if arguments[0] == 'rundebug':
                printinfo()
                from app import app
                app.run(debug=True)
            elif arguments[0] == 'runserver':
                printinfo()
                from app import app
                app.run(debug=False)
    else:
        cli()

Potential fix: Indent the last else to one more place so it becomes:

    if len(arguments) > 0:
        print(arguments)
        if arguments[0] in ['rundebug', 'runserver']:
            if arguments[0] == 'rundebug':
                printinfo()
                from app import app
                app.run(debug=True)
            elif arguments[0] == 'runserver':
                printinfo()
                from app import app
                app.run(debug=False)
        else:
            cli()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.