You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ellar is a lightweight ASGI framework for building efficient and scalable server-side python applications.
16
16
It supports both OOP (Object-Oriented Programming) and FP (Functional Programming)
@@ -19,7 +19,7 @@ Ellar is based on [Starlette (ASGI toolkit)](https://www.starlette.io/), a light
19
19
While Ellar provides a high level of abstraction on top of Starlette, it still incorporates some of its features, as well as those of FastAPI.
20
20
If you are familiar with these frameworks, you will find it easy to understand and use Ellar.
21
21
22
-
## Features Summary
22
+
## **Features Summary**
23
23
24
24
-**Easy to Use**: Ellar has a simple and intuitive API that makes it easy to get started with building a fast and scalable web applications or web APIs in Python.
25
25
-**Dependency Injection (DI)**: It comes with DI system makes it easy to manage dependencies and reduce coupling between components.
@@ -31,13 +31,13 @@ If you are familiar with these frameworks, you will find it easy to understand a
31
31
-**Modularity**: Ellar follows a modular architecture inspired by NestJS, making it easy to organize your code into reusable modules.
32
32
-**Asynchronous programming**: It allows you to takes advantage of Python's `async/await` feature to write efficient and fast code that can handle large numbers of concurrent requests
33
33
34
-
## Dependencies
34
+
## **Dependencies**
35
35
- Python >= 3.7
36
36
- Starlette
37
37
- Injector
38
38
- Pydantic
39
39
40
-
## Installation
40
+
## **Installation**
41
41
### Poetry Installation
42
42
For [Poetry](https://python-poetry.org/) usages
43
43
@@ -51,11 +51,10 @@ For normal pip installation
51
51
pip install ellar-cli
52
52
```
53
53
54
-
## Create a project
54
+
## Creating a project
55
55
To create an ellar project, you need to have a `pyproject.toml` available on your root directory.
56
56
This is necessary for ellar to store some `metadata` about your project.
57
57
58
-
### Create a project
59
58
For Pip Users, you need to create `pyproject.toml` file
60
59
```shell
61
60
ellar new carsite
@@ -66,7 +65,7 @@ run the ellar create project cli command,
66
65
ellar create-project carsite
67
66
```
68
67
69
-
## Run your project
68
+
## **Run your project**
70
69
Ellar runs [UVICORN - ASGI Server](https://www.uvicorn.org/) under the hood.
71
70
```shell
72
71
ellar runserver --reload
@@ -78,14 +77,14 @@ Now go to [http://127.0.0.1:8000](http://127.0.0.1:8000)
78
77
79
78
For more info on Ellar CLI, click [here](https://github.com/eadwinCode/ellar-cli)
80
79
81
-
## Create a project module
80
+
## **Adding a project module**
82
81
A project module is a project app defining a group of controllers or services including templates and static files.
83
82
So, now we have a project created, lets add an app to the project.
84
83
```shell
85
84
ellar create-module car
86
85
```
87
86
88
-
## Add Schema
87
+
## **Add Schema**
89
88
In `car/schema.py`, lets add some serializer for car input and output data
90
89
```python
91
90
from ellar.serializer import Serializer
@@ -100,7 +99,7 @@ class RetrieveCarSerializer(CarSerializer):
100
99
pk: str
101
100
```
102
101
103
-
## Add Services
102
+
## **Add Services**
104
103
In `car/services.py`, lets create a dummy repository `CarDummyDB` to manage our car data.
105
104
```python
106
105
import typing as t
@@ -153,7 +152,7 @@ class CarDummyDB:
153
152
if idx >=0:
154
153
returnself._data.pop(idx)
155
154
```
156
-
## Add Controller
155
+
## **Add Controller**
157
156
In `car/controllers.py`, lets create `CarController`
158
157
159
158
```python
@@ -201,7 +200,7 @@ class CarController(ControllerBase):
201
200
returnself.car_db.list()
202
201
203
202
```
204
-
## Register Service and Controller
203
+
## **Register Service and Controller**
205
204
In `car/module.py`, lets register `CarController` and `CarDummyDB`
206
205
207
206
```python
@@ -225,7 +224,7 @@ class CarModule(ModuleBase):
225
224
pass
226
225
```
227
226
228
-
## Registering Module
227
+
## **Registering Module**
229
228
Ellar is not aware of `CarModule` yet, so we need to add it to the `modules` list of `ApplicationModule` at the `carsite/root_module.py`.
230
229
```python
231
230
from ellar.common import Module, exception_handler
@@ -243,7 +242,7 @@ class ApplicationModule(ModuleBase):
243
242
return JSONResponse(dict(detail="Resource not found."))
244
243
245
244
```
246
-
## Enabling OpenAPI Docs
245
+
## **Enabling OpenAPI Docs**
247
246
To start up openapi, we need to go back to project folder in the `server.py`
248
247
then add the following below.
249
248
```python
@@ -280,7 +279,7 @@ Now we can test our API at [http://127.0.0.1:8000/docs](http://127.0.0.1:8000/do
280
279
Please ensure your server is running
281
280

282
281
283
-
## HTML Templating
282
+
## **HTML Templating**
284
283
Ellar has built-in support for Jinja2, which is a popular template engine for HTML. This feature allows for easy and efficient HTML templating similar to that of Flask. Jinja2 can be used to create reusable templates, and to insert dynamic data into HTML pages. It also has support for template inheritance, control structures, and other useful features that can help to simplify and streamline the process of creating HTML templates.
Ellar is a lightweight ASGI framework for building efficient and scalable server-side python applications.
16
16
It supports both OOP (Object-Oriented Programming) and FP (Functional Programming)
17
17
18
18
Ellar is based on [Starlette (ASGI toolkit)](https://www.starlette.io/), a lightweight ASGI framework/toolkit well-suited for developing asynchronous web services in Python.
19
19
And while Ellar provides a high level of abstraction on top of Starlette, it still incorporates some of its features, as well as those of FastAPI.
20
20
If you are familiar with these frameworks, you will find it easy to understand and use Ellar.
21
21
22
-
## Inspiration
22
+
## **Inspiration**
23
23
Ellar was deeply influenced by [NestJS](https://docs.nestjs.com/) for its ease of use and ability to handle complex project structures and applications.
24
24
Additionally, it took some concepts from [FastAPI](https://fastapi.tiangolo.com/) in terms of request parameter handling and data serialization with Pydantic.
25
25
26
26
With that said, the objective of Ellar is to offer a high level of abstraction in its framework APIs, along with a well-structured project setup, an object-oriented approach to web application design,
27
27
the ability to adapt to any desired software architecture, and ultimately, speedy request handling.
28
28
29
29
30
-
## Features Summary
30
+
## **Features Summary**
31
31
32
32
-**Easy to Use**: Ellar has a simple and intuitive API that makes it easy to get started with building a fast and scalable web applications or web APIs with Python.
33
33
-**Dependency Injection (DI)**: It comes with DI system makes it easy to manage dependencies and reduce coupling between components.
@@ -39,7 +39,7 @@ the ability to adapt to any desired software architecture, and ultimately, speed
39
39
-**Modularity**: Ellar follows a modular architecture inspired by NestJS, making it easy to organize your code into reusable modules.
40
40
-**Asynchronous programming**: It allows you to takes advantage of Python's `async/await` feature to write efficient and fast code that can handle large numbers of concurrent requests
41
41
42
-
## Installation
42
+
## **Installation**
43
43
To get started, you need to scaffold a project using [Ellar-CLI](https://eadwincode.github.io/ellar-cli/) toolkit. This is recommended for a first-time user.
44
44
The scaffolded project is more like a guide to project setup.
0 commit comments