Git Product home page Git Product logo

bewise's Introduction

Bewise project services

  1. Question service
    • Receiving questions and saving to the database
  2. Audio service
    • User creation
    • For each user - saving the audio recording in wav format, converting it to mp3 format and writing to the database and providing a link to download the audio recording
    • Download audio recording in mp3 format

Installation

Prerequisites

  • installed docker
  • installed git

Run command

git clone https://github.com/Acidastro/bewise.git

Run

For service 1

Run command

docker-compose -f bewise/docker-compose.yml up --build question_service

For service 2

Run command

docker-compose -f bewise/docker-compose.yml up --build audio_service

For all

Run command

docker-compose -f bewise/docker-compose.yml up --build

Examples of using

Service 1

1. Get questions (POST)

  • Request URL http://localhost:23000/get_question/
    • Request example
      curl -X 'POST' \
        'http://localhost:23000/get_question/' \
        -H 'accept: application/json' \
        -H 'Content-Type: application/json' \
        -d '{
        "questions_num": 1    
      }'
      
    • Response example
      "This major league team used to take the field at 34 Kirby Puckett Place"
      

Service 2

1. Create user (POST)

  • Request URL http://localhost:23001/create_user/
    • Request example
      curl -X 'POST' \
        'http://localhost:23001/create_user/' \
        -H 'accept: application/json' \
        -H 'Content-Type: application/json' \
        -d '{
        "user_name": "string"
      }'
      
    • Response example
      {
      "user_id": 12,
      "user_token": "83c18780-32d0-4b4b-8256-0dcefb0360e3"
      }
      

2. Upload audio route (POST)

  • Request URL http://localhost:23001/upload_audio/
    • Request example
      curl -X 'POST' \
        'http://localhost:23001/upload_audio/?user_id=12&user_token=83c18780-32d0-4b4b-8256-0dcefb0360e3' \
        -H 'accept: application/json' \
        -H 'Content-Type: multipart/form-data' \
        -F 'file=@file_example_WAV_1MG.wav;type=audio/wav'
      
    • Response example
      http://localhost:23001/record?audio=6&user=12
      

3. Download audio route

  • Request URL http://localhost:23001/record/?audio=6&user=12
    • Request example
      curl -X 'GET' \
        'http://localhost:23001/record/6/12' \
        -H 'accept: application/json'
      
    • Response example
      • Response body

      • Response headers

        content-disposition: attachment;filename=6_12.mp3 
        content-length: 101348 
        content-type: audio/mpeg 
        date: Tue,23 May 2023 10:31:50 GMT 
        server: uvicorn 
        

bewise's People

Contributors

acidastro avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.