FastServer

logo 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 ServerDocs

ReDocs using OpenApi ServerReDocs

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 ServerStart

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.

  • ClientCpp\FastClient.cpp Contains client for FastServer.
  • RequirementsCpp\lib folder contains HTTPRequest.hpp for sending/posting Http Requests to server and json.hpp for parsing Json using JsonCpp

Chsarp – C# Client for FastServer.

  • Clientcsharp\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.

  • Clientgolang\FastClient.go Contains client for FastServer.
  • RequirementsNone 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.

  • Clientnodejs\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.

  • Clientpython\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

written and maintained by Haseeb Mir ([email protected])

GitHub

View Github