fastapi-initializer 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
11
+
12
+ # Environment variables
13
+ .env
.python-version ADDED
@@ -0,0 +1 @@
1
+ 3.13
LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dasun Nethsara
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
PKG-INFO ADDED
@@ -0,0 +1,225 @@
1
+ Metadata-Version: 2.4
2
+ Name: fastapi-initializer
3
+ Version: 1.0.0
4
+ Summary: An interactive CLI tool that scaffolds production-ready FastAPI projects with sensible defaults.
5
+ Project-URL: Homepage, https://github.com/DasunNethsara-04/fastapi-initializer
6
+ Project-URL: Repository, https://github.com/DasunNethsara-04/fastapi-initializer
7
+ Project-URL: Issues, https://github.com/DasunNethsara-04/fastapi-initializer/issues
8
+ Author-email: Dasun Nethsara <dasunnethsara04@gmail.com>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: boilerplate,cli,fastapi,initializer,project-generator,scaffold,template
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Framework :: FastAPI
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Software Development :: Code Generators
24
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
25
+ Classifier: Typing :: Typed
26
+ Requires-Python: >=3.10
27
+ Requires-Dist: inquirerpy>=0.3.4
28
+ Requires-Dist: typer>=0.9.0
29
+ Description-Content-Type: text/markdown
30
+
31
+ # FastAPI Initializer
32
+
33
+ [![PyPI version](https://img.shields.io/pypi/v/fastapi-initializer.svg)](https://pypi.org/project/fastapi-initializer/)
34
+ [![Python](https://img.shields.io/pypi/pyversions/fastapi-initializer.svg)](https://pypi.org/project/fastapi-initializer/)
35
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
36
+
37
+ An interactive CLI tool that scaffolds **production-ready FastAPI projects** with sensible defaults โ€” so you can skip the boilerplate and start building right away.
38
+
39
+ ![fastapi-init demo](https://raw.githubusercontent.com/DasunNethsara-04/fastapi-initializer/main/assets/demo.gif)
40
+
41
+ ---
42
+
43
+ ## โœจ What Does It Do?
44
+
45
+ Run a single command, answer a few prompts, and get a fully structured FastAPI project with:
46
+
47
+ - ๐Ÿ—‚๏ธ **Clean project layout** - `api/`, `core/`, `models/`, `schemas/`, `services/`
48
+ - ๐Ÿ—ƒ๏ธ **Database support** - SQLite, MySQL, or PostgreSQL
49
+ - ๐Ÿ”ง **ORM of your choice** - SQLAlchemy or SQLModel
50
+ - ๐Ÿงช **Testing setup** - pytest / pytest-asyncio with httpx, ready to go
51
+ - ๐Ÿงน **Linter config** - Black or Ruff
52
+ - ๐Ÿณ **Docker ready** - optional `Dockerfile` & `docker-compose.yml`
53
+ - โš™๏ธ **Environment config** - pydantic-settings with `.env` support
54
+ - ๐Ÿ“– **Documentation** - every folder gets a README explaining its purpose
55
+
56
+ ---
57
+
58
+ ## ๐Ÿ“ฆ Installation
59
+
60
+ ### Install from PyPI
61
+
62
+ ```bash
63
+ pip install fastapi-initializer
64
+ ```
65
+
66
+ Or with [uv](https://docs.astral.sh/uv/):
67
+
68
+ ```bash
69
+ uv pip install fastapi-initializer
70
+ ```
71
+
72
+ ### Install from Source (for development)
73
+
74
+ ```bash
75
+ # Clone the repository
76
+ git clone https://github.com/DasunNethsara-04/fastapi-initializer.git
77
+ cd fastapi-initializer
78
+
79
+ # Create a virtual environment and install dependencies
80
+ uv sync
81
+
82
+ # Run the CLI directly
83
+ uv run fastapi-init my-project
84
+ ```
85
+
86
+ ---
87
+
88
+ ## ๐Ÿš€ Usage
89
+
90
+ ```bash
91
+ fastapi-init my-project
92
+ ```
93
+
94
+ You'll be guided through interactive prompts:
95
+
96
+ ```
97
+ โฏ FastAPI Initializer
98
+ Creating project: my-project
99
+
100
+ โฏ What kind of database do you want to use?
101
+ > SQLite / MySQL / PostgreSQL / None
102
+
103
+ โฏ Which ORM do you want to use?
104
+ > SQLAlchemy / SQLModel / None
105
+
106
+ โฏ What linter do you want to use?
107
+ > Ruff / Black / None
108
+
109
+ โฏ What testing framework do you like to use?
110
+ > PyTest / pytest-async-io / None
111
+
112
+ โฏ Do you want to create a Docker file for this project?
113
+ > Yes / No
114
+
115
+ โœ” FastAPI project 'my-project' created successfully!
116
+ ```
117
+
118
+ Then get started in seconds:
119
+
120
+ ```bash
121
+ cd my-project
122
+ uv sync
123
+ uv run uvicorn app.main:app --reload
124
+ ```
125
+
126
+ Open **http://127.0.0.1:8000/docs** to see the interactive API docs.
127
+
128
+ ---
129
+
130
+ ## ๐Ÿ“ Generated Project Structure
131
+
132
+ The generated project follows a modular, production-style layout:
133
+
134
+ ```
135
+ my-project/
136
+ โ”œโ”€โ”€ app/
137
+ โ”‚ โ”œโ”€โ”€ api/
138
+ โ”‚ โ”‚ โ”œโ”€โ”€ v1/
139
+ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ users.py # User endpoints
140
+ โ”‚ โ”‚ โ”œโ”€โ”€ __init__.py # Mounts versioned routers
141
+ โ”‚ โ”‚ โ””โ”€โ”€ deps.py # Shared dependencies (e.g. auth)
142
+ โ”‚ โ”œโ”€โ”€ core/
143
+ โ”‚ โ”‚ โ”œโ”€โ”€ config.py # App settings via pydantic-settings
144
+ โ”‚ โ”‚ โ””โ”€โ”€ security.py # OAuth2 / auth utilities
145
+ โ”‚ โ”œโ”€โ”€ models/
146
+ โ”‚ โ”‚ โ””โ”€โ”€ user.py # ORM model (SQLAlchemy / SQLModel)
147
+ โ”‚ โ”œโ”€โ”€ schemas/
148
+ โ”‚ โ”‚ โ””โ”€โ”€ user.py # Pydantic request / response models
149
+ โ”‚ โ”œโ”€โ”€ services/
150
+ โ”‚ โ”‚ โ””โ”€โ”€ user_service.py # Business logic layer
151
+ โ”‚ โ”œโ”€โ”€ db/
152
+ โ”‚ โ”‚ โ”œโ”€โ”€ base.py # ORM Base class
153
+ โ”‚ โ”‚ โ””โ”€โ”€ session.py # Engine & get_session() dependency
154
+ โ”‚ โ””โ”€โ”€ main.py # FastAPI app entry-point
155
+ โ”œโ”€โ”€ tests/
156
+ โ”‚ โ””โ”€โ”€ test_users.py # Smoke test with httpx
157
+ โ”œโ”€โ”€ .env # Environment variables
158
+ โ”œโ”€โ”€ .gitignore
159
+ โ”œโ”€โ”€ pyproject.toml
160
+ โ”œโ”€โ”€ Dockerfile # (optional)
161
+ โ”œโ”€โ”€ docker-compose.yml # (optional)
162
+ โ””โ”€โ”€ README.md # Auto-generated project docs
163
+ ```
164
+
165
+ > **Note:** Folders like `models/`, `db/`, `tests/`, and Docker files are only generated when you select the corresponding options.
166
+
167
+ ### What Each Folder Does
168
+
169
+ | Folder | Purpose |
170
+ |--------|---------|
171
+ | `app/api/` | HTTP route definitions, versioned (`v1/`, `v2/`, โ€ฆ). |
172
+ | `app/core/` | App-wide settings (`Settings` class) and security helpers. |
173
+ | `app/models/` | ORM model classes mapped to database tables. |
174
+ | `app/schemas/` | Pydantic models for request validation and response serialisation. |
175
+ | `app/services/` | Business-logic layer โ€” keeps route handlers thin and testable. |
176
+ | `app/db/` | Database engine, session factory, and `get_session()` dependency. |
177
+ | `tests/` | Automated test suite using pytest + httpx. |
178
+
179
+ ---
180
+
181
+ ## ๐Ÿ› ๏ธ Configuration Options
182
+
183
+ | Prompt | Choices | What It Generates |
184
+ |--------|---------|-------------------|
185
+ | **Database** | SQLite, MySQL, PostgreSQL, None | `app/db/session.py` with connection URL and driver dependency |
186
+ | **ORM** | SQLAlchemy, SQLModel, None | `app/models/` with model classes and `app/db/base.py` |
187
+ | **Linter** | Ruff, Black, None | Adds the linter to `pyproject.toml` dependencies |
188
+ | **Test framework** | pytest, pytest-asyncio, None | `tests/` directory with async smoke test |
189
+ | **Docker** | Yes, No | `Dockerfile`, `docker-compose.yml`, `.dockerignore` |
190
+
191
+ ---
192
+
193
+ ## ๐Ÿค Contributing
194
+
195
+ Contributions are welcome! Here's how to get started:
196
+
197
+ ```bash
198
+ # 1. Fork and clone
199
+ git clone https://github.com/DasunNethsara-04/fastapi-initializer.git
200
+ cd fastapi-initializer
201
+
202
+ # 2. Install dependencies
203
+ uv sync
204
+
205
+ # 3. Make your changes, then test
206
+ uv run fastapi-init test-project
207
+
208
+ # 4. Submit a pull request
209
+ ```
210
+
211
+ ---
212
+
213
+ ## ๐Ÿ“„ License
214
+
215
+ This project is licensed under the [MIT License](LICENSE).
216
+
217
+ ---
218
+
219
+ ## ๐Ÿ™ Acknowledgements
220
+
221
+ Built with:
222
+
223
+ - [FastAPI](https://fastapi.tiangolo.com/) โ€” the framework this tool scaffolds
224
+ - [Typer](https://typer.tiangolo.com/) โ€” CLI framework
225
+ - [InquirerPy](https://inquirerpy.readthedocs.io/) โ€” interactive prompts
README.md ADDED
@@ -0,0 +1,195 @@
1
+ # FastAPI Initializer
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/fastapi-initializer.svg)](https://pypi.org/project/fastapi-initializer/)
4
+ [![Python](https://img.shields.io/pypi/pyversions/fastapi-initializer.svg)](https://pypi.org/project/fastapi-initializer/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+
7
+ An interactive CLI tool that scaffolds **production-ready FastAPI projects** with sensible defaults โ€” so you can skip the boilerplate and start building right away.
8
+
9
+ ![fastapi-init demo](https://raw.githubusercontent.com/DasunNethsara-04/fastapi-initializer/main/assets/demo.gif)
10
+
11
+ ---
12
+
13
+ ## โœจ What Does It Do?
14
+
15
+ Run a single command, answer a few prompts, and get a fully structured FastAPI project with:
16
+
17
+ - ๐Ÿ—‚๏ธ **Clean project layout** - `api/`, `core/`, `models/`, `schemas/`, `services/`
18
+ - ๐Ÿ—ƒ๏ธ **Database support** - SQLite, MySQL, or PostgreSQL
19
+ - ๐Ÿ”ง **ORM of your choice** - SQLAlchemy or SQLModel
20
+ - ๐Ÿงช **Testing setup** - pytest / pytest-asyncio with httpx, ready to go
21
+ - ๐Ÿงน **Linter config** - Black or Ruff
22
+ - ๐Ÿณ **Docker ready** - optional `Dockerfile` & `docker-compose.yml`
23
+ - โš™๏ธ **Environment config** - pydantic-settings with `.env` support
24
+ - ๐Ÿ“– **Documentation** - every folder gets a README explaining its purpose
25
+
26
+ ---
27
+
28
+ ## ๐Ÿ“ฆ Installation
29
+
30
+ ### Install from PyPI
31
+
32
+ ```bash
33
+ pip install fastapi-initializer
34
+ ```
35
+
36
+ Or with [uv](https://docs.astral.sh/uv/):
37
+
38
+ ```bash
39
+ uv pip install fastapi-initializer
40
+ ```
41
+
42
+ ### Install from Source (for development)
43
+
44
+ ```bash
45
+ # Clone the repository
46
+ git clone https://github.com/DasunNethsara-04/fastapi-initializer.git
47
+ cd fastapi-initializer
48
+
49
+ # Create a virtual environment and install dependencies
50
+ uv sync
51
+
52
+ # Run the CLI directly
53
+ uv run fastapi-init my-project
54
+ ```
55
+
56
+ ---
57
+
58
+ ## ๐Ÿš€ Usage
59
+
60
+ ```bash
61
+ fastapi-init my-project
62
+ ```
63
+
64
+ You'll be guided through interactive prompts:
65
+
66
+ ```
67
+ โฏ FastAPI Initializer
68
+ Creating project: my-project
69
+
70
+ โฏ What kind of database do you want to use?
71
+ > SQLite / MySQL / PostgreSQL / None
72
+
73
+ โฏ Which ORM do you want to use?
74
+ > SQLAlchemy / SQLModel / None
75
+
76
+ โฏ What linter do you want to use?
77
+ > Ruff / Black / None
78
+
79
+ โฏ What testing framework do you like to use?
80
+ > PyTest / pytest-async-io / None
81
+
82
+ โฏ Do you want to create a Docker file for this project?
83
+ > Yes / No
84
+
85
+ โœ” FastAPI project 'my-project' created successfully!
86
+ ```
87
+
88
+ Then get started in seconds:
89
+
90
+ ```bash
91
+ cd my-project
92
+ uv sync
93
+ uv run uvicorn app.main:app --reload
94
+ ```
95
+
96
+ Open **http://127.0.0.1:8000/docs** to see the interactive API docs.
97
+
98
+ ---
99
+
100
+ ## ๐Ÿ“ Generated Project Structure
101
+
102
+ The generated project follows a modular, production-style layout:
103
+
104
+ ```
105
+ my-project/
106
+ โ”œโ”€โ”€ app/
107
+ โ”‚ โ”œโ”€โ”€ api/
108
+ โ”‚ โ”‚ โ”œโ”€โ”€ v1/
109
+ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ users.py # User endpoints
110
+ โ”‚ โ”‚ โ”œโ”€โ”€ __init__.py # Mounts versioned routers
111
+ โ”‚ โ”‚ โ””โ”€โ”€ deps.py # Shared dependencies (e.g. auth)
112
+ โ”‚ โ”œโ”€โ”€ core/
113
+ โ”‚ โ”‚ โ”œโ”€โ”€ config.py # App settings via pydantic-settings
114
+ โ”‚ โ”‚ โ””โ”€โ”€ security.py # OAuth2 / auth utilities
115
+ โ”‚ โ”œโ”€โ”€ models/
116
+ โ”‚ โ”‚ โ””โ”€โ”€ user.py # ORM model (SQLAlchemy / SQLModel)
117
+ โ”‚ โ”œโ”€โ”€ schemas/
118
+ โ”‚ โ”‚ โ””โ”€โ”€ user.py # Pydantic request / response models
119
+ โ”‚ โ”œโ”€โ”€ services/
120
+ โ”‚ โ”‚ โ””โ”€โ”€ user_service.py # Business logic layer
121
+ โ”‚ โ”œโ”€โ”€ db/
122
+ โ”‚ โ”‚ โ”œโ”€โ”€ base.py # ORM Base class
123
+ โ”‚ โ”‚ โ””โ”€โ”€ session.py # Engine & get_session() dependency
124
+ โ”‚ โ””โ”€โ”€ main.py # FastAPI app entry-point
125
+ โ”œโ”€โ”€ tests/
126
+ โ”‚ โ””โ”€โ”€ test_users.py # Smoke test with httpx
127
+ โ”œโ”€โ”€ .env # Environment variables
128
+ โ”œโ”€โ”€ .gitignore
129
+ โ”œโ”€โ”€ pyproject.toml
130
+ โ”œโ”€โ”€ Dockerfile # (optional)
131
+ โ”œโ”€โ”€ docker-compose.yml # (optional)
132
+ โ””โ”€โ”€ README.md # Auto-generated project docs
133
+ ```
134
+
135
+ > **Note:** Folders like `models/`, `db/`, `tests/`, and Docker files are only generated when you select the corresponding options.
136
+
137
+ ### What Each Folder Does
138
+
139
+ | Folder | Purpose |
140
+ |--------|---------|
141
+ | `app/api/` | HTTP route definitions, versioned (`v1/`, `v2/`, โ€ฆ). |
142
+ | `app/core/` | App-wide settings (`Settings` class) and security helpers. |
143
+ | `app/models/` | ORM model classes mapped to database tables. |
144
+ | `app/schemas/` | Pydantic models for request validation and response serialisation. |
145
+ | `app/services/` | Business-logic layer โ€” keeps route handlers thin and testable. |
146
+ | `app/db/` | Database engine, session factory, and `get_session()` dependency. |
147
+ | `tests/` | Automated test suite using pytest + httpx. |
148
+
149
+ ---
150
+
151
+ ## ๐Ÿ› ๏ธ Configuration Options
152
+
153
+ | Prompt | Choices | What It Generates |
154
+ |--------|---------|-------------------|
155
+ | **Database** | SQLite, MySQL, PostgreSQL, None | `app/db/session.py` with connection URL and driver dependency |
156
+ | **ORM** | SQLAlchemy, SQLModel, None | `app/models/` with model classes and `app/db/base.py` |
157
+ | **Linter** | Ruff, Black, None | Adds the linter to `pyproject.toml` dependencies |
158
+ | **Test framework** | pytest, pytest-asyncio, None | `tests/` directory with async smoke test |
159
+ | **Docker** | Yes, No | `Dockerfile`, `docker-compose.yml`, `.dockerignore` |
160
+
161
+ ---
162
+
163
+ ## ๐Ÿค Contributing
164
+
165
+ Contributions are welcome! Here's how to get started:
166
+
167
+ ```bash
168
+ # 1. Fork and clone
169
+ git clone https://github.com/DasunNethsara-04/fastapi-initializer.git
170
+ cd fastapi-initializer
171
+
172
+ # 2. Install dependencies
173
+ uv sync
174
+
175
+ # 3. Make your changes, then test
176
+ uv run fastapi-init test-project
177
+
178
+ # 4. Submit a pull request
179
+ ```
180
+
181
+ ---
182
+
183
+ ## ๐Ÿ“„ License
184
+
185
+ This project is licensed under the [MIT License](LICENSE).
186
+
187
+ ---
188
+
189
+ ## ๐Ÿ™ Acknowledgements
190
+
191
+ Built with:
192
+
193
+ - [FastAPI](https://fastapi.tiangolo.com/) โ€” the framework this tool scaffolds
194
+ - [Typer](https://typer.tiangolo.com/) โ€” CLI framework
195
+ - [InquirerPy](https://inquirerpy.readthedocs.io/) โ€” interactive prompts
@@ -0,0 +1,225 @@
1
+ Metadata-Version: 2.4
2
+ Name: fastapi-initializer
3
+ Version: 1.0.0
4
+ Summary: An interactive CLI tool that scaffolds production-ready FastAPI projects with sensible defaults.
5
+ Project-URL: Homepage, https://github.com/DasunNethsara-04/fastapi-initializer
6
+ Project-URL: Repository, https://github.com/DasunNethsara-04/fastapi-initializer
7
+ Project-URL: Issues, https://github.com/DasunNethsara-04/fastapi-initializer/issues
8
+ Author-email: Dasun Nethsara <dasunnethsara04@gmail.com>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: boilerplate,cli,fastapi,initializer,project-generator,scaffold,template
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Framework :: FastAPI
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Software Development :: Code Generators
24
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
25
+ Classifier: Typing :: Typed
26
+ Requires-Python: >=3.10
27
+ Requires-Dist: inquirerpy>=0.3.4
28
+ Requires-Dist: typer>=0.9.0
29
+ Description-Content-Type: text/markdown
30
+
31
+ # FastAPI Initializer
32
+
33
+ [![PyPI version](https://img.shields.io/pypi/v/fastapi-initializer.svg)](https://pypi.org/project/fastapi-initializer/)
34
+ [![Python](https://img.shields.io/pypi/pyversions/fastapi-initializer.svg)](https://pypi.org/project/fastapi-initializer/)
35
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
36
+
37
+ An interactive CLI tool that scaffolds **production-ready FastAPI projects** with sensible defaults โ€” so you can skip the boilerplate and start building right away.
38
+
39
+ ![fastapi-init demo](https://raw.githubusercontent.com/DasunNethsara-04/fastapi-initializer/main/assets/demo.gif)
40
+
41
+ ---
42
+
43
+ ## โœจ What Does It Do?
44
+
45
+ Run a single command, answer a few prompts, and get a fully structured FastAPI project with:
46
+
47
+ - ๐Ÿ—‚๏ธ **Clean project layout** - `api/`, `core/`, `models/`, `schemas/`, `services/`
48
+ - ๐Ÿ—ƒ๏ธ **Database support** - SQLite, MySQL, or PostgreSQL
49
+ - ๐Ÿ”ง **ORM of your choice** - SQLAlchemy or SQLModel
50
+ - ๐Ÿงช **Testing setup** - pytest / pytest-asyncio with httpx, ready to go
51
+ - ๐Ÿงน **Linter config** - Black or Ruff
52
+ - ๐Ÿณ **Docker ready** - optional `Dockerfile` & `docker-compose.yml`
53
+ - โš™๏ธ **Environment config** - pydantic-settings with `.env` support
54
+ - ๐Ÿ“– **Documentation** - every folder gets a README explaining its purpose
55
+
56
+ ---
57
+
58
+ ## ๐Ÿ“ฆ Installation
59
+
60
+ ### Install from PyPI
61
+
62
+ ```bash
63
+ pip install fastapi-initializer
64
+ ```
65
+
66
+ Or with [uv](https://docs.astral.sh/uv/):
67
+
68
+ ```bash
69
+ uv pip install fastapi-initializer
70
+ ```
71
+
72
+ ### Install from Source (for development)
73
+
74
+ ```bash
75
+ # Clone the repository
76
+ git clone https://github.com/DasunNethsara-04/fastapi-initializer.git
77
+ cd fastapi-initializer
78
+
79
+ # Create a virtual environment and install dependencies
80
+ uv sync
81
+
82
+ # Run the CLI directly
83
+ uv run fastapi-init my-project
84
+ ```
85
+
86
+ ---
87
+
88
+ ## ๐Ÿš€ Usage
89
+
90
+ ```bash
91
+ fastapi-init my-project
92
+ ```
93
+
94
+ You'll be guided through interactive prompts:
95
+
96
+ ```
97
+ โฏ FastAPI Initializer
98
+ Creating project: my-project
99
+
100
+ โฏ What kind of database do you want to use?
101
+ > SQLite / MySQL / PostgreSQL / None
102
+
103
+ โฏ Which ORM do you want to use?
104
+ > SQLAlchemy / SQLModel / None
105
+
106
+ โฏ What linter do you want to use?
107
+ > Ruff / Black / None
108
+
109
+ โฏ What testing framework do you like to use?
110
+ > PyTest / pytest-async-io / None
111
+
112
+ โฏ Do you want to create a Docker file for this project?
113
+ > Yes / No
114
+
115
+ โœ” FastAPI project 'my-project' created successfully!
116
+ ```
117
+
118
+ Then get started in seconds:
119
+
120
+ ```bash
121
+ cd my-project
122
+ uv sync
123
+ uv run uvicorn app.main:app --reload
124
+ ```
125
+
126
+ Open **http://127.0.0.1:8000/docs** to see the interactive API docs.
127
+
128
+ ---
129
+
130
+ ## ๐Ÿ“ Generated Project Structure
131
+
132
+ The generated project follows a modular, production-style layout:
133
+
134
+ ```
135
+ my-project/
136
+ โ”œโ”€โ”€ app/
137
+ โ”‚ โ”œโ”€โ”€ api/
138
+ โ”‚ โ”‚ โ”œโ”€โ”€ v1/
139
+ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ users.py # User endpoints
140
+ โ”‚ โ”‚ โ”œโ”€โ”€ __init__.py # Mounts versioned routers
141
+ โ”‚ โ”‚ โ””โ”€โ”€ deps.py # Shared dependencies (e.g. auth)
142
+ โ”‚ โ”œโ”€โ”€ core/
143
+ โ”‚ โ”‚ โ”œโ”€โ”€ config.py # App settings via pydantic-settings
144
+ โ”‚ โ”‚ โ””โ”€โ”€ security.py # OAuth2 / auth utilities
145
+ โ”‚ โ”œโ”€โ”€ models/
146
+ โ”‚ โ”‚ โ””โ”€โ”€ user.py # ORM model (SQLAlchemy / SQLModel)
147
+ โ”‚ โ”œโ”€โ”€ schemas/
148
+ โ”‚ โ”‚ โ””โ”€โ”€ user.py # Pydantic request / response models
149
+ โ”‚ โ”œโ”€โ”€ services/
150
+ โ”‚ โ”‚ โ””โ”€โ”€ user_service.py # Business logic layer
151
+ โ”‚ โ”œโ”€โ”€ db/
152
+ โ”‚ โ”‚ โ”œโ”€โ”€ base.py # ORM Base class
153
+ โ”‚ โ”‚ โ””โ”€โ”€ session.py # Engine & get_session() dependency
154
+ โ”‚ โ””โ”€โ”€ main.py # FastAPI app entry-point
155
+ โ”œโ”€โ”€ tests/
156
+ โ”‚ โ””โ”€โ”€ test_users.py # Smoke test with httpx
157
+ โ”œโ”€โ”€ .env # Environment variables
158
+ โ”œโ”€โ”€ .gitignore
159
+ โ”œโ”€โ”€ pyproject.toml
160
+ โ”œโ”€โ”€ Dockerfile # (optional)
161
+ โ”œโ”€โ”€ docker-compose.yml # (optional)
162
+ โ””โ”€โ”€ README.md # Auto-generated project docs
163
+ ```
164
+
165
+ > **Note:** Folders like `models/`, `db/`, `tests/`, and Docker files are only generated when you select the corresponding options.
166
+
167
+ ### What Each Folder Does
168
+
169
+ | Folder | Purpose |
170
+ |--------|---------|
171
+ | `app/api/` | HTTP route definitions, versioned (`v1/`, `v2/`, โ€ฆ). |
172
+ | `app/core/` | App-wide settings (`Settings` class) and security helpers. |
173
+ | `app/models/` | ORM model classes mapped to database tables. |
174
+ | `app/schemas/` | Pydantic models for request validation and response serialisation. |
175
+ | `app/services/` | Business-logic layer โ€” keeps route handlers thin and testable. |
176
+ | `app/db/` | Database engine, session factory, and `get_session()` dependency. |
177
+ | `tests/` | Automated test suite using pytest + httpx. |
178
+
179
+ ---
180
+
181
+ ## ๐Ÿ› ๏ธ Configuration Options
182
+
183
+ | Prompt | Choices | What It Generates |
184
+ |--------|---------|-------------------|
185
+ | **Database** | SQLite, MySQL, PostgreSQL, None | `app/db/session.py` with connection URL and driver dependency |
186
+ | **ORM** | SQLAlchemy, SQLModel, None | `app/models/` with model classes and `app/db/base.py` |
187
+ | **Linter** | Ruff, Black, None | Adds the linter to `pyproject.toml` dependencies |
188
+ | **Test framework** | pytest, pytest-asyncio, None | `tests/` directory with async smoke test |
189
+ | **Docker** | Yes, No | `Dockerfile`, `docker-compose.yml`, `.dockerignore` |
190
+
191
+ ---
192
+
193
+ ## ๐Ÿค Contributing
194
+
195
+ Contributions are welcome! Here's how to get started:
196
+
197
+ ```bash
198
+ # 1. Fork and clone
199
+ git clone https://github.com/DasunNethsara-04/fastapi-initializer.git
200
+ cd fastapi-initializer
201
+
202
+ # 2. Install dependencies
203
+ uv sync
204
+
205
+ # 3. Make your changes, then test
206
+ uv run fastapi-init test-project
207
+
208
+ # 4. Submit a pull request
209
+ ```
210
+
211
+ ---
212
+
213
+ ## ๐Ÿ“„ License
214
+
215
+ This project is licensed under the [MIT License](LICENSE).
216
+
217
+ ---
218
+
219
+ ## ๐Ÿ™ Acknowledgements
220
+
221
+ Built with:
222
+
223
+ - [FastAPI](https://fastapi.tiangolo.com/) โ€” the framework this tool scaffolds
224
+ - [Typer](https://typer.tiangolo.com/) โ€” CLI framework
225
+ - [InquirerPy](https://inquirerpy.readthedocs.io/) โ€” interactive prompts
@@ -0,0 +1,13 @@
1
+ ./.gitignore,sha256=Ki9Sgv2mfP77yJPceHxD4XCent49_gO72Dfum9t5Qrk,139
2
+ ./.python-version,sha256=Auc1s9_hwygz61ULf_j_oX9fK8P6HnuuYaj1o4g845g,5
3
+ ./LICENSE,sha256=wXHTrT5HOVlafx3sCIesRc58DDB5vSvkK6AwlUp0RD4,1092
4
+ ./PKG-INFO,sha256=ghsxeUxnl7oCbXcyrSdlcvs8XLAOiiuxI2TU2zjHYOE,7487
5
+ ./README.md,sha256=FHekip7jQQGv1EpMmDFq13rwrqtlpoUhcVvHusKeGYk,6294
6
+ ./main.py,sha256=l0Tup7jgItziebyHZpTPqAc6Uv8_RYrziSLmSrTOJvc,30145
7
+ ./pyproject.toml,sha256=OUE1JgVBsE7jUKBt5clxCmNIWZCNfjOGHpD3lW1111M,1553
8
+ ./uv.lock,sha256=Ws9D0zkaamUhOxvMuCFU8xQkrM3CNdCYvyyP_Cgx2rk,9849
9
+ fastapi_initializer-1.0.0.dist-info/METADATA,sha256=ghsxeUxnl7oCbXcyrSdlcvs8XLAOiiuxI2TU2zjHYOE,7487
10
+ fastapi_initializer-1.0.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
11
+ fastapi_initializer-1.0.0.dist-info/entry_points.txt,sha256=E0HcbnYfm1N2olV07V1DN2CE-Vpf8Gx8YUn0xS4_i8A,42
12
+ fastapi_initializer-1.0.0.dist-info/licenses/LICENSE,sha256=wXHTrT5HOVlafx3sCIesRc58DDB5vSvkK6AwlUp0RD4,1092
13
+ fastapi_initializer-1.0.0.dist-info/RECORD,,