Skip to content

txemac/events-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backend code test

  • The solutions must be implemented in Python. You are free to choose any platform version and additional dependencies but provide a justification for them.
  • Follow PEP8 guidelines.
  • Provide your code on a git repository (private one) on Github. Add the user FeverCodeReviews as collaborator.

On this project we will evaluate:

  • How you develop, style, and consistency of the code
  • How the idea matches the given problem
  • The software architecture

Description

We have an external company that provides us with different events that we fetch, this endpoint changes every day, providing the new events for the future and removing the old ones. The main purpose of the application to develop is to provide a HTTP endpoint to query the different events. This endpoint should accept a "start_date" and a "end_date" param, and return only the events within this time range.

  • We should only receive the available events (the sell mode is online, the rest should be ignored)
  • We should be able to request to this endpoint events from the past (since we have the app running) and the future.

Considerations:

If you have any questions about the test you can contact us

Commands

  • Run:
make run

Check the API with http://127.0.0.1:8000/_health

  • Tests:
make tests
  • Stop:
make stop
  • Delete:
make rm

Documentation

http://127.0.0.1:8000/docs or http://127.0.0.1:8000/redoc

Considerations

  • Using Docker for a project scalable desired to the future.
  • API created with FastAPI, it is a new microframework for me, and I rescue it from my TODO list, I think the challenge is a good moment to learn it.
    • Modeling objects with Pydantic.
    • OpenAPI documentation, auto-generated.
    • The API of events is created inside of APIRoute. Looking cleaning and easy versions.
    • Add the parameter offline to GET.
  • PyTest and TestClient for easy e2e tests.
    • Using mock in tests with external connections.
  • For schemas:
    • consider all parameters required except 'organizer_company_id' in BaseEvent.
    • zone is a list in Event.
    • only 1 Event inside of BaseEvent.
  • Create an external API client, with the logic necessary to read and parse to internal models.
    • Add the URL like a environment variable for easy change.
    • Read data from URL and parse with library 'xmltodict'.
    • I need to rename some fields after xmltodict.
  • Check PEP8 with pycodestyle.
  • The module Events working with events models.

Future tasks

Version 2.0

  • Add PostgreSQL and SQLAlchemy for database and models.
  • The ID of a zone, event or base event are uniques.
  • The info about a zone, event or base could be update whit info and the same ID.
  • The relation between Event and Zone is MxN.
  • New POST endpoint to update feed.
  • New async POST for update feed.