fast-server
fast-server copied to clipboard
FastServer is simple API based server created in FastApi with Clients in various languages.
FastServer
FastServer is server created in FastApi with Gateway Interface in Uvicorn and Clients in various languages available.
this shows how to create a basic server with Users information and how to handle users data and operations listed below.
Server Operations.
-
Adding - Adding user to server using
/add-user/
endpoint. -
Updating - Updating user information in server using
/update-user/
endpoint. -
Removing - Removing user in server using
/remove-user/
endpoint. -
Retrieving - Retrieving user information in server using
/user/?id=
endpoint. -
Server-Info - Retrieving server information using
/server-info/
endpoint. -
Server DB Reset - Resetting whole server using
/null/
endpoint. [BETA] Risky.
Server Features.
- Simple and fast server using Python.
- Server with 228 requests per second.
- Persistent Database using
Json
. - Auto reloading source changes.
Server Docs.
Server documentation is automatically generated using FastApi
.
Docs using OpenApi
ReDocs using OpenApi
Server
Server is created in Python and to start server first install modules from requirements.txt
.
-
FastApi : use
pip install fastapi
-
Uvicorn : use
pip install vvicorn
Then run the server using following methods. - Using Uvicorn : use
python -m uvicorn FastServer:app --reload
- Using Python : user
python -u FastServer.py
Server started running
Client
Clients are created in various languages like C++,Go,JavaScript... to handle basic operations on users like Adding/Updating/Removing User operations.
here are list of following clients available and for sake of simplicity every client is named to FastClient
.
Cpp - C++ Client for FastServer.
-
Client -
Cpp\FastClient.cpp
Contains client for FastServer. -
Requirements -
Cpp\lib
folder containsHTTPRequest.hpp
for sending/posting Http Requests to server andjson.hpp
for parsing Json using JsonCpp
Chsarp - C# Client for FastServer.
-
Client -
csharp\FastClient.cs
Contains client for FastServer. -
Requirements - install modules from
requirements.txt
listed as Newtonsoft.Json,RestSharp or use the command line. command:dotnet add package Newtonsoft.Json
GoLang - GO Client for FastServer.
-
Client -
golang\FastClient.go
Contains client for FastServer. - Requirements - None just run the FastClient.go file.
- Features - Fastest client sending 200 Request/s and Adding 500 Users in 3.12 seconds
Nodejs - JavaScript Client for FastServer.
-
Client -
nodejs\FastClient.js
Contains client for FastServer. -
Requirements - install modules from
requirements.txt
listed as request,Faker or use the command line. command:npm install request
- Features - Fastest client sending 200 Request/s and Adding 500 Users in 3.62 seconds
Python - Python Client for FastServer.
-
Client -
python\FastClient.py
Contains client for FastServer. -
Requirements - install modules from
requirements.txt
listed as FastApi,Uvicorn,requests or use the command line. command:pip install fastapi
Swift - Swift Client for FastServer.
- Client - swift/FastClient.swift Contains client for FastServer.
- Requirements - - None. The client uses built-in Swift libraries.
Rust - Rust Client for FastServer.
- Client - rust/FastClient.rs Contains client for FastServer.
-
Requirements - - Install reqwest and serde crates using the following command:
cargo install reqwest serde
Java - Java Client for FastServer.
- Client - java/FastClient.java Contains client for FastServer.
- Requirements - - None. The client uses built-in Java libraries.
written and maintained by Haseeb Mir ([email protected])