Skip to content

Repository files navigation

Execute test on push

Environment documentation

Tu run this project you can use the make command

Creating your development environment

Pre-requirements

  • make
  • docker and docker-compose

If you don't have the make command on your system you may have to install it first

sudo apt-get install build-essential

After this if you are on a Linux machine you can run the command make pre_requirements which will install docker and docker-compose for you

Run the environment

Run the following commands

  • cp .env.example .env or touch .env: because the Makefile needs to have the file
  • make permissions: To grant permissions to the .sh scripts
  • make env/create: Create .env files with the development values
  • make run: To start the application

You might want to see the logs to know if the application is running make log/api: To see the logs on the API make log/front: To see the logs on the front

Entry points

👀 If you have any application running on ports 80 or 3000. Stop them and run again the docker containers or change the configuration on the .env files and run the containers again

Task

Javascript developer challenge
The company has all the employee’s information in a .txt file and they want to create a small
SPA that consumes an API that makes the .txt easy to read.
In order to do that they want to implement the next actions:
- It should be possible to list all the employees: It should have pagination, sort by name and
surname and filter by email.
- It should be possible to create a new employee.
- It should be possible to see only one employee.
All the actions must be implemented in the front, that communicates using API REST with
the backend. The backend will use the .txt file as database.
Requirements:
- The server side should be done in node.js.
- Typescript should be used.
- Choose in both (backend and frontend) the frameworks you feel more comfortable, it
is not expected that you write everything by your own, better that you use the tools
you prefer to make it easy and simple (also styling, do not need to write your own
framework in this task).
You can share a git repository with us, or share the project in the way you prefer.
The file attached follows the next format: id, name surname, address, phone, email,
birthdate.

Data

id, name, surname, address, phone, email, birthdate.
1,Della,Cox,"4945 Lucky Duck Drive",412-862-8457,DellaDCox@superrito.com,10/12/1985
2,Walter,Jeske,"495 Rafe Lane",662-729-8758,WalterJJeske@armyspy.com,3/15/1951
3,Ron,Plaza,"4738 Woodside Circle",850-868-3521,RonAPlaza@dayrep.com,3/30/1990
4,Emma,Kwak,"4190 Tully Street",313-651-6614,EmmaAKwak@cuvox.de,3/12/1940
5,Jimmy,Smith,"3839 Fulton Street",304-405-5250,JimmyTSmith@jourrapide.com,2/25/1953
6,Cecilia,Temple,"4187 Arrowood Drive",904-495-3469,CeciliaGTemple@gustr.com,8/24/1987
7,Ruth,Story,"3474 White Oak Drive",816-761-4637,RuthPStory@dayrep.com,11/28/1963
8,Brenda,Reynolds,"1447 Viking Drive",740-782-7580,BrendaRReynolds@superrito.com,11/25/1955
9,Rene,Lewis,"2683 West Drive",312-495-7822,ReneSLewis@dayrep.com,6/22/1977
10,Dale,Ward,"4246 Rogers Street",513-587-4936,DaleCWard@superrito.com,7/13/1964
11,Pamela,Gilman,"496 Ritter Avenue",586-722-0839,PamelaMGilman@einrot.com,7/18/1935
12,Clarence,Goebel,"3475 Ferrell Street",218-353-1459,ClarenceWGoebel@armyspy.com,12/23/1993
13,Michelle,Reed,"1693 Green Gate Lane",443-715-2332,MichelleKReed@fleckens.hu,4/30/2000
14,Louis,Martin,"2993 Yorkshire Circle",252-287-8673,LouisKMartin@dayrep.com,3/16/1945
15,Betty,Lance,"677 Oakwood Avenue",212-635-3373,BettyKLance@gustr.com,9/7/1980
16,Dean,Flood,"2313 Swick Hill Street",980-581-8871,DeanLFlood@einrot.com,12/12/1950
17,Ricardo,Clark,"31 Browning Lane",607-988-3426,RicardoCClark@einrot.com,7/23/1995
18,Devora,Walker,"3661 Godfrey Street",503-617-8335,DevoraCWalker@gustr.com,10/25/1991
19,Lisa,Toups,"3389 Hinkle Deegan Lake Road",607-215-4985,LisaMToups@teleworm.us,9/11/1970
20,James,O'Brian,"331 Neuport Lane",770-378-4374,JamesJOBrian@einrot.com,7/19/1935
21,Marco,Dube,"1779 Atha Drive",661-695-3020,MarcoPDube@rhyta.com,7/25/1939
22,Deborah,Douglas,"680 Stadium Drive",508-297-3773,DeborahDDouglas@teleworm.us,2/12/1959
23,Charles,Hansen,"2875 Euclid Avenue",805-303-4353,CharlesCHansen@dayrep.com,2/9/1999
24,James,Glenn,"4870 Edgewood Road",901-259-9658,JamesMGlenn@teleworm.us,7/7/1990
25,Cindy,Paul,"3156 Big Elm",816-840-3649,CindyJPaul@fleckens.hu,4/23/1994
26,Mary,Hernandez,"945 Hickman Street",630-421-0480,MaryBHernandez@teleworm.us,6/14/1939
27,Nancy,Villarreal,"4347 Todds Lane",210-465-6307,NancyNVillarreal@armyspy.com,9/21/1959
28,Colby,Lincoln,"426 Bryan Street",336-284-1978,ColbyVLincoln@superrito.com,4/8/1996
29,Robert,Retzlaff,"1858 Water Street",925-250-0317,RobertKRetzlaff@superrito.com,6/20/1951
30,Donald,Schmidt,"1925 Mattson Street",503-431-9711,DonaldBSchmidt@rhyta.com,11/27/1952

I've updated the data to have the correct headers, on the csv file

