feat: add tenant and user management with migrations, handlers, and tests

- Implemented tenant and user management features including:
  - Tenant creation and management with associated migrations.
  - User creation and management with associated migrations.
  - Tenant membership management with associated migrations.
  - Platform user roles management with associated migrations.
  - Quota management with associated migrations.
  - Article and template management with associated migrations.
- Added HTTP handlers for templates and workspaces.
- Created tests for protected and public routes.
- Introduced a script to check tenant scope in SQL queries.
- Documented task plan for backend completion and frontend foundation.
This commit is contained in:
2026-04-01 00:58:42 +08:00
commit de30497f59
210 changed files with 23733 additions and 0 deletions
+182
View File
@@ -0,0 +1,182 @@
/* Clean Enterprise UI Reset */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;700&display=swap");
:root {
font-family: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
color: #141414;
background-color: #f0f2f5;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
--muted: #8c8c8c;
--accent: #1677ff;
--line: #f0f0f0;
}
* {
box-sizing: border-box;
}
html, body, #app {
min-height: 100vh;
margin: 0;
padding: 0;
}
/* Typography Utilities */
.eyebrow {
margin: 0 0 8px;
color: var(--muted);
font-size: 13px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.muted {
color: var(--muted);
}
.section-heading {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
margin-bottom: 24px;
}
.section-heading h3 {
margin: 0;
font-size: 20px;
font-weight: 600;
color: #1a1a1a;
}
/* Component Overrides for Ant Design to match Pro style */
.ant-layout {
min-height: 100vh;
}
.ant-layout-header {
box-shadow: 0 1px 4px rgba(0,21,41,0.08); /* slight shadow for topbar */
z-index: 1;
}
.ant-card {
box-shadow: 0 1px 2px 0 rgba(0,0,0,0.03);
}
.ant-menu-dark .ant-menu-item-selected {
background-color: var(--accent);
}
.app-root {
display: flex;
min-height: 100vh;
}
/* Workspace Layout Specifics */
.workspace-view {
display: flex;
flex-direction: column;
gap: 24px;
}
.workspace-hero__subtitle {
color: var(--muted);
font-size: 14px;
margin-top: 8px;
margin-bottom: 24px;
}
.metric-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 24px;
}
/* Auth / Login specific styling */
.login-screen {
min-height: 100vh;
display: flex;
flex: 1;
width: 100%;
background-color: #f0f2f5;
}
.login-screen__cover {
flex: 1;
background: linear-gradient(135deg, #001529 0%, #1677ff 100%);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #fff;
padding: 40px;
text-align: center;
}
.login-screen__cover h1 {
font-size: 48px;
font-weight: 700;
margin-bottom: 16px;
color: #fff;
}
.login-screen__cover p {
font-size: 18px;
opacity: 0.8;
max-width: 480px;
}
.login-screen__form-container {
width: 500px;
background: #fff;
display: flex;
flex-direction: column;
justify-content: center;
padding: 60px 48px;
box-shadow: -4px 0 16px rgba(0,0,0,0.05);
}
.login-header {
margin-bottom: 40px;
}
.login-header h2 {
font-size: 28px;
font-weight: 600;
margin: 0 0 8px;
color: #141414;
}
.login-header p {
color: var(--muted);
margin: 0;
font-size: 15px;
}
/* Responsive */
@media (max-width: 992px) {
.metric-grid {
grid-template-columns: repeat(2, 1fr);
}
.login-screen__cover {
display: none;
}
.login-screen__form-container {
width: 100%;
align-items: center;
}
.login-header, .ant-form {
width: 100%;
max-width: 400px;
}
}
@media (max-width: 576px) {
.metric-grid {
grid-template-columns: 1fr;
}
}