commit a3f5386395ced9f58948ceada8dfc5b76a1b0b81 Author: zy7y <13271962515@163.com> Date: Wed Dec 29 22:29:01 2021 +0800 init: project diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..3f332b9 --- /dev/null +++ b/.env.development @@ -0,0 +1,16 @@ +ENVIRONMENT=development + +# jwt +SECRET_KEY=JwrddNQ1jbhdgEqEXhIVqUU1PineCLVW4evEKly2Zdc + +# 数据库 +MYSQL_SERVER=localhost:3306 +MYSQL_USER=root +MYSQL_PASSWORD=123456 +MYSQL_DB=mall + +# redis +REDIS_SERVER=localhost:6379 + +#rabbitMQ + diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..e69de29 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c224c4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,141 @@ +### Python template +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ +.idea + + diff --git a/api/__init__.py b/api/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/__init__.py b/core/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/config.py b/core/config.py new file mode 100644 index 0000000..27f5e75 --- /dev/null +++ b/core/config.py @@ -0,0 +1,29 @@ +from pydantic import BaseSettings + + +class Settings(BaseSettings): + SECRET_KEY: str + + # 数据库 + MYSQL_ADDRESS: str + MYSQL_USER: str + MYSQL_PASSWORD: str + MYSQL_DB: str + + # redis, ip + 端口 + REDIS_SERVER: str + + # rabbitMQ + RABBITMQ_ADDRESS: str + + # 短信服务 + + # 邮件服务 + + # 支付宝信息 + + # 存储服务信息 + + +# pip freeze > requirements.txt +# settings = Settings(_env_file='prod.env', _env_file_encoding='utf-8') \ No newline at end of file diff --git a/crud/__init__.py b/crud/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/main.py b/main.py new file mode 100644 index 0000000..5ff382a --- /dev/null +++ b/main.py @@ -0,0 +1,13 @@ +from fastapi import FastAPI +from fastapi.middleware.cors import CORSMiddleware + + +app = FastAPI() + +app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], +) diff --git a/models/__init__.py b/models/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/models/user.py b/models/user.py new file mode 100644 index 0000000..e69de29 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..01ef3a5 Binary files /dev/null and b/requirements.txt differ diff --git a/schemas/__init__.py b/schemas/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/utils.py b/utils.py new file mode 100644 index 0000000..e69de29