To-DO

  • phase 1 - Setup environment
    • Create folder structure
      • API and Front folder
      • Create Dockers
      • Create initial documentation
  • phase 2 - Design application front
    • Create front views and components
      • Create List component (I choose to do all the logic on the front because it's only a prototype)
        • Implement the pagination on the front
        • Implement the order of the list item
        • Implement the filter by email (I've implemented for name, phone and address too)
      • Create User component
      • Create CreateUser component [No time]
    • Create cypress test [BASIC]
    • Create environment documentation
  • phase 3 - Design application backend
    • Create API design
      • Create User entity
      • Create Value Object of the attributes (just to make sure that they are not empty)
      • Create UserRepositoryInterface
        • getAll
        • create
      • Create UserFsRepository implementation
      • Create Application service
        • GetAllUsers
        • CreateUser
    • Create environment documentation and API documentation

Notes

  • The task: It should be possible to see only one employee: I think it's solved while filtering
  • In a normal situation I would have created 2 repositories that way I could have use github actions as well as husky on commit
  • The front-end app may be slow on boot time thats because of vue-cli system not the design
  • It need more test and testing doubles
    • Repository
    • Use Case

Improves

  • Frontend features
    • Pagination
    • Search
    • Shorting
  • User component has too much responsibility it should 2 or 3 components
  • The user creation should be able to handle multiple errors on creation.
  • Extract testing doubles from the testcases to other files (+ readability)
  • The framework should have DI support using inversify.js
  • Some test are on the API repo and on the Front repo because they solve the same domain problems but on different applications

About

Coding interview

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - khru/nailted: Coding interview · GitHub
Skip to content

Repository files navigation

Execute test on push

Environment documentation

Tu run this project you can use the make command

Creating your development environment

Pre-requirements

  • make
  • docker and docker-compose

If you don't have the make command on your system you may have to install it first

sudo apt-get install build-essential

After this if you are on a Linux machine you can run the command make pre_requirements which will install docker and docker-compose for you

Run the environment

Run the following commands

  • cp .env.example .env or touch .env: because the Makefile needs to have the file
  • make permissions: To grant permissions to the .sh scripts
  • make env/create: Create .env files with the development values
  • make run: To start the application

You might want to see the logs to know if the application is running make log/api: To see the logs on the API make log/front: To see the logs on the front

Entry points

👀 If you have any application running on ports 80 or 3000. Stop them and run again the docker containers or change the configuration on the .env files and run the containers again

Task

Javascript developer challenge
The company has all the employee’s information in a .txt file and they want to create a small
SPA that consumes an API that makes the .txt easy to read.
In order to do that they want to implement the next actions:
- It should be possible to list all the employees: It should have pagination, sort by name and
surname and filter by email.
- It should be possible to create a new employee.
- It should be possible to see only one employee.
All the actions must be implemented in the front, that communicates using API REST with
the backend. The backend will use the .txt file as database.
Requirements:
- The server side should be done in node.js.
- Typescript should be used.
- Choose in both (backend and frontend) the frameworks you feel more comfortable, it
is not expected that you write everything by your own, better that you use the tools
you prefer to make it easy and simple (also styling, do not need to write your own
framework in this task).
You can share a git repository with us, or share the project in the way you prefer.
The file attached follows the next format: id, name surname, address, phone, email,
birthdate.

Data

id, name, surname, address, phone, email, birthdate.
1,Della,Cox,"4945 Lucky Duck Drive",412-862-8457,DellaDCox@superrito.com,10/12/1985
2,Walter,Jeske,"495 Rafe Lane",662-729-8758,WalterJJeske@armyspy.com,3/15/1951
3,Ron,Plaza,"4738 Woodside Circle",850-868-3521,RonAPlaza@dayrep.com,3/30/1990
4,Emma,Kwak,"4190 Tully Street",313-651-6614,EmmaAKwak@cuvox.de,3/12/1940
5,Jimmy,Smith,"3839 Fulton Street",304-405-5250,JimmyTSmith@jourrapide.com,2/25/1953
6,Cecilia,Temple,"4187 Arrowood Drive",904-495-3469,CeciliaGTemple@gustr.com,8/24/1987
7,Ruth,Story,"3474 White Oak Drive",816-761-4637,RuthPStory@dayrep.com,11/28/1963
8,Brenda,Reynolds,"1447 Viking Drive",740-782-7580,BrendaRReynolds@superrito.com,11/25/1955
9,Rene,Lewis,"2683 West Drive",312-495-7822,ReneSLewis@dayrep.com,6/22/1977
10,Dale,Ward,"4246 Rogers Street",513-587-4936,DaleCWard@superrito.com,7/13/1964
11,Pamela,Gilman,"496 Ritter Avenue",586-722-0839,PamelaMGilman@einrot.com,7/18/1935
12,Clarence,Goebel,"3475 Ferrell Street",218-353-1459,ClarenceWGoebel@armyspy.com,12/23/1993
13,Michelle,Reed,"1693 Green Gate Lane",443-715-2332,MichelleKReed@fleckens.hu,4/30/2000
14,Louis,Martin,"2993 Yorkshire Circle",252-287-8673,LouisKMartin@dayrep.com,3/16/1945
15,Betty,Lance,"677 Oakwood Avenue",212-635-3373,BettyKLance@gustr.com,9/7/1980
16,Dean,Flood,"2313 Swick Hill Street",980-581-8871,DeanLFlood@einrot.com,12/12/1950
17,Ricardo,Clark,"31 Browning Lane",607-988-3426,RicardoCClark@einrot.com,7/23/1995
18,Devora,Walker,"3661 Godfrey Street",503-617-8335,DevoraCWalker@gustr.com,10/25/1991
19,Lisa,Toups,"3389 Hinkle Deegan Lake Road",607-215-4985,LisaMToups@teleworm.us,9/11/1970
20,James,O'Brian,"331 Neuport Lane",770-378-4374,JamesJOBrian@einrot.com,7/19/1935
21,Marco,Dube,"1779 Atha Drive",661-695-3020,MarcoPDube@rhyta.com,7/25/1939
22,Deborah,Douglas,"680 Stadium Drive",508-297-3773,DeborahDDouglas@teleworm.us,2/12/1959
23,Charles,Hansen,"2875 Euclid Avenue",805-303-4353,CharlesCHansen@dayrep.com,2/9/1999
24,James,Glenn,"4870 Edgewood Road",901-259-9658,JamesMGlenn@teleworm.us,7/7/1990
25,Cindy,Paul,"3156 Big Elm",816-840-3649,CindyJPaul@fleckens.hu,4/23/1994
26,Mary,Hernandez,"945 Hickman Street",630-421-0480,MaryBHernandez@teleworm.us,6/14/1939
27,Nancy,Villarreal,"4347 Todds Lane",210-465-6307,NancyNVillarreal@armyspy.com,9/21/1959
28,Colby,Lincoln,"426 Bryan Street",336-284-1978,ColbyVLincoln@superrito.com,4/8/1996
29,Robert,Retzlaff,"1858 Water Street",925-250-0317,RobertKRetzlaff@superrito.com,6/20/1951
30,Donald,Schmidt,"1925 Mattson Street",503-431-9711,DonaldBSchmidt@rhyta.com,11/27/1952

I've updated the data to have the correct headers, on the csv file

To-DO

  • phase 1 - Setup environment
    • Create folder structure
      • API and Front folder
      • Create Dockers
      • Create initial documentation
  • phase 2 - Design application front
    • Create front views and components
      • Create List component (I choose to do all the logic on the front because it's only a prototype)
        • Implement the pagination on the front
        • Implement the order of the list item
        • Implement the filter by email (I've implemented for name, phone and address too)
      • Create User component
      • Create CreateUser component [No time]
    • Create cypress test [BASIC]
    • Create environment documentation
  • phase 3 - Design application backend
    • Create API design
      • Create User entity
      • Create Value Object of the attributes (just to make sure that they are not empty)
      • Create UserRepositoryInterface
        • getAll
        • create
      • Create UserFsRepository implementation
      • Create Application service
        • GetAllUsers
        • CreateUser
    • Create environment documentation and API documentation

Notes

  • The task: It should be possible to see only one employee: I think it's solved while filtering
  • In a normal situation I would have created 2 repositories that way I could have use github actions as well as husky on commit
  • The front-end app may be slow on boot time thats because of vue-cli system not the design
  • It need more test and testing doubles
    • Repository
    • Use Case

Improves

  • Frontend features
    • Pagination
    • Search
    • Shorting
  • User component has too much responsibility it should 2 or 3 components
  • The user creation should be able to handle multiple errors on creation.
  • Extract testing doubles from the testcases to other files (+ readability)
  • The framework should have DI support using inversify.js
  • Some test are on the API repo and on the Front repo because they solve the same domain problems but on different applications

About

Coding interview

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - khru/nailted: Coding interview · GitHub
Skip to content

Repository files navigation

Execute test on push

Environment documentation

Tu run this project you can use the make command

Creating your development environment

Pre-requirements

  • make
  • docker and docker-compose

If you don't have the make command on your system you may have to install it first

sudo apt-get install build-essential

After this if you are on a Linux machine you can run the command make pre_requirements which will install docker and docker-compose for you

Run the environment

Run the following commands

  • cp .env.example .env or touch .env: because the Makefile needs to have the file
  • make permissions: To grant permissions to the .sh scripts
  • make env/create: Create .env files with the development values
  • make run: To start the application

You might want to see the logs to know if the application is running make log/api: To see the logs on the API make log/front: To see the logs on the front

Entry points

👀 If you have any application running on ports 80 or 3000. Stop them and run again the docker containers or change the configuration on the .env files and run the containers again

Task

Javascript developer challenge
The company has all the employee’s information in a .txt file and they want to create a small
SPA that consumes an API that makes the .txt easy to read.
In order to do that they want to implement the next actions:
- It should be possible to list all the employees: It should have pagination, sort by name and
surname and filter by email.
- It should be possible to create a new employee.
- It should be possible to see only one employee.
All the actions must be implemented in the front, that communicates using API REST with
the backend. The backend will use the .txt file as database.
Requirements:
- The server side should be done in node.js.
- Typescript should be used.
- Choose in both (backend and frontend) the frameworks you feel more comfortable, it
is not expected that you write everything by your own, better that you use the tools
you prefer to make it easy and simple (also styling, do not need to write your own
framework in this task).
You can share a git repository with us, or share the project in the way you prefer.
The file attached follows the next format: id, name surname, address, phone, email,
birthdate.

Data

id, name, surname, address, phone, email, birthdate.
1,Della,Cox,"4945 Lucky Duck Drive",412-862-8457,DellaDCox@superrito.com,10/12/1985
2,Walter,Jeske,"495 Rafe Lane",662-729-8758,WalterJJeske@armyspy.com,3/15/1951
3,Ron,Plaza,"4738 Woodside Circle",850-868-3521,RonAPlaza@dayrep.com,3/30/1990
4,Emma,Kwak,"4190 Tully Street",313-651-6614,EmmaAKwak@cuvox.de,3/12/1940
5,Jimmy,Smith,"3839 Fulton Street",304-405-5250,JimmyTSmith@jourrapide.com,2/25/1953
6,Cecilia,Temple,"4187 Arrowood Drive",904-495-3469,CeciliaGTemple@gustr.com,8/24/1987
7,Ruth,Story,"3474 White Oak Drive",816-761-4637,RuthPStory@dayrep.com,11/28/1963
8,Brenda,Reynolds,"1447 Viking Drive",740-782-7580,BrendaRReynolds@superrito.com,11/25/1955
9,Rene,Lewis,"2683 West Drive",312-495-7822,ReneSLewis@dayrep.com,6/22/1977
10,Dale,Ward,"4246 Rogers Street",513-587-4936,DaleCWard@superrito.com,7/13/1964
11,Pamela,Gilman,"496 Ritter Avenue",586-722-0839,PamelaMGilman@einrot.com,7/18/1935
12,Clarence,Goebel,"3475 Ferrell Street",218-353-1459,ClarenceWGoebel@armyspy.com,12/23/1993
13,Michelle,Reed,"1693 Green Gate Lane",443-715-2332,MichelleKReed@fleckens.hu,4/30/2000
14,Louis,Martin,"2993 Yorkshire Circle",252-287-8673,LouisKMartin@dayrep.com,3/16/1945
15,Betty,Lance,"677 Oakwood Avenue",212-635-3373,BettyKLance@gustr.com,9/7/1980
16,Dean,Flood,"2313 Swick Hill Street",980-581-8871,DeanLFlood@einrot.com,12/12/1950
17,Ricardo,Clark,"31 Browning Lane",607-988-3426,RicardoCClark@einrot.com,7/23/1995
18,Devora,Walker,"3661 Godfrey Street",503-617-8335,DevoraCWalker@gustr.com,10/25/1991
19,Lisa,Toups,"3389 Hinkle Deegan Lake Road",607-215-4985,LisaMToups@teleworm.us,9/11/1970
20,James,O'Brian,"331 Neuport Lane",770-378-4374,JamesJOBrian@einrot.com,7/19/1935
21,Marco,Dube,"1779 Atha Drive",661-695-3020,MarcoPDube@rhyta.com,7/25/1939
22,Deborah,Douglas,"680 Stadium Drive",508-297-3773,DeborahDDouglas@teleworm.us,2/12/1959
23,Charles,Hansen,"2875 Euclid Avenue",805-303-4353,CharlesCHansen@dayrep.com,2/9/1999
24,James,Glenn,"4870 Edgewood Road",901-259-9658,JamesMGlenn@teleworm.us,7/7/1990
25,Cindy,Paul,"3156 Big Elm",816-840-3649,CindyJPaul@fleckens.hu,4/23/1994
26,Mary,Hernandez,"945 Hickman Street",630-421-0480,MaryBHernandez@teleworm.us,6/14/1939
27,Nancy,Villarreal,"4347 Todds Lane",210-465-6307,NancyNVillarreal@armyspy.com,9/21/1959
28,Colby,Lincoln,"426 Bryan Street",336-284-1978,ColbyVLincoln@superrito.com,4/8/1996
29,Robert,Retzlaff,"1858 Water Street",925-250-0317,RobertKRetzlaff@superrito.com,6/20/1951
30,Donald,Schmidt,"1925 Mattson Street",503-431-9711,DonaldBSchmidt@rhyta.com,11/27/1952

I've updated the data to have the correct headers, on the csv file

To-DO

  • phase 1 - Setup environment
    • Create folder structure
      • API and Front folder
      • Create Dockers
      • Create initial documentation
  • phase 2 - Design application front
    • Create front views and components
      • Create List component (I choose to do all the logic on the front because it's only a prototype)
        • Implement the pagination on the front
        • Implement the order of the list item
        • Implement the filter by email (I've implemented for name, phone and address too)
      • Create User component
      • Create CreateUser component [No time]
    • Create cypress test [BASIC]
    • Create environment documentation
  • phase 3 - Design application backend
    • Create API design
      • Create User entity
      • Create Value Object of the attributes (just to make sure that they are not empty)
      • Create UserRepositoryInterface
        • getAll
        • create
      • Create UserFsRepository implementation
      • Create Application service
        • GetAllUsers
        • CreateUser
    • Create environment documentation and API documentation

Notes

  • The task: It should be possible to see only one employee: I think it's solved while filtering
  • In a normal situation I would have created 2 repositories that way I could have use github actions as well as husky on commit
  • The front-end app may be slow on boot time thats because of vue-cli system not the design
  • It need more test and testing doubles
    • Repository
    • Use Case

Improves

  • Frontend features
    • Pagination
    • Search
    • Shorting
  • User component has too much responsibility it should 2 or 3 components
  • The user creation should be able to handle multiple errors on creation.
  • Extract testing doubles from the testcases to other files (+ readability)
  • The framework should have DI support using inversify.js
  • Some test are on the API repo and on the Front repo because they solve the same domain problems but on different applications

About

Coding interview

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - khru/nailted: Coding interview · GitHub
Skip to content

Repository files navigation

Execute test on push

Environment documentation

Tu run this project you can use the make command

Creating your development environment

Pre-requirements

  • make
  • docker and docker-compose

If you don't have the make command on your system you may have to install it first

sudo apt-get install build-essential

After this if you are on a Linux machine you can run the command make pre_requirements which will install docker and docker-compose for you

Run the environment

Run the following commands

  • cp .env.example .env or touch .env: because the Makefile needs to have the file
  • make permissions: To grant permissions to the .sh scripts
  • make env/create: Create .env files with the development values
  • make run: To start the application

You might want to see the logs to know if the application is running make log/api: To see the logs on the API make log/front: To see the logs on the front

Entry points

👀 If you have any application running on ports 80 or 3000. Stop them and run again the docker containers or change the configuration on the .env files and run the containers again

Task

Javascript developer challenge
The company has all the employee’s information in a .txt file and they want to create a small
SPA that consumes an API that makes the .txt easy to read.
In order to do that they want to implement the next actions:
- It should be possible to list all the employees: It should have pagination, sort by name and
surname and filter by email.
- It should be possible to create a new employee.
- It should be possible to see only one employee.
All the actions must be implemented in the front, that communicates using API REST with
the backend. The backend will use the .txt file as database.
Requirements:
- The server side should be done in node.js.
- Typescript should be used.
- Choose in both (backend and frontend) the frameworks you feel more comfortable, it
is not expected that you write everything by your own, better that you use the tools
you prefer to make it easy and simple (also styling, do not need to write your own
framework in this task).
You can share a git repository with us, or share the project in the way you prefer.
The file attached follows the next format: id, name surname, address, phone, email,
birthdate.

Data

id, name, surname, address, phone, email, birthdate.
1,Della,Cox,"4945 Lucky Duck Drive",412-862-8457,DellaDCox@superrito.com,10/12/1985
2,Walter,Jeske,"495 Rafe Lane",662-729-8758,WalterJJeske@armyspy.com,3/15/1951
3,Ron,Plaza,"4738 Woodside Circle",850-868-3521,RonAPlaza@dayrep.com,3/30/1990
4,Emma,Kwak,"4190 Tully Street",313-651-6614,EmmaAKwak@cuvox.de,3/12/1940
5,Jimmy,Smith,"3839 Fulton Street",304-405-5250,JimmyTSmith@jourrapide.com,2/25/1953
6,Cecilia,Temple,"4187 Arrowood Drive",904-495-3469,CeciliaGTemple@gustr.com,8/24/1987
7,Ruth,Story,"3474 White Oak Drive",816-761-4637,RuthPStory@dayrep.com,11/28/1963
8,Brenda,Reynolds,"1447 Viking Drive",740-782-7580,BrendaRReynolds@superrito.com,11/25/1955
9,Rene,Lewis,"2683 West Drive",312-495-7822,ReneSLewis@dayrep.com,6/22/1977
10,Dale,Ward,"4246 Rogers Street",513-587-4936,DaleCWard@superrito.com,7/13/1964
11,Pamela,Gilman,"496 Ritter Avenue",586-722-0839,PamelaMGilman@einrot.com,7/18/1935
12,Clarence,Goebel,"3475 Ferrell Street",218-353-1459,ClarenceWGoebel@armyspy.com,12/23/1993
13,Michelle,Reed,"1693 Green Gate Lane",443-715-2332,MichelleKReed@fleckens.hu,4/30/2000
14,Louis,Martin,"2993 Yorkshire Circle",252-287-8673,LouisKMartin@dayrep.com,3/16/1945
15,Betty,Lance,"677 Oakwood Avenue",212-635-3373,BettyKLance@gustr.com,9/7/1980
16,Dean,Flood,"2313 Swick Hill Street",980-581-8871,DeanLFlood@einrot.com,12/12/1950
17,Ricardo,Clark,"31 Browning Lane",607-988-3426,RicardoCClark@einrot.com,7/23/1995
18,Devora,Walker,"3661 Godfrey Street",503-617-8335,DevoraCWalker@gustr.com,10/25/1991
19,Lisa,Toups,"3389 Hinkle Deegan Lake Road",607-215-4985,LisaMToups@teleworm.us,9/11/1970
20,James,O'Brian,"331 Neuport Lane",770-378-4374,JamesJOBrian@einrot.com,7/19/1935
21,Marco,Dube,"1779 Atha Drive",661-695-3020,MarcoPDube@rhyta.com,7/25/1939
22,Deborah,Douglas,"680 Stadium Drive",508-297-3773,DeborahDDouglas@teleworm.us,2/12/1959
23,Charles,Hansen,"2875 Euclid Avenue",805-303-4353,CharlesCHansen@dayrep.com,2/9/1999
24,James,Glenn,"4870 Edgewood Road",901-259-9658,JamesMGlenn@teleworm.us,7/7/1990
25,Cindy,Paul,"3156 Big Elm",816-840-3649,CindyJPaul@fleckens.hu,4/23/1994
26,Mary,Hernandez,"945 Hickman Street",630-421-0480,MaryBHernandez@teleworm.us,6/14/1939
27,Nancy,Villarreal,"4347 Todds Lane",210-465-6307,NancyNVillarreal@armyspy.com,9/21/1959
28,Colby,Lincoln,"426 Bryan Street",336-284-1978,ColbyVLincoln@superrito.com,4/8/1996
29,Robert,Retzlaff,"1858 Water Street",925-250-0317,RobertKRetzlaff@superrito.com,6/20/1951
30,Donald,Schmidt,"1925 Mattson Street",503-431-9711,DonaldBSchmidt@rhyta.com,11/27/1952

I've updated the data to have the correct headers, on the csv file

To-DO

  • phase 1 - Setup environment
    • Create folder structure
      • API and Front folder
      • Create Dockers
      • Create initial documentation
  • phase 2 - Design application front
    • Create front views and components
      • Create List component (I choose to do all the logic on the front because it's only a prototype)
        • Implement the pagination on the front
        • Implement the order of the list item
        • Implement the filter by email (I've implemented for name, phone and address too)
      • Create User component
      • Create CreateUser component [No time]
    • Create cypress test [BASIC]
    • Create environment documentation
  • phase 3 - Design application backend
    • Create API design
      • Create User entity
      • Create Value Object of the attributes (just to make sure that they are not empty)
      • Create UserRepositoryInterface
        • getAll
        • create
      • Create UserFsRepository implementation
      • Create Application service
        • GetAllUsers
        • CreateUser
    • Create environment documentation and API documentation

Notes

  • The task: It should be possible to see only one employee: I think it's solved while filtering
  • In a normal situation I would have created 2 repositories that way I could have use github actions as well as husky on commit
  • The front-end app may be slow on boot time thats because of vue-cli system not the design
  • It need more test and testing doubles
    • Repository
    • Use Case

Improves

  • Frontend features
    • Pagination
    • Search
    • Shorting
  • User component has too much responsibility it should 2 or 3 components
  • The user creation should be able to handle multiple errors on creation.
  • Extract testing doubles from the testcases to other files (+ readability)
  • The framework should have DI support using inversify.js
  • Some test are on the API repo and on the Front repo because they solve the same domain problems but on different applications

About

Coding interview

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' GitHub - khru/nailted: Coding interview · GitHub
Skip to content

Repository files navigation

Execute test on push

Environment documentation

Tu run this project you can use the make command

Creating your development environment

Pre-requirements

  • make
  • docker and docker-compose

If you don't have the make command on your system you may have to install it first

sudo apt-get install build-essential

After this if you are on a Linux machine you can run the command make pre_requirements which will install docker and docker-compose for you

Run the environment

Run the following commands

  • cp .env.example .env or touch .env: because the Makefile needs to have the file
  • make permissions: To grant permissions to the .sh scripts
  • make env/create: Create .env files with the development values
  • make run: To start the application

You might want to see the logs to know if the application is running make log/api: To see the logs on the API make log/front: To see the logs on the front

Entry points

👀 If you have any application running on ports 80 or 3000. Stop them and run again the docker containers or change the configuration on the .env files and run the containers again

Task

Javascript developer challenge
The company has all the employee’s information in a .txt file and they want to create a small
SPA that consumes an API that makes the .txt easy to read.
In order to do that they want to implement the next actions:
- It should be possible to list all the employees: It should have pagination, sort by name and
surname and filter by email.
- It should be possible to create a new employee.
- It should be possible to see only one employee.
All the actions must be implemented in the front, that communicates using API REST with
the backend. The backend will use the .txt file as database.
Requirements:
- The server side should be done in node.js.
- Typescript should be used.
- Choose in both (backend and frontend) the frameworks you feel more comfortable, it
is not expected that you write everything by your own, better that you use the tools
you prefer to make it easy and simple (also styling, do not need to write your own
framework in this task).
You can share a git repository with us, or share the project in the way you prefer.
The file attached follows the next format: id, name surname, address, phone, email,
birthdate.

Data

id, name, surname, address, phone, email, birthdate.
1,Della,Cox,"4945 Lucky Duck Drive",412-862-8457,DellaDCox@superrito.com,10/12/1985
2,Walter,Jeske,"495 Rafe Lane",662-729-8758,WalterJJeske@armyspy.com,3/15/1951
3,Ron,Plaza,"4738 Woodside Circle",850-868-3521,RonAPlaza@dayrep.com,3/30/1990
4,Emma,Kwak,"4190 Tully Street",313-651-6614,EmmaAKwak@cuvox.de,3/12/1940
5,Jimmy,Smith,"3839 Fulton Street",304-405-5250,JimmyTSmith@jourrapide.com,2/25/1953
6,Cecilia,Temple,"4187 Arrowood Drive",904-495-3469,CeciliaGTemple@gustr.com,8/24/1987
7,Ruth,Story,"3474 White Oak Drive",816-761-4637,RuthPStory@dayrep.com,11/28/1963
8,Brenda,Reynolds,"1447 Viking Drive",740-782-7580,BrendaRReynolds@superrito.com,11/25/1955
9,Rene,Lewis,"2683 West Drive",312-495-7822,ReneSLewis@dayrep.com,6/22/1977
10,Dale,Ward,"4246 Rogers Street",513-587-4936,DaleCWard@superrito.com,7/13/1964
11,Pamela,Gilman,"496 Ritter Avenue",586-722-0839,PamelaMGilman@einrot.com,7/18/1935
12,Clarence,Goebel,"3475 Ferrell Street",218-353-1459,ClarenceWGoebel@armyspy.com,12/23/1993
13,Michelle,Reed,"1693 Green Gate Lane",443-715-2332,MichelleKReed@fleckens.hu,4/30/2000
14,Louis,Martin,"2993 Yorkshire Circle",252-287-8673,LouisKMartin@dayrep.com,3/16/1945
15,Betty,Lance,"677 Oakwood Avenue",212-635-3373,BettyKLance@gustr.com,9/7/1980
16,Dean,Flood,"2313 Swick Hill Street",980-581-8871,DeanLFlood@einrot.com,12/12/1950
17,Ricardo,Clark,"31 Browning Lane",607-988-3426,RicardoCClark@einrot.com,7/23/1995
18,Devora,Walker,"3661 Godfrey Street",503-617-8335,DevoraCWalker@gustr.com,10/25/1991
19,Lisa,Toups,"3389 Hinkle Deegan Lake Road",607-215-4985,LisaMToups@teleworm.us,9/11/1970
20,James,O'Brian,"331 Neuport Lane",770-378-4374,JamesJOBrian@einrot.com,7/19/1935
21,Marco,Dube,"1779 Atha Drive",661-695-3020,MarcoPDube@rhyta.com,7/25/1939
22,Deborah,Douglas,"680 Stadium Drive",508-297-3773,DeborahDDouglas@teleworm.us,2/12/1959
23,Charles,Hansen,"2875 Euclid Avenue",805-303-4353,CharlesCHansen@dayrep.com,2/9/1999
24,James,Glenn,"4870 Edgewood Road",901-259-9658,JamesMGlenn@teleworm.us,7/7/1990
25,Cindy,Paul,"3156 Big Elm",816-840-3649,CindyJPaul@fleckens.hu,4/23/1994
26,Mary,Hernandez,"945 Hickman Street",630-421-0480,MaryBHernandez@teleworm.us,6/14/1939
27,Nancy,Villarreal,"4347 Todds Lane",210-465-6307,NancyNVillarreal@armyspy.com,9/21/1959
28,Colby,Lincoln,"426 Bryan Street",336-284-1978,ColbyVLincoln@superrito.com,4/8/1996
29,Robert,Retzlaff,"1858 Water Street",925-250-0317,RobertKRetzlaff@superrito.com,6/20/1951
30,Donald,Schmidt,"1925 Mattson Street",503-431-9711,DonaldBSchmidt@rhyta.com,11/27/1952

I've updated the data to have the correct headers, on the csv file

To-DO

  • phase 1 - Setup environment
    • Create folder structure
      • API and Front folder
      • Create Dockers
      • Create initial documentation
  • phase 2 - Design application front
    • Create front views and components
      • Create List component (I choose to do all the logic on the front because it's only a prototype)
        • Implement the pagination on the front
        • Implement the order of the list item
        • Implement the filter by email (I've implemented for name, phone and address too)
      • Create User component
      • Create CreateUser component [No time]
    • Create cypress test [BASIC]
    • Create environment documentation
  • phase 3 - Design application backend
    • Create API design
      • Create User entity
      • Create Value Object of the attributes (just to make sure that they are not empty)
      • Create UserRepositoryInterface
        • getAll
        • create
      • Create UserFsRepository implementation
      • Create Application service
        • GetAllUsers
        • CreateUser
    • Create environment documentation and API documentation

Notes

  • The task: It should be possible to see only one employee: I think it's solved while filtering
  • In a normal situation I would have created 2 repositories that way I could have use github actions as well as husky on commit
  • The front-end app may be slow on boot time thats because of vue-cli system not the design
  • It need more test and testing doubles
    • Repository
    • Use Case

Improves

  • Frontend features
    • Pagination
    • Search
    • Shorting
  • User component has too much responsibility it should 2 or 3 components
  • The user creation should be able to handle multiple errors on creation.
  • Extract testing doubles from the testcases to other files (+ readability)
  • The framework should have DI support using inversify.js
  • Some test are on the API repo and on the Front repo because they solve the same domain problems but on different applications

About

Coding interview

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - khru/nailted: Coding interview · GitHub
Skip to content

Repository files navigation

Execute test on push

Environment documentation

Tu run this project you can use the make command

Creating your development environment

Pre-requirements

  • make
  • docker and docker-compose

If you don't have the make command on your system you may have to install it first

sudo apt-get install build-essential

After this if you are on a Linux machine you can run the command make pre_requirements which will install docker and docker-compose for you

Run the environment

Run the following commands

  • cp .env.example .env or touch .env: because the Makefile needs to have the file
  • make permissions: To grant permissions to the .sh scripts
  • make env/create: Create .env files with the development values
  • make run: To start the application

You might want to see the logs to know if the application is running make log/api: To see the logs on the API make log/front: To see the logs on the front

Entry points

👀 If you have any application running on ports 80 or 3000. Stop them and run again the docker containers or change the configuration on the .env files and run the containers again

Task

Javascript developer challenge
The company has all the employee’s information in a .txt file and they want to create a small
SPA that consumes an API that makes the .txt easy to read.
In order to do that they want to implement the next actions:
- It should be possible to list all the employees: It should have pagination, sort by name and
surname and filter by email.
- It should be possible to create a new employee.
- It should be possible to see only one employee.
All the actions must be implemented in the front, that communicates using API REST with
the backend. The backend will use the .txt file as database.
Requirements:
- The server side should be done in node.js.
- Typescript should be used.
- Choose in both (backend and frontend) the frameworks you feel more comfortable, it
is not expected that you write everything by your own, better that you use the tools
you prefer to make it easy and simple (also styling, do not need to write your own
framework in this task).
You can share a git repository with us, or share the project in the way you prefer.
The file attached follows the next format: id, name surname, address, phone, email,
birthdate.

Data

id, name, surname, address, phone, email, birthdate.
1,Della,Cox,"4945 Lucky Duck Drive",412-862-8457,DellaDCox@superrito.com,10/12/1985
2,Walter,Jeske,"495 Rafe Lane",662-729-8758,WalterJJeske@armyspy.com,3/15/1951
3,Ron,Plaza,"4738 Woodside Circle",850-868-3521,RonAPlaza@dayrep.com,3/30/1990
4,Emma,Kwak,"4190 Tully Street",313-651-6614,EmmaAKwak@cuvox.de,3/12/1940
5,Jimmy,Smith,"3839 Fulton Street",304-405-5250,JimmyTSmith@jourrapide.com,2/25/1953
6,Cecilia,Temple,"4187 Arrowood Drive",904-495-3469,CeciliaGTemple@gustr.com,8/24/1987
7,Ruth,Story,"3474 White Oak Drive",816-761-4637,RuthPStory@dayrep.com,11/28/1963
8,Brenda,Reynolds,"1447 Viking Drive",740-782-7580,BrendaRReynolds@superrito.com,11/25/1955
9,Rene,Lewis,"2683 West Drive",312-495-7822,ReneSLewis@dayrep.com,6/22/1977
10,Dale,Ward,"4246 Rogers Street",513-587-4936,DaleCWard@superrito.com,7/13/1964
11,Pamela,Gilman,"496 Ritter Avenue",586-722-0839,PamelaMGilman@einrot.com,7/18/1935
12,Clarence,Goebel,"3475 Ferrell Street",218-353-1459,ClarenceWGoebel@armyspy.com,12/23/1993
13,Michelle,Reed,"1693 Green Gate Lane",443-715-2332,MichelleKReed@fleckens.hu,4/30/2000
14,Louis,Martin,"2993 Yorkshire Circle",252-287-8673,LouisKMartin@dayrep.com,3/16/1945
15,Betty,Lance,"677 Oakwood Avenue",212-635-3373,BettyKLance@gustr.com,9/7/1980
16,Dean,Flood,"2313 Swick Hill Street",980-581-8871,DeanLFlood@einrot.com,12/12/1950
17,Ricardo,Clark,"31 Browning Lane",607-988-3426,RicardoCClark@einrot.com,7/23/1995
18,Devora,Walker,"3661 Godfrey Street",503-617-8335,DevoraCWalker@gustr.com,10/25/1991
19,Lisa,Toups,"3389 Hinkle Deegan Lake Road",607-215-4985,LisaMToups@teleworm.us,9/11/1970
20,James,O'Brian,"331 Neuport Lane",770-378-4374,JamesJOBrian@einrot.com,7/19/1935
21,Marco,Dube,"1779 Atha Drive",661-695-3020,MarcoPDube@rhyta.com,7/25/1939
22,Deborah,Douglas,"680 Stadium Drive",508-297-3773,DeborahDDouglas@teleworm.us,2/12/1959
23,Charles,Hansen,"2875 Euclid Avenue",805-303-4353,CharlesCHansen@dayrep.com,2/9/1999
24,James,Glenn,"4870 Edgewood Road",901-259-9658,JamesMGlenn@teleworm.us,7/7/1990
25,Cindy,Paul,"3156 Big Elm",816-840-3649,CindyJPaul@fleckens.hu,4/23/1994
26,Mary,Hernandez,"945 Hickman Street",630-421-0480,MaryBHernandez@teleworm.us,6/14/1939
27,Nancy,Villarreal,"4347 Todds Lane",210-465-6307,NancyNVillarreal@armyspy.com,9/21/1959
28,Colby,Lincoln,"426 Bryan Street",336-284-1978,ColbyVLincoln@superrito.com,4/8/1996
29,Robert,Retzlaff,"1858 Water Street",925-250-0317,RobertKRetzlaff@superrito.com,6/20/1951
30,Donald,Schmidt,"1925 Mattson Street",503-431-9711,DonaldBSchmidt@rhyta.com,11/27/1952

I've updated the data to have the correct headers, on the csv file

To-DO

  • phase 1 - Setup environment
    • Create folder structure
      • API and Front folder
      • Create Dockers
      • Create initial documentation
  • phase 2 - Design application front
    • Create front views and components
      • Create List component (I choose to do all the logic on the front because it's only a prototype)
        • Implement the pagination on the front
        • Implement the order of the list item
        • Implement the filter by email (I've implemented for name, phone and address too)
      • Create User component
      • Create CreateUser component [No time]
    • Create cypress test [BASIC]
    • Create environment documentation
  • phase 3 - Design application backend
    • Create API design
      • Create User entity
      • Create Value Object of the attributes (just to make sure that they are not empty)
      • Create UserRepositoryInterface
        • getAll
        • create
      • Create UserFsRepository implementation
      • Create Application service
        • GetAllUsers
        • CreateUser
    • Create environment documentation and API documentation

Notes

  • The task: It should be possible to see only one employee: I think it's solved while filtering
  • In a normal situation I would have created 2 repositories that way I could have use github actions as well as husky on commit
  • The front-end app may be slow on boot time thats because of vue-cli system not the design
  • It need more test and testing doubles
    • Repository
    • Use Case

Improves

  • Frontend features
    • Pagination
    • Search
    • Shorting
  • User component has too much responsibility it should 2 or 3 components
  • The user creation should be able to handle multiple errors on creation.
  • Extract testing doubles from the testcases to other files (+ readability)
  • The framework should have DI support using inversify.js
  • Some test are on the API repo and on the Front repo because they solve the same domain problems but on different applications

About

Coding interview

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - khru/nailted: Coding interview · GitHub
Skip to content

Repository files navigation

Execute test on push

Environment documentation

Tu run this project you can use the make command

Creating your development environment

Pre-requirements

  • make
  • docker and docker-compose

If you don't have the make command on your system you may have to install it first

sudo apt-get install build-essential

After this if you are on a Linux machine you can run the command make pre_requirements which will install docker and docker-compose for you

Run the environment

Run the following commands

  • cp .env.example .env or touch .env: because the Makefile needs to have the file
  • make permissions: To grant permissions to the .sh scripts
  • make env/create: Create .env files with the development values
  • make run: To start the application

You might want to see the logs to know if the application is running make log/api: To see the logs on the API make log/front: To see the logs on the front

Entry points

👀 If you have any application running on ports 80 or 3000. Stop them and run again the docker containers or change the configuration on the .env files and run the containers again

Task

Javascript developer challenge
The company has all the employee’s information in a .txt file and they want to create a small
SPA that consumes an API that makes the .txt easy to read.
In order to do that they want to implement the next actions:
- It should be possible to list all the employees: It should have pagination, sort by name and
surname and filter by email.
- It should be possible to create a new employee.
- It should be possible to see only one employee.
All the actions must be implemented in the front, that communicates using API REST with
the backend. The backend will use the .txt file as database.
Requirements:
- The server side should be done in node.js.
- Typescript should be used.
- Choose in both (backend and frontend) the frameworks you feel more comfortable, it
is not expected that you write everything by your own, better that you use the tools
you prefer to make it easy and simple (also styling, do not need to write your own
framework in this task).
You can share a git repository with us, or share the project in the way you prefer.
The file attached follows the next format: id, name surname, address, phone, email,
birthdate.

Data

id, name, surname, address, phone, email, birthdate.
1,Della,Cox,"4945 Lucky Duck Drive",412-862-8457,DellaDCox@superrito.com,10/12/1985
2,Walter,Jeske,"495 Rafe Lane",662-729-8758,WalterJJeske@armyspy.com,3/15/1951
3,Ron,Plaza,"4738 Woodside Circle",850-868-3521,RonAPlaza@dayrep.com,3/30/1990
4,Emma,Kwak,"4190 Tully Street",313-651-6614,EmmaAKwak@cuvox.de,3/12/1940
5,Jimmy,Smith,"3839 Fulton Street",304-405-5250,JimmyTSmith@jourrapide.com,2/25/1953
6,Cecilia,Temple,"4187 Arrowood Drive",904-495-3469,CeciliaGTemple@gustr.com,8/24/1987
7,Ruth,Story,"3474 White Oak Drive",816-761-4637,RuthPStory@dayrep.com,11/28/1963
8,Brenda,Reynolds,"1447 Viking Drive",740-782-7580,BrendaRReynolds@superrito.com,11/25/1955
9,Rene,Lewis,"2683 West Drive",312-495-7822,ReneSLewis@dayrep.com,6/22/1977
10,Dale,Ward,"4246 Rogers Street",513-587-4936,DaleCWard@superrito.com,7/13/1964
11,Pamela,Gilman,"496 Ritter Avenue",586-722-0839,PamelaMGilman@einrot.com,7/18/1935
12,Clarence,Goebel,"3475 Ferrell Street",218-353-1459,ClarenceWGoebel@armyspy.com,12/23/1993
13,Michelle,Reed,"1693 Green Gate Lane",443-715-2332,MichelleKReed@fleckens.hu,4/30/2000
14,Louis,Martin,"2993 Yorkshire Circle",252-287-8673,LouisKMartin@dayrep.com,3/16/1945
15,Betty,Lance,"677 Oakwood Avenue",212-635-3373,BettyKLance@gustr.com,9/7/1980
16,Dean,Flood,"2313 Swick Hill Street",980-581-8871,DeanLFlood@einrot.com,12/12/1950
17,Ricardo,Clark,"31 Browning Lane",607-988-3426,RicardoCClark@einrot.com,7/23/1995
18,Devora,Walker,"3661 Godfrey Street",503-617-8335,DevoraCWalker@gustr.com,10/25/1991
19,Lisa,Toups,"3389 Hinkle Deegan Lake Road",607-215-4985,LisaMToups@teleworm.us,9/11/1970
20,James,O'Brian,"331 Neuport Lane",770-378-4374,JamesJOBrian@einrot.com,7/19/1935
21,Marco,Dube,"1779 Atha Drive",661-695-3020,MarcoPDube@rhyta.com,7/25/1939
22,Deborah,Douglas,"680 Stadium Drive",508-297-3773,DeborahDDouglas@teleworm.us,2/12/1959
23,Charles,Hansen,"2875 Euclid Avenue",805-303-4353,CharlesCHansen@dayrep.com,2/9/1999
24,James,Glenn,"4870 Edgewood Road",901-259-9658,JamesMGlenn@teleworm.us,7/7/1990
25,Cindy,Paul,"3156 Big Elm",816-840-3649,CindyJPaul@fleckens.hu,4/23/1994
26,Mary,Hernandez,"945 Hickman Street",630-421-0480,MaryBHernandez@teleworm.us,6/14/1939
27,Nancy,Villarreal,"4347 Todds Lane",210-465-6307,NancyNVillarreal@armyspy.com,9/21/1959
28,Colby,Lincoln,"426 Bryan Street",336-284-1978,ColbyVLincoln@superrito.com,4/8/1996
29,Robert,Retzlaff,"1858 Water Street",925-250-0317,RobertKRetzlaff@superrito.com,6/20/1951
30,Donald,Schmidt,"1925 Mattson Street",503-431-9711,DonaldBSchmidt@rhyta.com,11/27/1952

I've updated the data to have the correct headers, on the csv file

To-DO

  • phase 1 - Setup environment
    • Create folder structure
      • API and Front folder
      • Create Dockers
      • Create initial documentation
  • phase 2 - Design application front
    • Create front views and components
      • Create List component (I choose to do all the logic on the front because it's only a prototype)
        • Implement the pagination on the front
        • Implement the order of the list item
        • Implement the filter by email (I've implemented for name, phone and address too)
      • Create User component
      • Create CreateUser component [No time]
    • Create cypress test [BASIC]
    • Create environment documentation
  • phase 3 - Design application backend
    • Create API design
      • Create User entity
      • Create Value Object of the attributes (just to make sure that they are not empty)
      • Create UserRepositoryInterface
        • getAll
        • create
      • Create UserFsRepository implementation
      • Create Application service
        • GetAllUsers
        • CreateUser
    • Create environment documentation and API documentation

Notes

  • The task: It should be possible to see only one employee: I think it's solved while filtering
  • In a normal situation I would have created 2 repositories that way I could have use github actions as well as husky on commit
  • The front-end app may be slow on boot time thats because of vue-cli system not the design
  • It need more test and testing doubles
    • Repository
    • Use Case

Improves

  • Frontend features
    • Pagination
    • Search
    • Shorting
  • User component has too much responsibility it should 2 or 3 components
  • The user creation should be able to handle multiple errors on creation.
  • Extract testing doubles from the testcases to other files (+ readability)
  • The framework should have DI support using inversify.js
  • Some test are on the API repo and on the Front repo because they solve the same domain problems but on different applications

About

Coding interview

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); GitHub - khru/nailted: Coding interview · GitHub
Skip to content

Repository files navigation

Execute test on push

Environment documentation

Tu run this project you can use the make command

Creating your development environment

Pre-requirements

  • make
  • docker and docker-compose

If you don't have the make command on your system you may have to install it first

sudo apt-get install build-essential

After this if you are on a Linux machine you can run the command make pre_requirements which will install docker and docker-compose for you

Run the environment

Run the following commands

  • cp .env.example .env or touch .env: because the Makefile needs to have the file
  • make permissions: To grant permissions to the .sh scripts
  • make env/create: Create .env files with the development values
  • make run: To start the application

You might want to see the logs to know if the application is running make log/api: To see the logs on the API make log/front: To see the logs on the front

Entry points

👀 If you have any application running on ports 80 or 3000. Stop them and run again the docker containers or change the configuration on the .env files and run the containers again

Task

Javascript developer challenge
The company has all the employee’s information in a .txt file and they want to create a small
SPA that consumes an API that makes the .txt easy to read.
In order to do that they want to implement the next actions:
- It should be possible to list all the employees: It should have pagination, sort by name and
surname and filter by email.
- It should be possible to create a new employee.
- It should be possible to see only one employee.
All the actions must be implemented in the front, that communicates using API REST with
the backend. The backend will use the .txt file as database.
Requirements:
- The server side should be done in node.js.
- Typescript should be used.
- Choose in both (backend and frontend) the frameworks you feel more comfortable, it
is not expected that you write everything by your own, better that you use the tools
you prefer to make it easy and simple (also styling, do not need to write your own
framework in this task).
You can share a git repository with us, or share the project in the way you prefer.
The file attached follows the next format: id, name surname, address, phone, email,
birthdate.

Data

id, name, surname, address, phone, email, birthdate.
1,Della,Cox,"4945 Lucky Duck Drive",412-862-8457,DellaDCox@superrito.com,10/12/1985
2,Walter,Jeske,"495 Rafe Lane",662-729-8758,WalterJJeske@armyspy.com,3/15/1951
3,Ron,Plaza,"4738 Woodside Circle",850-868-3521,RonAPlaza@dayrep.com,3/30/1990
4,Emma,Kwak,"4190 Tully Street",313-651-6614,EmmaAKwak@cuvox.de,3/12/1940
5,Jimmy,Smith,"3839 Fulton Street",304-405-5250,JimmyTSmith@jourrapide.com,2/25/1953
6,Cecilia,Temple,"4187 Arrowood Drive",904-495-3469,CeciliaGTemple@gustr.com,8/24/1987
7,Ruth,Story,"3474 White Oak Drive",816-761-4637,RuthPStory@dayrep.com,11/28/1963
8,Brenda,Reynolds,"1447 Viking Drive",740-782-7580,BrendaRReynolds@superrito.com,11/25/1955
9,Rene,Lewis,"2683 West Drive",312-495-7822,ReneSLewis@dayrep.com,6/22/1977
10,Dale,Ward,"4246 Rogers Street",513-587-4936,DaleCWard@superrito.com,7/13/1964
11,Pamela,Gilman,"496 Ritter Avenue",586-722-0839,PamelaMGilman@einrot.com,7/18/1935
12,Clarence,Goebel,"3475 Ferrell Street",218-353-1459,ClarenceWGoebel@armyspy.com,12/23/1993
13,Michelle,Reed,"1693 Green Gate Lane",443-715-2332,MichelleKReed@fleckens.hu,4/30/2000
14,Louis,Martin,"2993 Yorkshire Circle",252-287-8673,LouisKMartin@dayrep.com,3/16/1945
15,Betty,Lance,"677 Oakwood Avenue",212-635-3373,BettyKLance@gustr.com,9/7/1980
16,Dean,Flood,"2313 Swick Hill Street",980-581-8871,DeanLFlood@einrot.com,12/12/1950
17,Ricardo,Clark,"31 Browning Lane",607-988-3426,RicardoCClark@einrot.com,7/23/1995
18,Devora,Walker,"3661 Godfrey Street",503-617-8335,DevoraCWalker@gustr.com,10/25/1991
19,Lisa,Toups,"3389 Hinkle Deegan Lake Road",607-215-4985,LisaMToups@teleworm.us,9/11/1970
20,James,O'Brian,"331 Neuport Lane",770-378-4374,JamesJOBrian@einrot.com,7/19/1935
21,Marco,Dube,"1779 Atha Drive",661-695-3020,MarcoPDube@rhyta.com,7/25/1939
22,Deborah,Douglas,"680 Stadium Drive",508-297-3773,DeborahDDouglas@teleworm.us,2/12/1959
23,Charles,Hansen,"2875 Euclid Avenue",805-303-4353,CharlesCHansen@dayrep.com,2/9/1999
24,James,Glenn,"4870 Edgewood Road",901-259-9658,JamesMGlenn@teleworm.us,7/7/1990
25,Cindy,Paul,"3156 Big Elm",816-840-3649,CindyJPaul@fleckens.hu,4/23/1994
26,Mary,Hernandez,"945 Hickman Street",630-421-0480,MaryBHernandez@teleworm.us,6/14/1939
27,Nancy,Villarreal,"4347 Todds Lane",210-465-6307,NancyNVillarreal@armyspy.com,9/21/1959
28,Colby,Lincoln,"426 Bryan Street",336-284-1978,ColbyVLincoln@superrito.com,4/8/1996
29,Robert,Retzlaff,"1858 Water Street",925-250-0317,RobertKRetzlaff@superrito.com,6/20/1951
30,Donald,Schmidt,"1925 Mattson Street",503-431-9711,DonaldBSchmidt@rhyta.com,11/27/1952

I've updated the data to have the correct headers, on the csv file

To-DO

  • phase 1 - Setup environment
    • Create folder structure
      • API and Front folder
      • Create Dockers
      • Create initial documentation
  • phase 2 - Design application front
    • Create front views and components
      • Create List component (I choose to do all the logic on the front because it's only a prototype)
        • Implement the pagination on the front
        • Implement the order of the list item
        • Implement the filter by email (I've implemented for name, phone and address too)
      • Create User component
      • Create CreateUser component [No time]
    • Create cypress test [BASIC]
    • Create environment documentation
  • phase 3 - Design application backend
    • Create API design
      • Create User entity
      • Create Value Object of the attributes (just to make sure that they are not empty)
      • Create UserRepositoryInterface
        • getAll
        • create
      • Create UserFsRepository implementation
      • Create Application service
        • GetAllUsers
        • CreateUser
    • Create environment documentation and API documentation

Notes

  • The task: It should be possible to see only one employee: I think it's solved while filtering
  • In a normal situation I would have created 2 repositories that way I could have use github actions as well as husky on commit
  • The front-end app may be slow on boot time thats because of vue-cli system not the design
  • It need more test and testing doubles
    • Repository
    • Use Case

Improves

  • Frontend features
    • Pagination
    • Search
    • Shorting
  • User component has too much responsibility it should 2 or 3 components
  • The user creation should be able to handle multiple errors on creation.
  • Extract testing doubles from the testcases to other files (+ readability)
  • The framework should have DI support using inversify.js
  • Some test are on the API repo and on the Front repo because they solve the same domain problems but on different applications

About

Coding interview

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages