Git Product home page Git Product logo

manager's Introduction

BEdita Manager

Github Actions PHP Github Actions Javascript codecov Scrutinizer Code Quality Version License

Official Backend Admin WebApp for BEdita4 API.

Prerequisites

Install

  • Create project via composer
composer create-project bedita/manager

This will create a new manager folder and install composer dependencies. If you are using a .zip or .tar.gz release file you just need to unpack it and then run composer install. Run same command if you do a git clone on this repo.

  • Build JS/CSS bundles with yarn from manager folder
yarn
yarn build-plugins
yarn build
  • Configure BEdita 4 API base URL and API KEY in config/.env like:
# set BEDITA4 base URL
export BEDITA_API="{bedita-4-url}"
# set BEDITA4 API KEY (optional)
export BEDITA_API_KEY="{bedita4-api-key}"

To test the webapp you can simply run builtin webserver from manager folder like this

bin/cake server

And then point your browser to http://localhost:8765/

For any other use than a simple test we recommend to configure your preferred web server like Nginx/Apache and point to webroot/ as vhost document root.

Docker

Pull official image

Get latest offical image build from Docker Hub

docker pull bedita/manager

Build image

If you want to build an image from local sources you can do it like this from root folder:

docker build -t manager-local .

You may of course choose whatever name you like for the generated image instead of manager-local.

Run

Run a Docker image setting API base url and API KEY like this:

docker run -p 8080:80 \
    --env BEDITA_API={bedita-api-url} --env BEDITA_API_KEY={bedita-api-key} \
    bedita/manager:latest

Replace bedita/manager:latest with manager-local (or other chosen name) to lanch a local built image.

JS Development with webpack

Using .env

It's easy to configure config/.env to match your web server and proxy requirements, see below. (default proxy: localhost:8080, default server: localhost:3000)

# BE Manager Entry Point
WEBPACK_SERVER_HOST=localhost
WEBPACK_SERVER_PORT=3000

# Proxy server
WEBPACK_PROXY_HOST=local-be4-web
WEBPACK_PROXY_PORT=8080

To start develop mode run

yarn develop

Production build with Bundle Report

yarn run bundle-report

ESlint

  • Run ESlint via yarn, to check linting on js files
yarn run eslint src/Template/Layout/js/app/pages/admin/index.js

Run unit tests

To setup tests locally simply copy tests/.env.default to tests/.env and set env vars accordingly. To launch tests:

vendors/bin/phpunit [test folder or file, default '/tests']

To run those tests you may want to use a Docker image as BEdita4 API endpoint. For instance if you can pull a Docker image via docker pull bedita/bedita:4.6.1

Then you may run the image with

docker run -p 8090:80 --env BEDITA_ADMIN_USR=bedita --env BEDITA_ADMIN_PWD=bedita bedita/bedita:4.6.1

You can then set env vars accordingly like this:

export BEDITA_API="http://localhost:8090"
export BEDITA_ADMIN_USR="bedita"
export BEDITA_ADMIN_PWD="bedita"

and you're ready to go

Licensing

BEdita is released under LGPL, Lesser General Public License v3.

manager's People

Contributors

andresbautista avatar batopa avatar dariosacco avatar dependabot[bot] avatar didoda avatar edoardocavazza avatar fquffio avatar le0m avatar nicolocarpignoli avatar nikazzio avatar paolosantarsiero avatar qwerg avatar stefanorosanelli avatar vallo87 avatar xho 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.