This document describes the layered system architecture of APIJSON, explaining how JSON requests flow through multiple processing layers to execute database operations and return results. The architecture enables APIJSON's core value proposition: a real-time no-code ORM providing APIs and documentation without backend coding README.md10 It covers the interaction between client applications, the JSON transmission protocol, the core ORM components, and the underlying multi-database execution layer.
APIJSON follows a multi-layered architecture that transforms JSON requests into database queries without requiring custom backend code for each API endpoint.
Sources:
The Client Layer consists of applications that generate JSON requests. APIJSON supports clients across multiple platforms including Java (Android), Go, C#, PHP, Node.js, Python, and Rust README.md58-65
| Client Type | Implementation | Use Case |
|---|---|---|
| Web Browsers | JavaScript/Node.js | SPAs, admin dashboards README.md63 |
| Android Apps | Java/Kotlin SDK | Native mobile apps README.md58 |
| API Testing | APIAuto | Development, testing, and automatic documentation README.md76 |
| Server-side | Go, Python, Rust | Microservices communication README.md59-65 |
The Protocol Layer defines the HTTP-JSON interface. All requests use standard HTTP methods mapping to CRUD operations. The system uses a specialized JSON transmission protocol where the request structure dictates the response structure.
| HTTP Method | APIJSON Endpoint | Operation |
|---|---|---|
GET | /get | Query data (Read) APIJSONORM/src/main/java/apijson/orm/SQLConfig.java228-229 |
POST | /post | Insert data (Create) |
PUT | /put | Update data (Update) |
DELETE | /delete | Delete data (Delete) |
HEAD | /head | Count records or check existence |
Sources:
The Core Processing Layer orchestrates request handling through primary components defined in the apijson.orm package. This layer transforms JSON requests into executable SQL configurations while enforcing security policies and handling complex logic like joins and remote functions.
| Component | Interface | Primary Responsibility |
|---|---|---|
| Request Orchestrator | Parser | Transaction management, request lifecycle, and recursion depth control APIJSONORM/src/main/java/apijson/orm/Parser.java18-134 |
| Security Gate | Verifier | Role-based access control (RBAC) and structural content validation APIJSONORM/src/main/java/apijson/orm/Parser.java108 |
| SQL Configurator | SQLConfig | Configuration of SQL parameters, dialects, and table/column mappings APIJSONORM/src/main/java/apijson/orm/SQLConfig.java18-248 |
Sources:
The SQL Generation Layer produces database-specific SQL from configuration objects. The system supports over 30 database types README.md21-55 adapting the dialect for each.
| Category | Supported Databases (via SQLConfig constants) |
|---|---|
| Relational | DATABASE_MYSQL, DATABASE_POSTGRESQL, DATABASE_SQLSERVER, DATABASE_ORACLE, DATABASE_DB2, DATABASE_MARIADB, DATABASE_TIDB APIJSONORM/src/main/java/apijson/orm/SQLConfig.java20-26 |
| NoSQL/Search | DATABASE_ELASTICSEARCH, DATABASE_MANTICORE, DATABASE_REDIS, DATABASE_MONGODB APIJSONORM/src/main/java/apijson/orm/SQLConfig.java30-49 |
| OLAP/Big Data | DATABASE_CLICKHOUSE, DATABASE_HIVE, DATABASE_PRESTO, DATABASE_TRINO APIJSONORM/src/main/java/apijson/orm/SQLConfig.java32-35 |
| Time-Series | DATABASE_TDENGINE, DATABASE_INFLUXDB, DATABASE_TIMESCALEDB, DATABASE_IOTDB APIJSONORM/src/main/java/apijson/orm/SQLConfig.java42-46 |
Sources:
The Execution Layer runs generated SQL statements and processes results. The SQLExecutor (managed via Parser) handles the connection lifecycle and transaction isolation levels.
Parser provides methods for begin, rollback, and commit APIJSONORM/src/main/java/apijson/orm/Parser.java125-128Parser enforces safety limits such as getMaxSQLCount, getMaxQueryCount, and getMaxObjectCount APIJSONORM/src/main/java/apijson/orm/Parser.java88-91getMaxQueryDepth prevents overly complex nested queries APIJSONORM/src/main/java/apijson/orm/Parser.java93Sources:
The Configuration Layer uses system metadata to control API behavior without code changes.
SCHEMA_INFORMATION and SCHEMA_SYS are defined for metadata discovery APIJSONORM/src/main/java/apijson/orm/SQLConfig.java58-59TABLE_SCHEMA and TABLE_NAME constants APIJSONORM/src/main/java/apijson/orm/SQLConfig.java60-61The Parser interface allows fine-grained control over verification and global behavior:
setNeedVerifyLogin, setNeedVerifyRole, setNeedVerifyContent APIJSONORM/src/main/java/apijson/orm/Parser.java40-47Database, Schema, Datasource, and Role APIJSONORM/src/main/java/apijson/orm/Parser.java112-117Sources:
This diagram associates system logic with specific code entities to show how a request is processed from the entry point to database execution.
Sources:
Refresh this wiki