Skip to content

Commit

Permalink
Merge pull request #211 from PufferBlow/main
Browse files Browse the repository at this point in the history
Merge `main` to `doc`
  • Loading branch information
ramsy0dev authored Jan 18, 2025
2 parents 7e6a22c + 48b124a commit 4c42cae
Show file tree
Hide file tree
Showing 54 changed files with 2,587 additions and 2,319 deletions.
28 changes: 28 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"commitType": "docs",
"commitConvention": "angular",
"contributors": [
{
"login": "ramsy0dev",
"name": "ramsy0dev",
"avatar_url": "https://avatars.githubusercontent.com/u/86024158?v=4",
"profile": "http://ramsy0dev.github.io",
"contributions": [
"code",
"maintenance",
"doc"
]
}
],
"contributorsPerLine": 7,
"skipCi": true,
"repoType": "github",
"repoHost": "https://github.com",
"projectName": "pufferblow",
"projectOwner": "PufferBlow"
}
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Global variables
ARG MEMCACHED_URL="https://www.memcached.org/files/memcached-1.6.29.tar.gz"
ARG MEMCACHED_TAR_FILE="memcached-1.6.29.tar.gz"
ARG MEMCACHED_FOLDER="memcached-1.6.29"

# Installing python 3.11
FROM python:3.11

RUN apt-get update -y \
&& apt-get upgrade -y

# Installing dependencies packages
RUN apt-get install libevent-dev -y # Needed by memcached


# Installing pufferblow
RUN pip install git+https://github.com/PufferBlow/pufferblow.git


WORKDIR "/home"

# Installing memcached
RUN wget https://www.memcached.org/files/memcached-1.6.29.tar.gz \
&& tar -zxvf memcached-1.6.29.tar.gz \
&& cd memcached-1.6.29 \
&& ./configure \
&& make \
&& make install \

45 changes: 43 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,43 @@
# PufferBlow-api
PufferBlow's official API
> **NOTE**: The project is still in development.
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->


# Introduction

The **pufferblow** is the official open-source server for **pufferblow**. Using it you can host your own server and create a community for you, your friends, and potentially others to join and spend wonderful times together. One of the key strengths of the **pufferblow** is its robust security measures. Being open-source and free to use, it ensures your privacy as it implements advanced encryption algorithms such as Blowfish and bcrypt for data hashing and encryption, making the **pufferblow** a secure choice for hosting your own server.
Unlike many other chat services that offer little control to the server owner, such as Discord and Guilded, **pufferblow** stands apart. With **pufferblow**, you have the ability to host your own server using **pufferblow** and customize it according to your preferences.

# Get Started

you get started on using pufferblow by following the instructions in the [documentation](https://pufferblow.github.io/pufferblow/)

## Contributors

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="http://ramsy0dev.github.io"><img src="https://avatars.githubusercontent.com/u/86024158?v=4?s=100" width="100px;" alt="ramsy0dev"/><br /><sub><b>ramsy0dev</b></sub></a><br /><a href="https://github.com/PufferBlow/pufferblow/commits?author=ramsy0dev" title="Code">💻</a> <a href="#maintenance-ramsy0dev" title="Maintenance">🚧</a> <a href="https://github.com/PufferBlow/pufferblow/commits?author=ramsy0dev" title="Documentation">📖</a></td>
</tr>
</tbody>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

# License

GPL-3.0
10 changes: 5 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'pufferblow-api'
copyright = '2024, ramsy0dev'
project = 'pufferblow'
copyright = '2025, ramsy0dev'
author = 'ramsy0dev'
release = '0.0.1-beta'

Expand All @@ -30,20 +30,20 @@
]
html_static_path = ['_static']

html_title = "pufferblow-api"
html_title = "pufferblow"
html_favicon = "_static/favicon.ico"
html_theme_options = {
"use_download_button": True, # Allow users to download the current page in different formats
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/PufferBlow/pufferblow-api",
"url": "https://github.com/PufferBlow/pufferblow",
"icon": "fa-brands fa-square-github",
"type": "fontawesome",
}
],
"icon_links_label": "Quick Links",
"repository_url": "https://github.com/PufferBlow/pufferblow-api",
"repository_url": "https://github.com/PufferBlow/pufferblow",
"repository_branch": "docs",
"path_to_docs": "./docs",
"use_repository_button": True,
Expand Down
95 changes: 75 additions & 20 deletions docs/get_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
Get started
===============

To get started on hosting your own `pufferblow <https://github.com/PufferBlow/pufferblow>`__ server, you will need to first setup a VPS (or you can try and host it on your local network using a spare laptop or even on your current machine), than you will need to setup `supabase <https://supabase.com>`__.
To get started on hosting your own `pufferblow <https://github.com/PufferBlow/pufferblow>`__ server, you will need the following:

* Linux VPS
* PostgreSQL

Setup a Linux VPS
=================
Expand All @@ -13,32 +16,84 @@ Numerous affordable VPS services are available, offering reliable Linux VPS solu
* `Oracle's Free tier <https://www.oracle.com/cloud/free>`_
* `Contabo <https://contabo.com/en/>`_

