Skip to content

This project is a web service that accepts requests,stores information in the database and provides it to the user in the response json feed.

Notifications You must be signed in to change notification settings

AleksandrGavrilin/Jservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


This project is a web service that performs the following functions:

  • Accepts requests as input, in the form of a service question number, containing English-language questions for quizzes;
  • The information received from the service is stored in the database in the form of: question id, question text, answer text, question creation date. If the database has the same question, additional requests are made to the public API with quizzes until a unique question for the quiz is obtained.

Instructions for building a docker image with a service, setting it up and running it.

  • This option also starts the database and the pgadmin4 administration tool.
  • The start settings for running containers are located in the docker-compose.yml file
  • The Dockerfile contains instructions for building the jservice service image.
  1. Run with docker-compose: docker compose up -d
  2. Stop and remove Docker-compose containers: docker compose down
  3. View information about running Docker-compose processes: docker compose ps
  4. View logs in Docker-compose: docker compose logs

Starting the service in Docker:

  1. Building the application image: docker build -t jservice .
  2. Create a container and run it: docker run -d --name mycontainer -p 8080:8080 -e DB_URI=postgresql://juser:cfytr666131@localhost/jservicedb jservice

Starting a service without a container: uvicorn app.main:app --host "0.0.0.0" --port "8080"


You can check the performance of the service by going to the file: testapi.py

About

This project is a web service that accepts requests,stores information in the database and provides it to the user in the response json feed.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published