Giter Site home page Giter Site logo

panbase's Introduction

Panbase

A free-for-all open-source Backend-Base-As-A-Service project I took up to actually learn how BBaaSses work. Made with ๐Ÿ’™ by EyePan

Download and run:

Panbase is soon to be available in a release format. Until then, you can build it yourself using the instructions below.

Build Locally:

  • Clone this repository
git clone https://github.com/eyepan/panbase.git
  • Create a virtual environment and download all pip packages
python3 -m venv venv
pip install -r requirements.txt
  • Create a config.py file with the following contents:
import sys


LOG_LEVEL = "DEBUG" if '--debug' in sys.argv else "CRITICAL"
API_PORT = 8000
ADMIN_PORT = 9000
RELOAD = True if '--reload' in sys.argv else False
JWT_SECRET = "supersecretjwtsecret"
  • Go to the UI folder and download all the npm packages
cd ui
npm install
  • Build the admin UI using vite
npm run build
  • Go back and run the build command with nuitka:
cd ..
del database.db
python main.py --debug --init
python -m nuitka main.py --output-dir=dist --onefile --standalone -o panbase.exe --quiet --remove-output --show-progress --include-data-file=database.db=database.db --include-data-dir=admin-ui/dist=admin-ui/dist --onefile-tempdir-spec="%TEMP%\panbase\0.1.0"

The --onefile-tempdir flag is enabled in Nuitka to not create a new temp directory everytime the built executable runs. This will throw an warning saying

-Not using any variables for '--onefile-tempdir-spec' should only be done if your program absolutely needs to be in the same path always

This is ABSOLUTELY FINE and is totally expected. Don't panic.

Run Without Building:

  • Create a virtual environment and download all pip packages
python3 -m venv venv
pip install -r requirements.txt
  • Create a config.py file with the following contents:
import sys

LOG_LEVEL = "DEBUG" if '--debug' in sys.argv else "CRITICAL"
API_PORT = 8000
ADMIN_PORT = 9000
RELOAD = True if '--reload' in sys.argv else False
JWT_SECRET = "super_secret_jwt_secret"
  • Go to the UI folder to download and install all npm packages
cd UI
npm i
npm run dev
  • Come back to the root folder and run
cd ..
python main.py --debug

Alternatively, you can also use uvicorn to run it directly, although you might have to set up the ports yourself.

uvicorn main:app --reload

NOTE: --debug can also be swapped out for --verbose:

Flag Meaning
--debug/ -d Shows debugging information. Sets log_level to DEBUG. Also shows the SQL Queries that are actually run
--init Just initializes the database.db file. Used during building with Nuitka

panbase's People

Contributors

eyepan avatar

Stargazers

Yogan G avatar  avatar

Watchers

 avatar

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.