Setup supabase
==============
Setup PostgreSQL
================

Head over `PostgreSQL's download page <https://www.postgresql.org/download/>`_ and follow the instructions based on your distro.

Install pufferblow
=====================

Installing **pufferblow** is very straight forward all you need to do is:

* Install via Git:

.. code-block:: bash
pip install git+https://github.com/pufferblow/pufferblow.git
* Build from source:

.. code-block:: bash
git clone https://github.com/pufferblow/pufferblow.git --depth=1
cd pufferblow
pip install -e .
Setup pufferblow
================

pufferblow has a command called setup that enables you to set it up, all you need to do is run the following:

.. code-block:: bash
pufferblow setup
if it detects that a config file is already present, the following will be outputed:

.. code-block::
A config file already exists. Do you want to continue? [y/n]:
but normaly it will ask you for your postgreSQL database name, the default is postgres:

.. code-block::
PostgreSQL database name (postgres):
then it will ask you about the database's username, password, host and port:

.. code-block::
PostgreSQL database username:
PostgreSQL database password:
PostgreSQL database host:
PostgreSQL database name port:
after that it will ask you about some light info on your server, like the server name, description, welcome message:

.. code-block::
Supabase is a Firebase alternative that is open-source, which is why we are using.
To set it up, you can use the **free plan** available at `supabase.com <https://supabase.com>`__, or you can choose a **paid plan** option.
We are going to be using the **free plan** so just head over to `supabase.com/pricing <https://supabase.com/pricing>`__ and choose a plan and create an account:
Enter your server's name:
Enter your server's description:
Enter your server's welcome message for new members:
.. image:: ./_static/images/supabase-pricing.png
:class: image-style
:alt: Supabase pricing plans
and lastly the username, password for the admin user:

.. code-block::
after that, you can then create a **new project**, give it a **name** and a **super strong database password**, select a **region**:
Enter your owner account username:
Enter your owner account password:
.. image:: ./_static/images/supabase-new-project.png
:class: image-style
:alt: Supabase create a new project
.. note::

.. warning::
Don't panic when typing in a password; it will not be shown by design.

Make sure to save your **super strong database password** safe because you are going to need it in order to connect to the database.
Start your pufferblow server
============================

After creating the project, it may take up to 5min in order to setup everything, but after the setup process, head over to **the project settings** page then select **Database**, and you will see your **database's connection info**:
Now you can start your pufferblow server with the following command:

.. image:: ./_static/images/supabase-project-database-connection-info.png
:class: image-style
:alt: Supabase project's database connection info
.. code-block:: bash
make sure to save them in a text file because we're going to need them when setting up `pufferblow <https://github.com/PufferBlow/pufferblow>`__
pufferblow serve
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Welcome to pufferblow-api docs's documentation!
Welcome to **pufferblow**'s documentation!
===============================================

.. toctree::
Expand Down
74 changes: 4 additions & 70 deletions docs/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,80 +5,14 @@ Introduction to pufferblow
Introduction
============

The `pufferblow <https://github.com/PufferBlow/pufferblow>`__ is the official open-source server for `PufferBlow <https://github.com/PufferBlow>`__. Using it you can host your own server and create a community for you, your friends, and potentially others to join and spend wonderful times together. One of the key strengths of the `pufferblow <https://github.com/PufferBlow/pufferblow>`__ is its robust security measures. Being open-source and free to use, it ensures your privacy as it implements advanced encryption algorithms such as Blowfish and bcrypt for data hashing and encryption, making the `pufferblow <https://github.com/PufferBlow/pufferblow>`__ a secure choice for hosting your own server.
Unlike many other chat services that offer little control to the server owner, such as Discord and Guilded, `PufferBlow <https://github.com/PufferBlow/pufferblow>`__ stands apart. With `PufferBlow <https://github.com/PufferBlow/pufferblow>`__, you have the ability to host your own server using `pufferblow <https://github.com/PufferBlow/pufferblow>`__ and customize it according to your preferences.
The **pufferblow** is the official open-source server for **pufferblow**. Using it you can host your own server and create a community for you, your friends, and potentially others to join and spend wonderful times together. One of the key strengths of the **pufferblow** is its robust security measures. Being open-source and free to use, it ensures your privacy as it implements advanced encryption algorithms such as Blowfish and bcrypt for data hashing and encryption, making the **pufferblow** a secure choice for hosting your own server.
Unlike many other chat services that offer little control to the server owner, such as Discord and Guilded, **pufferblow** stands apart. With **pufferblow**, you have the ability to host your own server using **pufferblow** and customize it according to your preferences.

The ideology of pufferblow
==============================

This service enables users to host their own servers or instances while maintaining a consistent user experience across all these servers. Furthermore, users only need to create a single account on one server, which will be synchronized across all instances (aka fediverse network).
This software enables users to host their own servers or instances while maintaining a consistent user experience across all these servers. Furthermore, users only need to create a single account on one server, which will be synchronized across all instances (aka fediverse network).

.. note::

