Skip to content

Commit 3590b3d

Browse files
committed
feat: migrate memu-server with comprehensive quality automation
Major changes: - Complete project migration from original repository - Python 3.13 environment with uv package manager - FastAPI + SQLModel + PostgreSQL 16 + pgvector - Temporal workflow engine integration - Comprehensive pre-commit hooks (20 checks) * Code formatting: ruff format * Linting: ruff, pylint (9.84/10) * Security: bandit * Custom validators: credentials, migrations, makefile, markdown - Test coverage: 41% with automated checks - GitHub Actions CI/CD pipeline - Environment variable validation at startup - All security best practices enforced - Complete English documentation
1 parent 32bf4f4 commit 3590b3d

28 files changed

Lines changed: 2318 additions & 327 deletions

.env.example

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# ===================================
2+
# Database Configuration
3+
# ===================================
4+
# For docker-compose
5+
POSTGRES_USER=memu_user
6+
POSTGRES_PASSWORD=memu_pass
7+
POSTGRES_DB=memu_db
8+
9+
# For application
10+
DATABASE_HOST=localhost
11+
DATABASE_PORT=54320
12+
DATABASE_USER=memu_user
13+
DATABASE_PASSWORD=memu_pass
14+
DATABASE_NAME=memu_db
15+
16+
# ===================================
17+
# Temporal Configuration
18+
# ===================================
19+
TEMPORAL_HOST=localhost
20+
TEMPORAL_PORT=17233
21+
TEMPORAL_NAMESPACE=default
22+
23+
# ===================================
24+
# LLM Configuration
25+
# ===================================
26+
OPENAI_API_KEY=your_openai_api_key_here
27+
OPENAI_BASE_URL=https://api.openai.com/v1
28+
DEFAULT_LLM_MODEL=gpt-4o-mini
29+
30+
# ===================================
31+
# Embedding Configuration
32+
# ===================================
33+
EMBEDDING_API_KEY=your_embedding_api_key_here
34+
EMBEDDING_BASE_URL=https://api.voyageai.com/v1
35+
EMBEDDING_MODEL=voyage-3.5-lite
36+
37+
# ===================================
38+
# Storage Configuration
39+
# ===================================
40+
STORAGE_PATH=/var/data/memu-server

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ body:
77
attributes:
88
value: |
99
Thanks for taking the time to report a bug! Please fill out the form below.
10-
10+
1111
- type: textarea
1212
id: description
1313
attributes:
@@ -16,7 +16,7 @@ body:
1616
placeholder: Describe the bug...
1717
validations:
1818
required: true
19-
19+
2020
- type: textarea
2121
id: reproduction
2222
attributes:
@@ -28,7 +28,7 @@ body:
2828
3. See error
2929
validations:
3030
required: true
31-
31+
3232
- type: textarea
3333
id: expected
3434
attributes:
@@ -37,7 +37,7 @@ body:
3737
placeholder: What should happen?
3838
validations:
3939
required: true
40-
40+
4141
- type: textarea
4242
id: actual
4343
attributes:
@@ -46,7 +46,7 @@ body:
4646
placeholder: What actually happened?
4747
validations:
4848
required: true
49-
49+
5050
- type: textarea
5151
id: environment
5252
attributes:
@@ -58,7 +58,7 @@ body:
5858
- memU-server Version: [e.g. 1.0.0]
5959
validations:
6060
required: false
61-
61+
6262
- type: textarea
6363
id: logs
6464
attributes:
@@ -67,7 +67,7 @@ body:
6767
render: shell
6868
validations:
6969
required: false
70-
70+
7171
- type: textarea
7272
id: additional
7373
attributes:

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ body:
77
attributes:
88
value: |
99
Thanks for suggesting a new feature! Please fill out the form below.
10-
10+
1111
- type: textarea
1212
id: problem
1313
attributes:
@@ -16,7 +16,7 @@ body:
1616
placeholder: I'm always frustrated when...
1717
validations:
1818
required: true
19-
19+
2020
- type: textarea
2121
id: solution
2222
attributes:
@@ -25,7 +25,7 @@ body:
2525
placeholder: I would like to have...
2626
validations:
2727
required: true
28-
28+
2929
- type: textarea
3030
id: alternatives
3131
attributes:
@@ -34,7 +34,7 @@ body:
3434
placeholder: Alternative approaches could be...
3535
validations:
3636
required: false
37-
37+
3838
- type: textarea
3939
id: benefits
4040
attributes:
@@ -43,7 +43,7 @@ body:
4343
placeholder: This feature would help users...
4444
validations:
4545
required: false
46-
46+
4747
- type: textarea
4848
id: additional
4949
attributes:

