Hello! I'm Tejan Kahlon and here is my submission for the TopShelfRE coding assignment. I used Python with FastAPI, added full functionality to the API endpoints, and included testing. The server code and tests are combined in test_and_app.py
. The application is also containerized using Docker.
- Clone the repository: git clone https://github.com/yourusername/topshelfre.git cd topshelfre
- Install dependencies:
pip install -r requirements.txt
-
Start the FastAPI server: uvicorn test_and_app:app --reload
-
Access the application: Open your browser and go to http://127.0.0.1:8000
pytest
Build and Run Docker Container
-
Ensure Docker is installed: Download and install Docker from Docker's official site.
-
Build the Docker image: docker build -t myfastapiapp .
-
Run the Docker container: docker run -d -p 8000:8000 myfastapiapp
-
Access the application: Open your browser and go to http://127.0.0.1:8000
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["uvicorn", "test_and_app:app", "--host", "0.0.0.0", "--port", "8000"]