Skip to content

Commit

Permalink
docs: improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineRR committed Feb 19, 2023
1 parent 5f437d1 commit c80ba80
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 127 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Let's walk through the steps to create an issue:
**4.** Select one of the Issue Templates to get started.
<br><br><img src="https://i.imgur.com/xz2KAwU.png" width="750" /><br>

**4.** Fill in the appropriate `Title` and `Issue description` and click on `Submit new issue`.
**5.** Fill in the appropriate `Title` and `Issue description` and click on `Submit new issue`.
<br><br><img src="https://i.imgur.com/XwjtGG1.png" width="750" /><br>

### Tutorials that may help you:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"
description = "A web server that is fast!"
license = "BSD License (BSD)"
homepage = "https://github.com/sansyrox/robyn"
readme = "README.md"
readme = "docs/README.md"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
Expand Down
82 changes: 48 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@
# Robyn

[![Twitter](https://badgen.net/badge/icon/twitter?icon=twitter&label)](https://twitter.com/robyn_oss)
[![Gitter](https://badges.gitter.im/robyn_/community.svg)](https://gitter.im/robyn_/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Downloads](https://static.pepy.tech/personalized-badge/robyn?period=total&units=international_system&left_color=grey&right_color=blue&left_text=Downloads)](https://pepy.tech/project/robyn)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![GitHub tag](https://img.shields.io/github/tag/sansyrox/robyn?include_prereleases=&sort=semver&color=black)](https://github.com/sansyrox/robyn/releases/)
[![License](https://img.shields.io/badge/License-BSD_2.0-black)](#license)
![Python](https://img.shields.io/badge/Support-Version%20%E2%89%A5%203.7-brightgreen)
[![Discord](https://img.shields.io/discord/999782964143603713?label=discord&logo=discord&logoColor=white&style=for-the-badge&color=blue)](https://discord.gg/rkERZ5eNU8)

[![view - Documentation](https://img.shields.io/badge/view-Documentation-blue?style=for-the-badge)](https://sansyrox.github.io/robyn/#/)
[![Discord](https://img.shields.io/discord/999782964143603713?label=discord&logo=discord&logoColor=white&style=for-the-badge&color=blue)](https://discord.gg/rkERZ5eNU8)

Robyn is a fast async Python web server with a runtime written in Rust.

Check out the talk at **PyCon Sweden 2021** about [Robyn: An async python web framework with a Rust runtime](https://www.youtube.com/watch?v=DK9teAs72Do)
Robyn is a fast async Python web framework coupled with a web server written in Rust. You can learn more by checking our [community resources](https://sansyrox.github.io/robyn/#/community-resources)!

## 📦 Installation

Expand All @@ -33,6 +29,10 @@ conda install -c conda-forge robyn

## 🤔 Usage

### 🚀 Define your API

To define your API, you can add the following code in an `app.py` file.

```python
from robyn import Robyn

Expand All @@ -43,17 +43,40 @@ async def h(request):
return "Hello, world!"

app.start(port=8080)
```

### 🏃 Run your code

Simply run the app.py file you created. You will then have access to a server on the `localhost:8080`, that you can request from an other program. Robyn provides several options to customize your web server.

```
$ python3 app.py -h
usage: app.py [-h] [--processes PROCESSES] [--workers WORKERS] [--dev] [--log-level LOG_LEVEL]
Robyn, a fast async web framework with a rust runtime.
options:
-h, --help show this help message and exit
--processes PROCESSES Choose the number of processes. [Default: 1]
--workers WORKERS Choose the number of workers. [Default: 1]
--dev Development mode. It restarts the server based on file changes.
--log-level LOG_LEVEL Set the log level name
```

## Python Version Support
Log level can be `DEBUG`, `INFO`, `WARNING`, or `ERROR`.

### 💻 Add more routes

You can add more routes to your API. Check out the routes in [this file](https://github.com/sansyrox/robyn/blob/main/integration_tests/base_routes.py) as examples.

## 🐍 Python Version Support

Robyn is compatible with the following Python versions:

> Python >= 3.7
It is recommended to use the latest version of Python for the best performance
and compatibility
It is recommended to use the latest version of Python for the best performances.

Please make sure you have the correct version of Python installed before starting to use
this project. You can check your Python version by running the following command in your
Expand All @@ -79,44 +102,35 @@ python --version
- Hot Reloading
- Community First and truly FOSS!

## 🗒️ Contributor Guidelines
## 🗒️ How to contribute

Feel free to open an issue for any clarification or for any suggestions.
### 🏁 Get started

If you're feeling curious. You can take a look at a more detailed architecture [here](https://github.com/sansyrox/robyn/blob/main/docs/architecture.md).
Please read the [code of conduct](https://github.com/sansyrox/robyn/blob/main/CODE_OF_CONDUCT.md) and go through [CONTRIBUTING.md](https://github.com/sansyrox/robyn/blob/main/CONTRIBUTING.md) before contributing to Robyn.
Feel free to open an issue for any clarifications or suggestions.

## ⚙️ To Develop Locally
If you're feeling curious. You can take a look at a more detailed architecture [here](https://sansyrox.github.io/robyn/#/architecture).

1. Install the development dependencies: `pip install -r dev-requirements.txt`
If you still need help to get started, feel free to reach out on our [community discord](https://discord.gg/rkERZ5eNU8).

1. Install the pre-commit git hooks: `pre-commit install`
### ⚙️ To Develop Locally

1. Add more routes in the `integration_tests/base_routes.py` file (if you like).
1. Install the development dependencies (preferably inside a virtual environment): `pip install -r dev-requirements.txt`

1. Run `maturin develop` or `maturin develop --cargo-extra-args="--features=io-uring"` (if you want to run the experimental version).
2. Install the pre-commit git hooks: `pre-commit install`

1. Run `python3 integration_tests/base_routes.py`
3. Run `maturin develop` or `maturin develop --cargo-extra-args="--features=io-uring"` for using the experimental version of actix-web. This command will build the Robyn Rust package and install it in your virtual environment.

## 🏃 To Run
4. Run `python3 integration_tests/base_routes.py`. This file contains several examples of routes we use for testing purposes. You can modify or add some to your likings.

You can then request the server you ran from an other terminal. Here is a `GET` request done using [curl](https://curl.se/) for example:
```
python3 app.py -h
usage: app.py [-h] [--processes PROCESSES] [--workers WORKERS] [--dev DEV]
Robyn, a fast async web framework with a rust runtime.
optional arguments:
-h, --help show this help message and exit
--processes PROCESSES : allows you to choose the number of parallel processes
--workers WORKERS : allows you to choose the number of workers
--dev DEV : this flag gives the option to enable hot reloading or not and also sets the default log level to debug
--log-level LEVEL : this flag allows you to set the log level
curl http://localhost:8080/sync/str
```

## Contributors/Supporters
## Special thanks

To contribute to Robyn, make sure to first go through the [CONTRIBUTING.md](./CONTRIBUTING.md).
### ✨ Contributors/Supporters

Thanks to all the contributors of the project. Robyn will not be what it is without all your support :heart:.

Expand All @@ -126,7 +140,7 @@ Thanks to all the contributors of the project. Robyn will not be what it is with

Special thanks to the [PyO3](https://pyo3.rs/v0.13.2/) community and [Andrew from PyO3-asyncio](https://github.com/awestlake87/pyo3-asyncio) for their amazing libraries and their support for my queries. 💖

## ✨ Sponsors
### ✨ Sponsors

These sponsors help us make the magic happen!

Expand Down
101 changes: 10 additions & 91 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,101 +1,20 @@
<img alt="Robyn Logo" src="https://user-images.githubusercontent.com/29942790/140995889-5d91dcff-3aa7-4cfb-8a90-2cddf1337dca.png" width="250" />

# Robyn
# Robyn's documentation

[![Twitter](https://badgen.net/badge/icon/twitter?icon=twitter&label)](https://twitter.com/robyn_oss)
[![Gitter](https://badges.gitter.im/robyn_/community.svg)](https://gitter.im/robyn_/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Downloads](https://static.pepy.tech/personalized-badge/robyn?period=total&units=international_system&left_color=grey&right_color=blue&left_text=Downloads)](https://pepy.tech/project/robyn)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![GitHub tag](https://img.shields.io/github/tag/sansyrox/robyn?include_prereleases=&sort=semver&color=black)](https://github.com/sansyrox/robyn/releases/)
[![License](https://img.shields.io/badge/License-BSD_2.0-black)](#license)
[![Discord](https://img.shields.io/discord/999782964143603713?label=discord&logo=discord&logoColor=white&style=for-the-badge&color=blue)](https://discord.gg/qKF5sSnC)
## 🔎 Overview

[![view - Documentation](https://img.shields.io/badge/view-Documentation-blue?style=for-the-badge)](https://sansyrox.github.io/robyn/#/)
Welcome to Robyn's documentation!

Robyn is an async Python backend server with a runtime written in Rust, btw.
Robyn is a Python web framework coupled with an async server implementation written in Rust. You can find the source code on [Github](https://github.com/sansyrox/robyn), contributions are very welcome!

## 📦 Installation
On this website, you will find more information on how to use Robyn.

You can simply use Pip for installation.
If you do not find what you were looking for here or have some suggestions to improve the docs, feel free to open an issue on the [Github repo](https://github.com/sansyrox/robyn), or ask for help on the official [Discord server](https://discord.gg/rkERZ5eNU8).

```
pip install robyn
```
## ✨ Special thanks

Or, with [conda-forge](https://conda-forge.org/)

```
conda install -c conda-forge robyn
```

## 🤔 Usage

```python
from robyn import Robyn

app = Robyn(__file__)


@app.get("/")
async def h(request):
return "Hello, world!"

app.start(port=8080)
```

## 💡 Features

- Under active development!
- Written in Rust, btw xD
- A multithreaded Runtime
- Extensible
- A simple API
- Sync and Async Function Support
- Dynamic URL Routing
- Multi Core Scaling
- WebSockets!
- Middlewares
- Hot Reloading
- Community First and truly FOSS!

## 🗒️ Contributor Guidelines

Feel free to open an issue for any clarification or for any suggestions.

If you're feeling curious. You can take a look at a more detailed architecture [here](https://github.com/sansyrox/robyn/blob/main/docs/architecture.md).

## ⚙️ To Develop Locally

1. Install the development dependencies: `pip install -r dev-requirements.txt`

1. Install the pre-commit git hooks: `pre-commit install`

1. Add more routes in the `integration_tests/base_routes.py` file(if you like).

1. Run `maturin develop` or `maturin develop --cargo-extra-args="--features=io-uring"` (if you want to run the experimental version).

1. Run `python3 integration_tests/base_routes.py`

## 🏃 To Run

```
python3 app.py -h
usage: app.py [-h] [--processes PROCESSES] [--workers WORKERS] [--dev DEV]
Robyn, a fast async web framework with a rust runtime.
optional arguments:
-h, --help show this help message and exit
--processes PROCESSES : allows you to choose the number of parallel processes
--workers WORKERS : allows you to choose the number of workers
--dev DEV : this flag gives the option to enable hot reloading or not and also sets the default log level to debug
--log-level LEVEL : this flag allows you to set the log level
```

## ✨ Contributors/Supporters

To contribute to Robyn, make sure to first go through the [CONTRIBUTING.md](https://github.com/sansyrox/robyn/blob/main/CONTRIBUTING.md).
### ✨ Contributors/Supporters

Thanks to all the contributors of the project. Robyn will not be what it is without all your support :heart:.

Expand All @@ -105,11 +24,11 @@ Thanks to all the contributors of the project. Robyn will not be what it is with

Special thanks to the [PyO3](https://pyo3.rs/v0.13.2/) community and [Andrew from PyO3-asyncio](https://github.com/awestlake87/pyo3-asyncio) for their amazing libraries and their support for my queries. 💖

## ✨ Sponsors
### ✨ Sponsors

These sponsors help us make the magic happen!

[![DigitalOcean Referral Badge](https://web-platforms.sfo2.cdn.digitaloceanspaces.com/WWW/Badge%201.svg)](https://www.digitalocean.com/?refcode=3f2b9fd4968d&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge)
[![Appwrite Logo](https://avatars.githubusercontent.com/u/25003669?s=105&v=1)](https://github.com/appwrite)

- [Shivay Lamba](https://github.com/shivaylamba)
- [Shivay Lamba](https://github.com/shivaylamba)
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0"
/>
<link rel="icon" href="https://user-images.githubusercontent.com/29942790/140995889-5d91dcff-3aa7-4cfb-8a90-2cddf1337dca.png" />
<link
rel="stylesheet"
href="//cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/dist/style.min.css"
Expand Down

0 comments on commit c80ba80

Please sign in to comment.