Giter Club home page Giter Club logo

platform-base's Introduction

Platform Base Service Introduction

English | 简体中文

Brief Introduction

AO.space Platform provides personal devices with transparent communication channel services and secure protection for Internet access. AO.space platform can also be privately deployed. Differing from other solutions, personal account authentication and authorization in AO.space are managed solely by the server running on the personal device. The AO.space platform cannot manage or parse any personal data, and personal account authentication and authorization in AO.space are managed solely by the server-side running on the personal device, ensuring complete control of user data in personal devices.

System Architecture

AO.space Platform&BaseService Arch.png

AO.space Platform

The responsibility of AO.space Platform is to establish a transparent communication channel for personal equipment. It includes the Platform Base Service, the Platform Proxy Service, and the Network Transit Server.

  • Platform Base Service: provide the registration service of AO.space, and coordinate and manage the platform network resources (domain name, communication channel, etc.).
  • Plarform Proxy Service: provide high-availability forwarding and horizontal expansion support for the requests from clients.
  • Network Transit Server: provides network support services that penetrate NAT access AO.space through relay forwarding. It is used to forward the requests from clients to AO.space.

Note: For a complete deployment guide of AO.space Platform, please refer to AOPlatform Community Deployment Guide.

Base Service

Base Service is the implementation of management-side service, which mainly provides the following functions:

  1. Authenticate the identity of AO.space
  2. Provide the registration function of device, user and client
  3. Coordinate and manage platform network resources (domain name, communication channel, etc.)
  4. Switch self-hosted AO.space Platform

NOTE: This project uses Quarkus, the Supersonic Subatomic Java Framework. If you want to learn more about Quarkus, please visit its website: QUARKUS .

Environment Variables

All application configuration properties can be set by the file: application.yml, for more details about how to config them, please refer Configuration Reference Guide. Following are important environment variables that can be changed during the container starting up.

Data Source

  • QUARKUS_DATASOURCE_DB_KIND: used to set the database type. default setting: mysql
  • QUARKUS_DATASOURCE_USERNAME : used to set the username of database.
  • QUARKUS_DATASOURCE_PASSWORD: used to set the password of database.
  • QUARKUS_DATASOURCE_JDBC_URL: used to set jdbc url of database. default setting: jdbc:mysql://127.0.0.1:3306/community

Cache

  • QUARKUS_REDIS_HOSTS: used to set the connection url of redis. default setting: redis://localhost:6379
  • QUARKUS_REDIS_PASSWORD: used to set the password of redis.

Application

  • APP_REGISTRY_SUBDOMAIN : used to set the "Root Domain" of device, and it's also part of space endpoint.(You need to add configuration for the root domain name on DNS and Nignx, please refer AOPlatform-Community Deployment Guide)

For naming conversion rules between name of config and name of environment variables, please refer The Conversion Rules. Below are all the default values of above variables that comes from application.yml :

quarkus:
  datasource:
    db-kind: mysql
    username: root
    password: 123456
    jdbc:
      url: jdbc:mysql://127.0.0.1:3306/community?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=GMT%2B8
  redis:
    hosts: redis://localhost:6379
    password: 123456
app:
  registry:
    subdomain: XXXX # root domain of device

Build and Run Application

Build Maven Multi Module Project

There are multiple modules in this project, and there are dependencies between them. In the Maven multi module project, each module can be built independently or uniformly through the parent project. If you want to build the entire project, simply execute the 'mvn clean install' command in the root directory of the parent project. Maven will automatically build based on dependency relationships. The following commands can also be executed under this project:

./mvnw clean install

Manually build and run jvm docker image

  1. ./mvnw package
  2. cd /eulixplatform-registry
  3. docker build --pull -f src/main/docker/Dockerfile.jvm -t platform-base-jvm-community:latest .
  4. docker run -itd --name platform-base -p 8080:8080 -u root -e APP_REGISTRY_SUBDOMAIN="root domain of device" platform-base-jvm-community:latest

Running the application in dev mode

You can run your application in dev mode that enables live coding using:

./mvnw compile quarkus:dev

NOTE: Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.

Packaging and running the application

The application can be packaged using:

./mvnw package

It produces the quarkus-run.jar file in the target/quarkus-app/ directory. Be aware that it’s not an über-jar as the dependencies are copied into the target/quarkus-app/lib/ directory.

If you want to build an über-jar, execute the following command:

./mvnw package -Dquarkus.package.type=uber-jar

The application is now runnable using the following command:

java -jar target/quarkus-app/quarkus-run.jar

Using OpenAPI and Swagger UI

OpenAPI descriptor and Swagger UI frontend to test your REST endpoints: http://localhost:8080/platform/q/swagger-ui/

For more details about the OpenAPI extension, please refer Using OpenAPI and Swagger UI.

Evolution Plan

  • Provide LAN IP direct connection domain name resolution service
  • Forwarding proxy service (Platform Proxy Service)
  • Java language SDK for basic services on the platform side
  • golang language SDK for basic services on the platform side
  • Distributed locks based on common middleware such as Mysql and Redis

Contribution Guidelines

Contributions to this project are very welcome. Here are some guidelines and suggestions to help you get involved in the project.

Contribution Guidelines

Contact us

Thanks for your contribution

Finally, thank you for your contribution to this project. We welcome contributions in all forms, including but not limited to code contributions, issue reports, feature requests, documentation writing, etc. We believe that with your help, this project will become more perfect and stronger.

