Skip to content

Commit a208f54

Browse files
committed
Initial Folder framework and most of README done
0 parents  commit a208f54

File tree

18 files changed

+220
-0
lines changed

18 files changed

+220
-0
lines changed

.gitignore

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/python,
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=python,
4+
5+
#!! ERROR: is undefined. Use list command to see defined gitignore types !!#
6+
7+
### Python ###
8+
# Byte-compiled / optimized / DLL files
9+
__pycache__/
10+
*.py[cod]
11+
*$py.class
12+
13+
# C extensions
14+
*.so
15+
16+
# Distribution / packaging
17+
.Python
18+
build/
19+
develop-eggs/
20+
dist/
21+
downloads/
22+
eggs/
23+
.eggs/
24+
lib/
25+
lib64/
26+
parts/
27+
sdist/
28+
var/
29+
wheels/
30+
pip-wheel-metadata/
31+
share/python-wheels/
32+
*.egg-info/
33+
.installed.cfg
34+
*.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+
pytestdebug.log
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+
doc/_build/
82+
83+
# PyBuilder
84+
target/
85+
86+
# Jupyter Notebook
87+
.ipynb_checkpoints
88+
89+
# IPython
90+
profile_default/
91+
ipython_config.py
92+
93+
# pyenv
94+
.python-version
95+
96+
# pipenv
97+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
98+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
99+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
100+
# install all needed dependencies.
101+
#Pipfile.lock
102+
103+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
104+
__pypackages__/
105+
106+
# Celery stuff
107+
celerybeat-schedule
108+
celerybeat.pid
109+
110+
# SageMath parsed files
111+
*.sage.py
112+
113+
# Environments
114+
.env
115+
.venv
116+
env/
117+
venv/
118+
ENV/
119+
env.bak/
120+
venv.bak/
121+
pythonenv*
122+
123+
# Spyder project settings
124+
.spyderproject
125+
.spyproject
126+
127+
# Rope project settings
128+
.ropeproject
129+
130+
# mkdocs documentation
131+
/site
132+
133+
# mypy
134+
.mypy_cache/
135+
.dmypy.json
136+
dmypy.json
137+
138+
# Pyre type checker
139+
.pyre/
140+
141+
# pytype static type analyzer
142+
.pytype/
143+
144+
# profiling data
145+
.prof
146+
147+
# End of https://www.toptal.com/developers/gitignore/api/python,
148+
nn

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
FastAPI Base Scaffolding
2+
=============================================================================
3+
4+
![GitHub](https://img.shields.io/github/license/blevinscm/fastapi-scaffold-base) ![GitHub contributors](https://img.shields.io/github/contributors/blevinscm/fastapi-scaffold-base) ![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/blevinscm/fastapi-scaffold-base?include_prereleases)
5+
6+
7+
<img align="center" width="400" src="./images/fastapi-logo.png"/>
8+
9+
#### Project Lead : | [Chris Blevins](https://github.com/blevinscm)
10+
11+
Thanks to [Sebastián Ramírez @tiangolo](https://github.com/tiangolo) we have the wonderful FastAPI package for developing applications and APIs. Anyone looking at this repository is most likely familiar with the project. If not I highly recommend Reading the Docs.
12+
13+
### [FastAPI](https://fastapi.tiangolo.com/)
14+
15+
While learning and using FastAPI I have often needed/wanted lightweight project scaffolding. The project generators and scaffolding projects in the FastAPI ecosystem have been either too deterministic and too big or not deterministic enough for me.
16+
17+
This uis how I set up a new FastAPI project. I hope this is helpful.
18+
19+
## Dependencies:
20+
21+
|Package | Note |
22+
|:----|:------------|
23+
|[Python 3.6+](https://www.python.org/downloads/) | This project uses Python 3.9 but should work on Python 3.6+. |
24+
|[pip](https://pip.pypa.io/en/stable/installing/) | I use Pip for pacakage management and pin versions. I don't think anything more complex than that is necessary. Adjust for your flow. |
25+
|[virtualenv](https://virtualenv.pypa.io/en/stable/installation.html) | Again I am not trying to get fancy. ```py -m pip install virtualenv```|
26+
|[FastAPI](https://github.com/tiangolo/fastapi) | I usally install all related packages in my venv. ```pip install fastapi[all]``` |
27+
|[Docker](https://www.docker.com/products/docker-desktop) | (Optional) I use it to startup DBs instead of installing directly. Will make your life easier. There are also images for bundled FastAPI environmets on Docker Hub.
28+
|[ODMantic](https://art049.github.io/odmantic/) | ORM for MongoDB with great model and document support. |
29+
|[TortoiseORM](https://tortoise-orm.readthedocs.io/en/latest/) | (Optional) ASYNC ORM that works well with FastAPI and Postgres/MySQL
30+
31+
32+
## Setup virtual environment (Windows)
33+
34+
https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/
35+
36+
1. Make sure venv is installed globally
37+
```bash
38+
py -m pip install --user virtualenv
39+
```
40+
2. cd into workspace
41+
3. Create virtual environment
42+
```bash
43+
py -m venv env
44+
```
45+
4. Activate virtual environment
46+
```bash
47+
.\env\Scripts\activate
48+
```
49+
5. Install pip dependencies
50+
```bash
51+
pip install -r requirements.txt
52+
```
53+
6. Now you can run the ```__main__.py``` script from a virtual context ```python lib```
54+
7. To get out of venv
55+
```bash
56+
deactivate
57+
```

app/__init__.py

Whitespace-only changes.

app/config/__init__.py

Whitespace-only changes.

app/config/config.py

Whitespace-only changes.

app/data/__init__.py

Whitespace-only changes.

app/data/data.py

Whitespace-only changes.

app/data/models/__init__.py

Whitespace-only changes.

app/data/models/models.py

Whitespace-only changes.

app/main.py

Whitespace-only changes.

0 commit comments

Comments
 (0)