fylein / fyle-interview-intern-backend

44 stars 1.14k forks source link

Assignment Submission - Narendra Maurya (narendramaurya2018956@gmail.com) #52

Closed Narennnnn closed 1 month ago

Narennnnn commented 2 months ago

This Pull request covers the tasks mentioned in application.md:

  1. Add Missing APIs GET /principal/assignments

Screenshot from 2024-04-21 01-20-30

GET /principal/teachers

Screenshot from 2024-04-21 01-22-14

POST /principal/assignments/grade

Screenshot from 2024-04-21 01-22-43

  1. Tests for grading APIs https://github.com/Narennnnn/fyle-interview-intern-backend/tree/feat/FyleBackend/tests

  2. Bug Fixes: Feat: New Feature Fix: To fix the issue https://github.com/Narennnnn/fyle-interview-intern-backend/blob/feat/FyleBackend/core/models/assignments.py

  3. All test cases passed

  4. Test Coverage Report

Screenshot from 2024-04-21 13-58-03

  1. SQL Queries https://github.com/Narennnnn/fyle-interview-intern-backend/tree/feat/FyleBackend/tests/SQL

  2. Dockerize the application 7.1 Make sure you have Docker installed on your system.Create the Dockerfile and docker-compose.yml files in the root directory of your Flask application.

# Dockerfile
FROM python:3.10
ENV FLASK_APP=core/server.py
ENV FLASK_RUN_HOST=0.0.0.0
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 5000
CMD ["bash", "run.sh"]
# docker-compose.yml
version: '3'

services:
  web:
    build: .
    ports:
      - "5000:5000"  
    volumes:
      - .:/app

7.2 Run the following command to build the Docker image (use sudo if admin privileges are needed):

docker-compose build

7.3 Once the build is complete, start the Docker container using the following command:

docker-compose up

7.4 Your Flask application should now be running inside a Docker container. Example to access it:

http://localhost:5000

7.5 Useful Commands

docker-compose down
docker ps
docker-compose logs