This repo contains a proof of concept two table CRUD implementation of a simple ecommerce store with shopping cart.
Users can register and login.
Users create inventory items which are available for faceted search.
Users add items to their cart.
Users then checkout, which creates purchase orders for their items.
Users can view their purchase orders later.
- database definitions are implemented in pydal
- pydal definitions are converted to swagger / openAPI 3.0 definitions to describe a restful API
- developers can extend the autogenerated routes via statically defined routes
- open API defintions generate a typescript-axios API client SDK.
- axios was chosen over fetch due to first class support for non-standard HTTP headers
- open API definitions generate forms for database interaction as jsonschema7 via react-json-schema-form
- elasticsearch indexes inventory items via simple requests API.
HIGHLIGHTS:
- pyDAL Database Abstraction Layer
- web2py Autogenerated RESTful API
- Database Autogenerated Swagger Documentation
- Typescript Swagger Generated axios API Client
- JWT token based auth
- JSONSchema Forms
- Elasticsearch powered indexing
- SearchKit faceted search
- Progressive Web, Android, iOS Apps
- Electron Desktop App
vagrant up will install all dev dependencies in a virtual machine.
alternatively, look in the Vagrantfile for installing individual components.
# use an apt proxy and local host shared cache to speed up iterative builds
USE_APT_PROXY = true
USE_APT_CACHE = true
APT_CACHE_HOST_DIR = ""
# if you have multiple vagrant environments
DEV_BOX_NAME = "development"
DEV_BOX_CLUSTER = "SPADevCluster"
extractSchemasAndPathsFromEditorOutput parses editor-output.json into separate paths.json and schemas.json files for autogenerator to load
generateAPISpec generates a new swagger.json on disk. equivalent to curl -o http://127.0.0.1:9999/api/autogenerated/swagger.json >>
RELATIVE_PATH_TO_API_FILE
generateAPISpecClient generates a new Typescript rest client api from swagger.json on disk
startAPISpecEditor starts swagger editor ui on 192.168.205.21:8080
startDevAPIServer start web2py web server on port 9999 without gui (no admin)
startDevWebClientServer start ionic web server on port 8100 without opeoning browser
startES start ephemeral elasticsearch on port 9200. modify settings in compose to add a volume and persist data
testDockerCompose turns on and off a busybox image using docker-compose
typescriptDebug check typescript compile diagnostics
This repo contains code licensed under more than one license.
web2py has its own license (LGPL) at:
server/web2py/LICENSE.
api application located at:
server/web2py/applications/api/*
has is licensed according to this repo
TODO: build process and remove web2py from repo for clarity