feat(p1): complete P1 foundation stage
Some checks failed
CI Go / test (push) Has been cancelled
CI Proto / lint (push) Has been cancelled
CI Python / test (push) Has been cancelled
CI TypeScript / test (push) Has been cancelled

- monorepo: pnpm workspace + go.work + pyproject.toml + commitlint/husky
- infra: docker-compose (minimal + full profiles) + init-sql + prometheus
- arch-scan: multi-language scanner skeleton (TS/Go/Python/Proto)
- shared-proto: buf v2 + classes.proto (ClassService CRUD contract)
- api-gateway: Go/Gin + JWT HS256 auth + reverse proxy + request ID
- classes: NestJS golden template (error system + observability + middleware + CRUD + tests)
- teacher-portal: Next.js + paper-feel UI design system
- CI/CD: 4 workflows (go/ts/py/proto)
- docs: migration guide + project_rules + coding-standards + git-workflow + ui-design-system + 004 + 9 module READMEs + known-issues + spec/plan migration + roadmap
This commit is contained in:
SpecialX
2026-07-07 23:39:37 +08:00
commit 2ba4250165
100 changed files with 15242 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
version: v2
plugins:
- remote: buf.build/protocolbuffers/go
out: ../shared-go/gen/proto
- remote: buf.build/protocolbuffers/js
out: ../shared-ts/gen/proto
- remote: buf.build/protocolbuffers/python
out: ../shared-py/gen/proto

View File

@@ -0,0 +1,9 @@
version: v2
modules:
- path: proto
lint:
use:
- STANDARD
breaking:
use:
- FILE

View File

@@ -0,0 +1,10 @@
{
"name": "@edu/shared-proto",
"version": "0.1.0",
"private": true,
"scripts": {
"lint": "buf lint",
"breaking": "buf breaking --against .git#branch=main",
"generate": "buf generate"
}
}

View File

@@ -0,0 +1,58 @@
syntax = "proto3";
package next_edu_cloud.classes.v1;
// ClassService 定义班级域 CRUD 契约
// P1: REST 实现P3 起转 gRPC
service ClassService {
rpc CreateClass(CreateClassRequest) returns (Class);
rpc GetClass(GetClassRequest) returns (Class);
rpc ListClasses(ListClassesRequest) returns (ListClassesResponse);
rpc UpdateClass(UpdateClassRequest) returns (Class);
rpc DeleteClass(DeleteClassRequest) returns (Empty);
}
message Class {
string id = 1;
string name = 2;
string grade_id = 3;
string head_teacher_id = 4;
string description = 5;
int64 created_at = 6;
int64 updated_at = 7;
}
message CreateClassRequest {
string name = 1;
string grade_id = 2;
string head_teacher_id = 3;
string description = 4;
}
message GetClassRequest {
string id = 1;
}
message ListClassesRequest {
string grade_id = 1;
int32 page_size = 2;
string page_token = 3;
}
message ListClassesResponse {
repeated Class classes = 1;
string next_page_token = 2;
}
message UpdateClassRequest {
string id = 1;
optional string name = 2;
optional string head_teacher_id = 3;
optional string description = 4;
}
message DeleteClassRequest {
string id = 1;
}
message Empty {}