Skip to content

Commit af0e2bc

Browse files
committed
update docs
1 parent a80e8a9 commit af0e2bc

File tree

7 files changed

+275
-17
lines changed

7 files changed

+275
-17
lines changed
Lines changed: 259 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,259 @@
1+
<template>
2+
<footer class="footer">
3+
<div class="footer-content">
4+
<!-- Brand Section -->
5+
<div class="footer-section brand-section">
6+
<div class="section-title">FastAPI Best Architecture</div>
7+
<div class="section-description">
8+
基于 FastAPI 构建的企业级后端架构解决方案
9+
</div>
10+
<div class="social-links">
11+
<a
12+
href="https://github.com/fastapi-practices/fastapi_best_architecture"
13+
target="_blank"
14+
rel="noopener noreferrer"
15+
class="social-link"
16+
>
17+
<Icon name="line-md:github" size="2rem" />
18+
</a>
19+
<a href="/fastapi_best_architecture_docs/blog/" class="social-link">
20+
<Icon name="la:blog" size="2rem" />
21+
</a>
22+
</div>
23+
</div>
24+
<div class="footer-section">
25+
<div class="section-title">使用文档</div>
26+
<div class="link-list">
27+
<a
28+
v-for="link in links.product"
29+
:key="link.name"
30+
:href="link.href"
31+
:target="link.href.startsWith('http') ? '_blank' : undefined"
32+
rel="noopener noreferrer"
33+
class="footer-link"
34+
>
35+
{{ link.name }}
36+
</a>
37+
</div>
38+
</div>
39+
<div class="footer-section">
40+
<div class="section-title">生态系统</div>
41+
<div class="link-list">
42+
<a
43+
v-for="link in links.community"
44+
:key="link.name"
45+
:href="link.href"
46+
:target="link.href.startsWith('http') ? '_blank' : undefined"
47+
rel="noopener noreferrer"
48+
class="footer-link"
49+
>
50+
{{ link.name }}
51+
</a>
52+
</div>
53+
</div>
54+
<div class="footer-section">
55+
<div class="section-title">插件系统</div>
56+
<div class="link-list">
57+
<a
58+
v-for="link in links.resources"
59+
:key="link.name"
60+
:href="link.href"
61+
:target="link.href.startsWith('http') ? '_blank' : undefined"
62+
rel="noopener noreferrer"
63+
class="footer-link"
64+
>
65+
{{ link.name }}
66+
</a>
67+
</div>
68+
</div>
69+
<div class="footer-section">
70+
<div class="section-title">更多</div>
71+
<div class="link-list">
72+
<a
73+
v-for="link in links.friendlyLinks"
74+
:key="link.name"
75+
:href="link.href"
76+
rel="noopener noreferrer"
77+
class="footer-link"
78+
>
79+
{{ link.name }}
80+
</a>
81+
</div>
82+
</div>
83+
</div>
84+
85+
<div class="separator"></div>
86+
87+
<div class="footer-bottom">
88+
<div class="footer-bottom-left">
89+
<span>Copyright © 2023-{{ currentYear }} FastAPI Practices and contributors.</span>
90+
<span>
91+
Released under the
92+
<a
93+
href="https://github.com/fastapi-practices/fastapi_best_architecture/blob/master/LICENSE"
94+
target="_blank"
95+
rel="noopener noreferrer"
96+
class="footer-link"
97+
>
98+
MIT License
99+
</a>
100+
</span>
101+
</div>
102+
<span>
103+
Made with ❤️ by
104+
<a
105+
href="https://wu-clan.github.io/homepage/"
106+
target="_blank"
107+
rel="noopener noreferrer"
108+
class="footer-link"
109+
>
110+
wu-clan
111+
</a>
112+
</span>
113+
</div>
114+
</footer>
115+
</template>
116+
117+
<script setup>
118+
const currentYear = new Date().getFullYear();
119+
120+
const links = {
121+
product: [
122+
{ name: "快速开始", href: "/fastapi_best_architecture_docs/backend/summary/quick-start" },
123+
{ name: "Vben UI", href: "/fastapi_best_architecture_docs/frontend/summary/intro" },
124+
{ name: "Apifox", href: "https://apifox.com/apidoc/shared-28a93f02-730b-4f33-bb5e-4dad92058cc0" },
125+
{ name: "常见问题", href: "/fastapi_best_architecture_docs/questions" },
126+
{
127+
name: "更新记录",
128+
href: "https://github.com/fastapi-practices/fastapi_best_architecture/blob/master/CHANGELOG.md"
129+
},
130+
],
131+
community: [
132+
{ name: "开源项目", href: "/fastapi_best_architecture_docs/opensource" },
133+
{ name: "技术栈", href: "/fastapi_best_architecture_docs/stack" },
134+
{ name: "用户登记", href: "/fastapi_best_architecture_docs/users" },
135+
{ name: "Github 问题", href: "https://github.com/fastapi-practices/fastapi_best_architecture/issues" },
136+
{ name: "Github 讨论", href: "https://github.com/fastapi-practices/fastapi_best_architecture/discussions" },
137+
],
138+
resources: [
139+
{ name: "插件开发", href: "/fastapi_best_architecture_docs/plugin/dev" },
140+
{ name: "插件分享", href: "/fastapi_best_architecture_docs/plugin/share" },
141+
{ name: "插件安装", href: "/fastapi_best_architecture_docs/plugin/install" },
142+
{ name: "插件市场", href: "/fastapi_best_architecture_docs/market" },
143+
],
144+
friendlyLinks: [
145+
{ name: "视频教程", href: "https://space.bilibili.com/284237214/lists" },
146+
{ name: "博客", href: "/fastapi_best_architecture_docs/blog/" },
147+
{ name: "隐私政策", href: "/fastapi_best_architecture_docs/privacy-policy" },
148+
],
149+
};
150+
</script>
151+
152+
<style scoped>
153+
.footer {
154+
background-color: var(--vp-c-bg-alt);
155+
padding: 3rem;
156+
}
157+
158+
.footer-content {
159+
display: flex;
160+
justify-content: space-between;
161+
max-width: 1500px;
162+
margin: 0 auto;
163+
}
164+
165+
.footer-section {
166+
min-width: 140px;
167+
max-width: 200px;
168+
display: flex;
169+
flex-direction: column;
170+
}
171+
172+
.brand-section {
173+
flex: 1;
174+
min-width: 280px;
175+
max-width: 400px;
176+
}
177+
178+
.section-title {
179+
font-size: 1.125rem;
180+
font-weight: 600;
181+
margin-bottom: 1rem;
182+
}
183+
184+
.section-description {
185+
color: var(--vp-c-text-2);
186+
font-size: 0.875rem;
187+
margin-bottom: 0.875rem;
188+
}
189+
190+
.social-links {
191+
display: flex;
192+
gap: 1rem;
193+
margin-top: auto;
194+
}
195+
196+
.social-link,
197+
.footer-link {
198+
color: var(--vp-c-text-2);
199+
font-size: 0.875rem;
200+
text-decoration: none !important;
201+
transition: color 0.2s;
202+
}
203+
204+
.social-link:hover,
205+
.footer-link:hover {
206+
color: var(--vp-c-text);
207+
text-decoration: none !important;
208+
}
209+
210+
.link-list {
211+
display: flex;
212+
flex-direction: column;
213+
gap: 0.875rem;
214+
}
215+
216+
.separator {
217+
border-top: 1px solid var(--vp-c-border);
218+
margin: 3rem 0 2rem;
219+
}
220+
221+
.footer-bottom {
222+
display: flex;
223+
justify-content: space-between;
224+
align-items: center;
225+
color: var(--vp-c-text-2);
226+
font-size: 0.875rem;
227+
max-width: 1500px;
228+
margin: 0 auto;
229+
}
230+
231+
.footer-bottom-left {
232+
display: flex;
233+
flex-direction: column;
234+
gap: 0.25rem;
235+
}
236+
237+
@media (max-width: 768px) {
238+
.footer-content {
239+
flex-direction: column;
240+
gap: 2rem;
241+
}
242+
243+
.footer-section {
244+
min-width: 100%;
245+
max-width: 100%;
246+
}
247+
248+
.brand-section {
249+
min-width: 100%;
250+
max-width: 100%;
251+
}
252+
253+
.footer-bottom {
254+
flex-direction: column;
255+
align-items: flex-start;
256+
gap: 0.5rem;
257+
}
258+
}
259+
</style>

