This is test task according to https://www.notion.so/darkstoreapp/Portfolio-Manager-API-Python-3f79ed6c559e4ef8ba6246108a76f3b0.
- Clone this repo
- Create virtual enviroment with this command:
python -m venv .venv
- Activate venv: source
.venv/bin/activate
- Copy repo-venv into local enviroment:
pip install -r requirements.txt
- Create
.env
file with FINNHUB_API_KEY:echo 'FINNHUB_API_KEY=your_key' > .env
. The key can be obtained in the fihhhub dashboard. - Run the server:
uvicorn main:app --reload
First of all you need to create an admin user, for that, please, /admin post methon in "Started Requirements" tag. You need this user to have access to "Admin Panel". Then you should login with admin user parameters, login: admin, password: secret. After that you have access to all available methods. You also can create your own user with Create User(3rd methon in "Started Requirements"). It will provide you access with all methods, not admin's ones.
- When you are creating new profile(post Create Profile method) please make shure that field user_id = your user id. You can see your user id while creating user, or you can get JsonWebTocken in 'Generate Token' method and then go to https://jwt.io/ and paste your token.
- Profile is not working with float values.
- Docker compose is not working.