Coder Social home page Coder Social logo

celiaxiao / cyberbrick Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jacobbishopxy/cyberbrick

0.0 0.0 0.0 8.45 MB

BI demo

License: Apache License 2.0

JavaScript 15.07% TypeScript 73.80% Less 0.92% Dockerfile 0.33% Shell 1.54% Python 4.33% EJS 0.61% Makefile 0.47% CSS 0.41% Go 2.53%

cyberbrick's Introduction

CYBER BRICK

Menu

  1. Port occupation

  2. Prerequisites

  3. Environment

  4. Configuration

  5. Start Project

  6. Project Structure

  7. Details

Port occupation

Server Port
Web (Typescript) 8000
Api gateway (Golang) 8010
Py API (Python) 8020
Biz-v1 (NodeJs) 8030
Biz API (Golang) 8040
FS server (Golang) -
DGraph server (Golang) -
Auth server (Rust) 8050
Data server (Rust) 8051

Prerequisites

Server Py [Prerequisites]

  1. Flask Web framework

  2. SqlAlchemy Database ORM

  3. Pandas Data Analysis Library

Server Go [Prerequisites]

  1. [Mux]

  2. [Mongo]

Web [Prerequisites]

  1. Typescript Typed JavaScript

  2. NestJS NodeJS framework

  3. Typeorm Database ORM

  4. React JavaScript library

  5. Ant design pro UI solution

Environment

Database [Environment]

Use PostgreSql as default project database (storing config etc.)

  • PostgreSql = 10.0, docker commands:

    1. cd docker/docker-database

    2. bash start.sh

    3. bash create_database.sh

Use MongoDB for default non-schema data persistence

  • MongoDB, docker commands:

    1. cd docker-mongodb

    2. bash start.sh

    3. bash create_unique_index.sh

Server [Environment]

versions:

  • Python >= 3.8

commands:

  1. cd server
  2. pip install -r requirements.txt

Web [Environment]

versions:

  • Node >= 12.13
  • npm >= 6.12
  • yarn >= 1.22

commands:

  1. cd web
  2. npm i or yarn

Configuration

In resources folder, new config.json (see config.template.json). In resources folder, new go.env (see go.template.env. In resources folder, if mongodb is running in another machine, new mongo.connection.env (see mongo.connection.template.env.

ubiquitous-alchemy submodule

If you haven't initialized the submodule before, run make submodule-init. Otherwise, update submodule by running make submodule-update. Then, config the lura.json and ua.auth.env based on ua.auth.template.env (you can simply copy template and rename it). In ua.auth.env, Make sure DATABASE_URL is your database connection string. If the database is also running in docker and share the same network with auth-server container, rename the hostname to database's container name. Make sure INVITATION_PAGE is the link of cyberbrick frontend link (hostname is localhost in dev mode and the ip-address of server in production mode). In lura.json, rename the endpoints-backends host to the real ip-address.

Server [Configuration]

todo

Web [Configuration]

todo

Start Project

Server Py [Start Project]

Please cd server-py first then run the following commands.

  1. development:

    • python wsgi.py debug mode

    • python wsgi.py debug=false no-debug mode

  2. production:

    • python wsgi.py --env=prod
  3. production (docker):

    • setup python image, only for the first time:

      cd docker/docker-python
      bash setup.sh
    • setup dependencies installed image, rerun if dependencies updated:

      cd docker/docker-base-server
      bash setup.sh
    • setup built app image and start a container:

      cd docker/docker-app-server
      bash setup.sh
      bash start.sh

Server Go [Start Project]

Please cd server-go first then run the following commands.

  1. development:

    • go mod tidy download deps

    • go run . start server

  2. production (docker):

    • make sure you have a running mongoDB and have executed the bash file create_unique_index.sh inside docker-mongodb; a base image built from docker-go, a resources/go.env file with config similar to go.template.env; and a resources/mongo.connection.env file with similar config as mongo.connection.template.env.
    • You can simply run make docker-biz-server-setup and then make docker-biz-server-start or:
      • cd docker/docker-biz-server
      • ./setup.sh
      • ./start.sh

Web [Start Project]

Please cd web first then do the following commands.

  1. development:

    • yarn serve:dev for server side then in another terminal yarn dev for frontend
  2. production:

    • yarn build then yarn serve
  3. production (docker):

    • setup node image, only for the first time:

      cd docker/docker-node
      bash setup.sh
    • setup dependencies installed image, rerun if dependencies updated:

      cd docker/docker-base-web
      bash setup.sh
    • setup built app image and start a container:

      cd docker/docker-app-web
      bash setup.sh
      bash start.sh
    • yarn build:backend & yarn build:frontend building up web's server & client respectively

Project Structure

TODO: updating...

Detail

Server [Detail]

README

Web [Detail]

README

cyberbrick's People

Contributors

jacobbishopxy avatar celiaxiao 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.