docs/.vuepress/layouts/Layout.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Layout } from "vuepress-theme-plume/client";
33
import SponsorPanel from "../components/SponsorPanel.vue";
44
import BannerTop from "../components/BannerTop.vue";
55
import SponsorSidebar from "../components/SponsorSidebar.vue";
6+
import Footer from "../components/Footer.vue";
67
78
const text = "完全开源";
89
const characters = text.split("");
@@ -37,6 +38,11 @@ const characters = text.split("");
3738
<SponsorPanel />
3839
</div>
3940
</template>
41+
<template #footer-content>
42+
<div class="custom-content">
43+
<Footer />
44+
</div>
45+
</template>
4046
</Layout>
4147
</template>
4248

docs/.vuepress/styles/custom.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
--vp-c-brand-3: rgba(0, 148, 133, 1);
88

99
/* 导航栏分组 */
10+
1011
.vp-menu-group {
1112
.title {
1213
color: rgba(60, 60, 60, 0.33);
@@ -23,6 +24,7 @@
2324
--vp-c-brand-3: rgba(0, 148, 133, 1);
2425

2526
/* 导航栏分组 */
27+
2628
.vp-menu-group {
2729
.title {
2830
color: rgba(235, 235, 235, 0.38);
@@ -77,3 +79,8 @@
7779
top: -32px;
7880
}
7981
}
82+
83+
/* 页脚 */
84+
.vp-footer {
85+
padding: unset !important;
86+
}

docs/.vuepress/theme.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ export const myTheme: Theme = plumeTheme({
5050
navbarSocialInclude: ['github', 'gitee'],
5151
editLinkText: '编辑此页面',
5252
contributors: false,
53-
footer: {
54-
message: 'FastAPI 最佳架构 & MIT LICENCE',
55-
copyright: 'Copyright © 2023-present FastAPI Practices'
56-
},
5753
//watermark: true,
5854
markdown: {
5955
abbr: true,

docs/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,5 @@ mode="carousel"
8888
<div align="center">
8989
<a href="https://github.com/fastapi-practices/fastapi_best_architecture/graphs/contributors">
9090
<img src="https://contrib.rocks/image?repo=fastapi-practices/fastapi_best_architecture"/>
91-
</a><br>
92-
<a href="/fastapi_best_architecture_docs/join.html" style="font-size: 13px">加入我们</a>
91+
</a>
9392
</div>

docs/backend/reference/db.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,7 @@ DATABASE_PASSWORD='123456'
7373

7474
## 解耦
7575

76-
在实际项目开发中,几乎不会存在同时兼容多种数据库的情况,我们在模型中使用 `with_variant` 尽可能的兼容 PostgreSQL 和
77-
MySQL,例如:
78-
79-
```python:no-line-numbers
80-
remark: Mapped[str | None] = mapped_column(sa.TEXT().with_variant(LONGTEXT, 'mysql')) # [!code word:with_variant]
81-
```
82-
83-
解耦步骤如下:
84-
85-
- 删除 `with_variant` 相关代码并且仅保留数据库对应的类型
76+
- 删除 `with_variant` 相关代码(如果存在),仅保留数据库对应的类型
8677
- 删除 `backend/core/conf.py` 文件中的 `DATABASE_TYPE` 及其相关的调用代码
8778
- 删除 `.env_example``.env` 文件中的 `DATABASE_TYPE`
8879
- 更新 `backend/templates/py/model.jinja` 文件中的 `database_type` 相关代码

docs/plugin/dev.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ tags = ''
108108
### 数据库兼容性
109109

110110
fba 内所有官方实现都同时兼容 mysql 和 postgresql,但我们不对第三方插件进行强制要求,如果您对此感兴趣,请查看 SQLAlchemy 2.0
111-
官方文档:
111+
官方文档[TypeDecorator](https://docs.sqlalchemy.org/en/20/core/custom_types.html#typedecorator-recipes)
112112
[with_variant](https://docs.sqlalchemy.org/en/20/core/type_api.html#sqlalchemy.types.TypeEngine.with_variant)
113113

114114
### 插件目录结构

0 commit comments

Comments
 (0)