.github/ISSUE_TEMPLATE/improvement_suggestion.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ body:
77
attributes:
88
value: |
99
Thanks for suggesting an improvement! Please fill out the form below.
10-
10+
1111
- type: textarea
1212
id: current
1313
attributes:
@@ -16,7 +16,7 @@ body:
1616
placeholder: Currently, the system...
1717
validations:
1818
required: true
19-
19+
2020
- type: textarea
2121
id: suggested
2222
attributes:
@@ -25,7 +25,7 @@ body:
2525
placeholder: It would be better if...
2626
validations:
2727
required: true
28-
28+
2929
- type: textarea
3030
id: rationale
3131
attributes:
@@ -34,7 +34,7 @@ body:
3434
placeholder: This would improve...
3535
validations:
3636
required: true
37-
37+
3838
- type: textarea
3939
id: impact
4040
attributes:
@@ -43,7 +43,7 @@ body:
4343
placeholder: This would affect...
4444
validations:
4545
required: false
46-
46+
4747
- type: textarea
4848
id: implementation
4949
attributes:
@@ -52,7 +52,7 @@ body:
5252
placeholder: This could be implemented by...
5353
validations:
5454
required: false
55-
55+
5656
- type: textarea
5757
id: additional
5858
attributes:

.gitignore

Lines changed: 41 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
1-
/_local/
2-
/data
3-
docs/source
4-
config/secrets
5-
.secrets/
6-
node_modules
7-
# From https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore
8-
9-
# Byte-compiled / optimized / DLL files
1+
# Python
102
__pycache__/
113
*.py[cod]
124
*$py.class
13-
14-
# C extensions
155
*.so
16-
17-
# Distribution / packaging
186
.Python
197
build/
208
develop-eggs/
@@ -28,121 +16,59 @@ parts/
2816
sdist/
2917
var/
3018
wheels/
31-
share/python-wheels/
3219
*.egg-info/
3320
.installed.cfg
3421
*.egg
35-
MANIFEST
36-
37-
# PyInstaller
38-
# Usually these files are written by a python script from a template
39-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
40-
*.manifest
41-
*.spec
42-
43-
# Installer logs
44-
pip-log.txt
45-
pip-delete-this-directory.txt
46-
47-
# Unit test / coverage reports
48-
htmlcov/
49-
.tox/
50-
.nox/
51-
.coverage
52-
.coverage.*
53-
.cache
54-
nosetests.xml
55-
coverage.xml
56-
*.cover
57-
*.py,cover
58-
.hypothesis/
59-
.pytest_cache/
60-
cover/
61-
62-
# Translations
63-
*.mo
64-
*.pot
65-
66-
# Django stuff:
67-
*.log
68-
local_settings.py
69-
db.sqlite3
70-
db.sqlite3-journal
71-
72-
# Flask stuff:
73-
instance/
74-
.webassets-cache
75-
76-
# Scrapy stuff:
77-
.scrapy
78-
79-
# Sphinx documentation
80-
docs/_build/
81-
82-
# PyBuilder
83-
.pybuilder/
84-
target/
85-
86-
# Jupyter Notebook
87-
.ipynb_checkpoints
8822

89-
# IPython
90-
profile_default/
91-
ipython_config.py
92-
93-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
94-
__pypackages__/
95-
96-
# Celery stuff
97-
celerybeat-schedule
98-
celerybeat.pid
99-
100-
# SageMath parsed files
101-
*.sage.py
23+
# Virtual Environment
24+
venv/
25+
env/
26+
ENV/
27+
.venv/
10228

103-
# Environments
29+
# Environment Variables
10430
.env
10531
.env.dev
32+
.env.prod
10633
.env.local
107-
.env.*.local
108-
.venv
109-
env/
110-
venv/
111-
ENV/
112-
env.bak/
113-
venv.bak/
114-
**/config/*.secret.py
11534

116-
# Spyder project settings
117-
.spyderproject
118-
.spyproject
35+
# IDEs
36+
.vscode/
37+
.idea/
38+
*.swp
39+
*.swo
40+
*~
11941

120-
# Rope project settings
121-
.ropeproject
42+
# Database
43+
*.db
44+
*.sqlite3
45+
*.sql
12246

123-
# mkdocs documentation
124-
/site
47+
# Logs
48+
*.log
49+
logs/
50+
server.log
51+
nohup.out
12552

126-
# mypy
127-
.mypy_cache/
128-
.dmypy.json
129-
dmypy.json
53+
# Storage
54+
storage/*
55+
!storage/.gitkeep
56+
data/
13057

131-
# Pyre type checker
132-
.pyre/
58+
# Alembic
59+
alembic/versions/__pycache__/
13360

134-
# pytype static type analyzer
135-
.pytype/
61+
# Testing
62+
.pytest_cache/
63+
.coverage
64+
htmlcov/
65+
.tox/
13666

137-
# Cython debug symbols
138-
cython_debug/
67+
# OS
68+
.DS_Store
69+
Thumbs.db
13970

140-
# Vscode config files
141-
.vscode/
142-
.claude/
143-
# PyCharm
144-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
145-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
146-
# and can be added to the global gitignore or merged into this file. For a more nuclear
147-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
148-
.idea/
71+
# Docker
72+
docker-compose.override.yml
73+
.pre-commit-hooks/
74+
.github/workflows/

0 commit comments

Comments
 (0)