platform-base's People

Contributors

aospace-admin avatar dadflyblue avatar gatsby068 avatar godvvvzzz avatar jack30724 avatar jasonzfy avatar jianminww avatar makonike avatar wang-zhichuang avatar wasdxie avatar yinjiayi avatar yuandaqing2009 avatar yuandaqing2021 avatar zhongguang-cn avatar zhongguang-iscas 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

platform-base's Issues

文档注释的参数与方法不一致

  • I have searched the issues of this repository and believe that this is not a duplicate.

代码内的文档注释的参数与方法参数不一致,出现错误的类的路径是

eulixplatform-registry/src/main/java/xyz/eulix/platform/services/network/rest/NetworkResource.java

image

Implementing Java Language SDK for the AO.space Platform Base

Description:

Familiarize yourself with the released open source project and implement a Java language SDK; write relevant test cases; write relevant design and usage documents.

Project output requirements:

Project Technical Requirements:

  • Familiarity with Java language
  • Familiarity with Quarkus framework (bonus points)
  • Familiarity with middleware such as Mysql, Redis, etc. (bonus points)
  • Familiarity with multi-threaded programming

Open Source Summer Official Website

实现傲空间平台侧基础服务的 Java 语言 SDK

描述

熟悉已发布的开源项目 ,实现 Java 语言 SDK;编写相关的测试用例;撰写相关设计、使用文档

项目产出要求

项目技术要求

  • 熟悉 Java 语言
  • 熟悉 Quarkus 框架 (加分项)
  • 熟悉 Mysql、Redis 等中间件(加分项)
  • 熟悉多线程编程实现傲空间平台侧基础服务的 Java 语言 SDK

开源之夏官网

Implementing golang Language SDK for the AO.space Platform Base

Description:

To facilitate the invocation of platform-side interfaces, we plan to implement an SDK in Golang.

Project output requirements:

Project Technical Requirements:

  • Familiarity with Golang.
  • Familiarity with the HTTP protocol.

Open Source Summer Official Website

实现傲空间平台侧基础服务的 golang 语言 SDK

描述

为了方便对平台侧基础服务接口的调用,计划实现 ao-space/platform-base golang 语言版的 sdk。

项目产出要求

项目技术要求

  • 熟悉 Golang
  • 熟悉 http 协议

开源之夏官网

[Feature] Supplement unit test cases, integration test cases

Is there an existing issue for this?

  • I have searched the existing issues

Please describe your feature request and the solution you'd like.

Currently, the unit test cases and integration test cases of platform base are not complete enough. Testing code is a very useful means to improve software quality, helping us find software bugs in advance, re-examine the written code and optimize it.

It would be better if unit test cases and integration test cases could be supplemented.

When writing test code, it should not only include simple interface calls to normal functions, but also conduct as much coverage unit testing and integration testing of main logic as possible based on various logical branches in the code. At the same time, it should also include the construction of abnormal scenario test cases.

PR for this feature from new contributor are welcome.

Anything else? (Additional Context)

No response

中文文档的图片路径错误

  • I have searched the issues of this repository and believe that this is not a duplicate.

浏览仓库过程中我发现项目的中文文档的图片好像挂了,应该是图片路径写错了,zh写成zn了
image
image
修改后:
image

Implementing Distributed Lock Based on Common Middleware like MySQL and Redis

Description:

Familiar with the open source projects, imitate RedisReentrantLock to implement distributed locks based on MySQL, distributed read-write locks based on MySQL, and Redis; Write relevant test cases; Write relevant design and usage documents

Project output requirements:

  • Implement a distributed lock based on Mysql, which has the following characteristics: reentrant; lock expiration mechanism to prevent deadlock; non-blocking lock feature.
  • Implement a distributed read-write lock based on MySQL and Redis, which has the following characteristics: reentrant read and write locks; lock expiration mechanism to prevent deadlock; non-blocking lock feature.
  • Write corresponding unit and integration tests.
  • Write corresponding design and usage documents.
  • Code meets the following standards: https://google.github.io/styleguide/javaguide.html

Project Technical Requirements:

  • Familiarity with Java language.
  • Familiarity with Quarkus framework.
  • Familiarity with middleware such as MySQL and Redis.
  • Proficient in multithreaded programming.

Open Source Summer Official Website

实现基于 MySQL、Redis 等常用中间件的分布式锁

描述

熟悉已发布的开源项目 ,模仿 RedisReentrantLock 实现基于 MySQL 的分布式锁、基于 MySQL、Redis 的分布式读写锁;编写相关的测试用例;撰写相关设计、使用文档

项目产出要求

  • 实现基于 MySQL 的分布式锁(互斥锁):具备可重入特性;具备锁失效机制,防止死锁;具备非阻塞锁特性。
  • 实现基于 MySQL、Redis 的分布式读写锁:具备读锁可重入、写锁可重入特性;具备锁失效机制,防止死锁;具备非阻塞锁特性。
  • 编写相应的单元测试和集成测试。
  • 编写相应的设计、使用文档。
  • 代码符合规范: https://google.github.io/styleguide/javaguide.html

项目技术要求

  • 熟悉 Java 语言
  • 熟悉 Quarkus 框架
  • 熟悉 MySQL、Redis 等中间件
  • 熟悉多线程编程

开源之夏官网

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.