Use the Dockerfile present in current folder to create image in Docker. You can use the below command in the current folder:
docker build -t fyle_interview_intern_backend_main .
This will create Docker image with a name fyle_interview_intern_backend_main which should be accessible in your Docker app
Go to Docker app and navigate to Images section. Click triangle play button besides application name. Expand Optional Settings and input 7755 port in Host Port field under Port section.
Click run to create a new container and start the server. API will be running on http://localhost:7755/
Changes
Add missing APIs mentioned here and get the automated tests to pass
GET /principal/assignments
This API provides assignments that are submitted.
GET /principal/teachers
This API provides list of teachers.
POST /principal/assignments/grade
This API provides list of teachers.
Add tests for grading API
Please be aware that intentional bugs have been incorporated into the application, leading to test failures. Kindly address and rectify these issues as part of the assignment.
bug : while running APIs, providing different user_id for different users were triggering the APIs.
for example: X-Principal = {user_id : 1, principal_id : 1} was triggering the APIs by principal.
Fix : Added additional validations to check user authenticity in core/apis/decorators.py file
bug : even after submitting assignment, the state of assignment was not getting updated.
Fix : Added assignment.state = AssignmentStateEnum.SUBMITTED in core/models/assignment.py line 72.
Optionally, Dockerize your application by creating a Dockerfile and a docker-compose.yml file, providing clear documentation on building and running the application with Docker, to stand out in your submission
Instructions to start the application:
docker build -t fyle_interview_intern_backend_main .
This will create Docker image with a namefyle_interview_intern_backend_main
which should be accessible in your Docker app7755
port in Host Port field under Port section.Changes
Add missing APIs mentioned here and get the automated tests to pass
GET /principal/assignments This API provides assignments that are submitted.![principal_assignments](https://github.com/fylein/fyle-interview-intern-backend/assets/99143819/612e9fd6-a1cb-4f46-adda-732aa709b971)
GET /principal/teachers This API provides list of teachers.![Screenshot (39)](https://github.com/fylein/fyle-interview-intern-backend/assets/99143819/6b349103-87ea-42ec-8355-74463518c2ac)
POST /principal/assignments/grade This API provides list of teachers.![principal_assignment_grade](https://github.com/fylein/fyle-interview-intern-backend/assets/99143819/16b76ddf-7854-404f-bd10-c43a042b4a26)
Add tests for grading API
Please be aware that intentional bugs have been incorporated into the application, leading to test failures. Kindly address and rectify these issues as part of the assignment.
bug : while running APIs, providing different user_id for different users were triggering the APIs. for example:
X-Principal = {user_id : 1, principal_id : 1}
was triggering the APIs by principal. Fix : Added additional validations to check user authenticity incore/apis/decorators.py
filebug : even after submitting assignment, the state of assignment was not getting updated. Fix : Added
assignment.state = AssignmentStateEnum.SUBMITTED
incore/models/assignment.py
line 72.Additionally incorporated bug fixes wherever required.
All tests should pass
DONE
Get the test coverage to 94% or above
Added 6 more test cases to achieve coverage above 94 %. Current coverage : 97%
There are certain SQL tests present inside
tests/SQL/
. You have to write SQL in following files:Optionally, Dockerize your application by creating a Dockerfile and a docker-compose.yml file, providing clear documentation on building and running the application with Docker, to stand out in your submission
DONE, added more info at the top