Q-Municate Server is designed for secure storage of API keys using dotenv. This server allows you to create a QuickBlox user session using Firebase Authentication with Phone Numbers. It also redirects requests to an Open AI API.
- Node.js (v16 and above)
- npm (v8 and above)
Install dependencies:
npm install
Set up environment variables:
- Rename the
.env.example
file to.env
. - Edit the
.env
file and replace the placeholder values with your actual configuration.
To start the server, run the following command:
npm start
The server will be started on the specified port (or default port 3000 if not provided).
To create a QuickBlox user session, submit a POST
request to the /session
endpoint with the access_token
received from Firebase.
curl --request POST \
--url http://localhost:3000/session \
--header 'Content-Type: application/json' \
--data '{
"access_token": "<FIREBASE_TOKEN_ID>"
}'
To submit requests to Open AI, you no longer need to send an API Key. You only need to pass the QB-Token header with the QuickBlox user session, and the server will redirect your request to OpenAI.
curl --request GET \
--url http://localhost:3000/v1/models \
--header 'QB-Token: <QB_SESSION_TOKEN>'
Q-Municate Server required integration with QuickBlox to establish a secure access mechanism for the Open AI API and Firebase authorization. By incorporating QuickBlox, a double authentication process is implemented to guarantee that only authorized users can gain access to the API. This involves verifying the registration and authorization of the user attempting to access the API, effectively thwarting any unauthorized third-party interference and safeguarding the API against potential attackers.
To integrate QuickBlox into the Q-Municate Server, follow these steps:
-
Register and set up your QuickBlox account by following the instructions provided in the QuickBlox documentation.
-
Obtain your QuickBlox API URL and ensure that these it is correctly configured in the
.env
file.
Contributions are welcome! If you find any issues or want to add new features, please open an issue or submit a pull request.
This project is licensed under the MIT License.