As of version **v0.0.1-beta**, the `pufferblow <https://github.com/PufferBlow/pufferblow>`__ does not yet support the Fediverse. However, this feature is planned for future releases. The primary reason for creating PufferBlow was to develop a Fediverse-compatible Discord-like chat service, which aligns with the ethos of the Fediverse itself.

Prerequisites
=============

To start hosting your server, you will first need a couple things:

* A **Linux VPS**, it can be any Linux distro that you want as long as it meets the following requirements:

* At least 2 CPU cores.

* 1 to 2 GB of RAM.

* High network bandwidth.

.. note::

you won't need a lot of storage to host `pufferblow <https://github.com/PufferBlow/pufferblow>`__, but if you are going to also host your own instance of `supabase <https://supabase.com/>`__ than it is recommended to have at least **50GB of storage or higher**.

* `supabase <https://supabase.com/>`__ is an open-source alternative to Firebase. You have the option to either self-host it or use their free plan available at https://supabase.com. However, it's recommended not to self-host unless your server has a large number of members. If your server is expected to grow significantly, then self-hosting becomes the optimal solution. In such cases, you may also need to consider upgrading your VPS hardware to accommodate the increased load.

Dependencies
============

These are mostly python libs and dependencies that are used by pufferblow:

.. _FastAPI: https://fastapi.tiangolo.com/
.. _Typer: https://typer.tiangolo.com/
.. _Rich: https://rich.readthedocs.io/en/latest/
.. _Uvicorn: https://www.uvicorn.org/
.. _PyYAML: https://pyyaml.org/wiki/PyYAMLDocumentation
.. _PyCryptodome: https://www.pycryptodome.org/en/latest/
.. _bcrypt: https://pypi.org/project/bcrypt/
.. _Loguru: https://loguru.readthedocs.io/en/stable/
.. _pytz: http://pythonhosted.org/pytz/
.. _psycopg2-binary: https://www.psycopg.org/docs/
.. _pytest: https://docs.pytest.org/en/latest/
.. _SQLAlchemy: https://www.sqlalchemy.org/
.. _Websockets: https://websockets.readthedocs.io/en/stable/
.. _HTTPX: https://www.python-httpx.org/

* `FastAPI <FastAPI_>`_: FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints.
* `Typer <Typer_>`_: Typer is a library for building command line interface (CLI) applications, with support for argument parsing, validation, help messages, and more.
* `Rich <Rich_>`_: Rich is a Python library for rendering rich text and beautiful formatting to the terminal.
* `Uvicorn <Uvicorn_>`_: Uvicorn is a lightning-fast ASGI server implementation, using uvloop and httptools.
* `PyYAML <PyYAML_>`_: PyYAML is a YAML parser and emitter for Python.
* `PyCryptodome <PyCryptodome_>`_: PyCryptodome is a self-contained Python package of low-level cryptographic primitives.
* `bcrypt <bcrypt_>`_: bcrypt is a password hashing function designed by Niels Provos and David Mazières.
* `Loguru <Loguru_>`_: Loguru is a library which aims to bring enjoyable logging in Python.
* `pytz <pytz_>`_: pytz brings the Olson tz database into Python.
* `psycopg2-binary <psycopg2-binary_>`_: psycopg2-binary is a stand-alone package that includes the PostgreSQL binary libraries.
* `pytest <pytest_>`_: pytest is a mature full-featured Python testing tool that helps you write better programs.
* `SQLAlchemy <SQLAlchemy_>`_: SQLAlchemy is the Python SQL toolkit and Object-Relational Mapping (ORM) system.
* `Websockets <Websockets_>`_: Websockets is a library for building WebSocket servers and clients in Python.
* `HTTPX <HTTPX_>`_: HTTPX is a fully featured HTTP client for Python 3, which provides sync and async APIs, and support for both HTTP/1.1 and HTTP/2.

for the documentation, we used the `sphinx <https://www.sphinx-doc.org/en/master/>`__ document generator:

.. _Sphinx: https://www.sphinx-doc.org/en/master/
.. _SphinxBookTheme: https://github.com/executablebooks/sphinx-book-theme
.. _SphinxAutobuild: https://pypi.org/project/sphinx-autobuild/
.. _SphinxFavicon: https://pypi.org/project/sphinx-favicon/

* `Sphinx <Sphinx_>`_: Sphinx is a tool that makes it easy to create intelligent and beautiful documentation.
* `Sphinx Book Theme <SphinxBookTheme_>`_: The Sphinx Book Theme is a theme for Sphinx that is designed to look good for books and documentation.
* `Sphinx Autobuild <SphinxAutobuild_>`_: Sphinx Autobuild is a tool that automatically rebuilds your Sphinx documentation whenever changes are detected.
* `Sphinx Favicon <SphinxFavicon_>`_: Sphinx Favicon is an extension for Sphinx that adds support for favicons in your documentation.
As of version **v0.0.1-beta**, **pufferblow** does not yet support the Fediverse. However, this feature is planned for future releases. The primary reason for creating **pufferblow** was to develop a Fediverse-compatible Discord-like chat service, which aligns with the ethos of the Fediverse itself.
Loading

0 comments on commit 4c42cae

Please sign in to comment.