Skip to content

ERAalex/ERA_Fast_API_course_money

Repository files navigation

E.R.A. - Espinosa Rozov Alexander - python developer.

Project - API Money - recive current costs of Rubl



About the project.

This application is a Fast Api server with the ability to provide the exchange rate of coins on any date. The main idea:

  1. FAST API Server.
  • use API of https://cbr.ru/development/SXML/ to get new information about exchange rate of coins.
  • Check information in database - Mongo DB.
  • Save new information on Mongo Db database.

you can make a request http://127.0.0.1:8000/coin/GBP where GBP - is a coin of England

  1. Vue JS.
  • the user can write the name of coin and get information from our Fast Api Server.

  1. Ready Dockerfile and Docker-compose.yml to RUN Containers.
    Just type the command: docker-compose up Container for app + Container for MongoDB

Interesting points about API of SBR:


Intresting points about Mongo db to JSON:

  • When we try to pass Mongo Db information as JSON response in Fast API we can recieve problem with '_ id' because it is not just field like int or str, so Fast Api can't serialize this field, the opcion is not use this field, just skip it like:
    find_item = collection_name.find_one({'date': f'{date}'}, {'_id': 0}).

RESOLVED Problem. When we try make a API request from Vue JS to localhost Fast Api you can get this error:

  • fast api from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin'

You can do:

from fastapi.middleware.cors import CORSMiddleware

and add:

origins = ["*"]

app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=[""],
allow_headers=["
"],
)


Technologies

Main:
SkillIcons PYTHON - REST FRAMEWORK

Main:
SkillIcons VUE JS

DATABASES:
SkillIcons Mongo DB

Additional tech:
SkillIcons GIT
SkillIcons Linux

SkillIcons HTML
SkillIcons CSS


The most important projects:

  1. ➡️ Check out my website. You can find a detailed description of the projects

  2. ➡️ Сommercial project. Flask project. Foreign language teacher website. - See on-line website.

  3. ➡️ Сommercial project. Django project. Online School with personal classrooms of students and teachers. - See online website.

  4. ➡️ Сommercial project. Django project. For goverment school № 205. - See on-line website.

  5. ➡️ Django project Mobile shop, education purpose. Working on it

  6. ➡️ Collective work. Education purpose. VK-bot

  7. ➡️ Control pass, education purpose. Working on it

  8. ➡️ Online-school. Telegram Bot (aiogram). Done. You can see it on Telegram @simon_esp_bot. To start print /start and /menu


GitHub Stats

Github stats Top Langs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published