Skip to content

trejosoftdo/qms-core-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QMS Core API

linting: pylint Build Status

Table of Contents

Overview

The API for the QMS Core functionality.

Requirements

  • Python 3.7+
  • Install dependencies using pip install -r requirements.txt

Installation

  1. Clone the repository

  2. Create a virtual environment

python -m venv venv
  1. Activate the virtual environment
  • On Windows:
venv\Scripts\activate
  • On Unix or MacOS:
source venv/bin/activate
  1. Install dependencies
pip install -r requirements.txt

Environment Variables

In order to run this project, you need to set up the following environment variables. Create a .env file under the /app directory of your project and add the necessary values:

AUTH_API_BASE_URL

  • Description: Base url of the API for authentication.
  • Example:
    AUTH_API_BASE_URL=http://localhost:1234
    

APP_CLIENT_ID

  • Description: Client ID of the APP for authentication.
  • Example:
    APP_CLIENT_ID=test-client-id
    

APP_CLIENT_SECRET

  • Description: Client Secret of the APP for authentication.
  • Example:
    APP_CLIENT_SECRET=test-client-secret
    

IAM_API_KEY

  • Description: API key to be able to consume the IAM API
  • Example:
    IAM_API_KEY=test-iam-api-key
    

AUTH_ALLOWED_API_KEYS

  • Description: A list of allowed API keys
  • Example:
    AUTH_ALLOWED_API_KEYS=api-key-1,api-key-w
    

AUTH_ALLOWED_IP_ADDRESSES

  • Description: A list of allowed IP addresses
  • Example:
    AUTH_ALLOWED_IP_ADDRESSES=127.0.0.1,10.0.12.13
    

DB_CONNECTION_STRING

  • Description: Database connection string
  • Example:
    DB_CONNECTION_STRING=mysql+mysqlconnector://user:pass@host/db
    

Running the Application

Run the FastAPI application using Uvicorn:

uvicorn main:app --reload

The API will be accessible at http://localhost:5002.

API Documentation

Swagger UI: http://127.0.0.1:5002/docs

Linting

Run the linting on the code using:

pylint ./app  --extension-pkg-whitelist='pydantic'

Testing

Run the unit tests using:

cd app
nosetests

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages