-
-
Notifications
You must be signed in to change notification settings - Fork 9
Challenge Lautaro De Luca #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
holubba
wants to merge
69
commits into
nanlabs:main
Choose a base branch
from
holubba:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Movie Track Licensing API
API for managing track licensing. Built with NestJS, TypeORM, and PostgreSQL.
Setup Instructions
Prerequisites
.env.example)Installation
git clone https://github.com/holubba/fullstack-engineer-music-licensing-workflow-challenge cd fullstack-engineer-music-licensing-workflow-challenge cp env.example ./.env docker-compose up -d --buildRunning test suite
Tests are made following some guidelines seen in: https://github.com/goldbergyoni/nodejs-testing-best-practices
Assumptions
Scenes don't require timestamps, it would be easy to implement but it would overcomplicate the challenge taking more time implementing basically the same logic that I already implemented with the tracks timestamps.
CRUD operations for each entity were not required explicitly, so I didn't implement them. It would just take more time and they would basically prove nothing. The required endpoints are all implemented and tested.
Extras
I included a Swagger instance on http://localhost:PORT/docs since I wasn't required to make a frontend, but I wanted to make sure that whoever is reading this was going to be able to spin up the project in docker and be able to interact with it without a frontend.
I included a license-history feature that lets you track each change in licenses status for better traceablity.
Tech decisions and tradeoffs
At some point I considered using postgres intervals for the timestamps but TypeORM is really buggy when interacting with intervals so I ultimately decided to ditch the idea and store timestamps as seconds.
I decided to implement the entire challenge in NestJS because it was mentioned in the invitation email as the tech stack and I already had a somehow scaffolded project that I could use to save time. If I had more time available would implement this with DrizzleORM because i prefer it over TypeORM. TypeORM is considered abandonedware by today standards and its not a good package.
I implemented e2e tests with testcontainers to test the core logic of the application, this makes it a bit slow (each test suite has to spin up a temporal container and migrate the db). If I had more time I would just test it against a single db saving up time and resources, but since the app isnt that big its not a big deal.
I chose to implement a SSE endpoint for the sake of simplicity and because I considered that a Websocket was too much for just updating licenses status. It returns the updated license and its documented in Swagger.
I chose to only implement REST endpoint again for the sake of simplicity and also because I could make a good documentation with OpenAPI standards.