/Linx-Fullstack-Test

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Linx-Fullstack-Test

Practical test submitted to © Linx 2021 for a Junior Developer position.

Dependencies

package.json

"dependencies": {
    "body-parser": "^1.19.0",
    "consign": "^0.1.6",
    "ejs": "^3.1.6",
    "express": "^4.17.1",
    "express-session": "^1.17.1",
    "express-validator": "^6.10.0",
    "jquery": "^3.5.1",
    "jsdom": "^16.4.0",
    "line-reader": "^0.4.0",
    "mongodb": "^2.2.9",
    "node-fetch": "^2.6.1"
  }
Plugin README
body-parser body-parser/README
consign consign/README
ejs ejs/README
express express/README
express-session express-session/README
express-validator express-validator/README
jquery jquery/README
jsdom jsdom/README
line-reader line-reader/README
mongodb mongodb/README
node-fetch node-fetch/README

Instructions

  • Download the repository;
  • Download MongoDB on your computer (preferably with MongoDB compass);
  • Connect to MongoDB on localhost, port 27017 (the default one);
  • Run the script on 'Script_PopulateDB' named 'populateDB.js';
  • Run 'npm install' on root directory to install the dependencies;
  • Run Node.js command 'node app' on root directory;
  • Access 'localhost:3000' to use the app.

About the code

  • Many of the codes here could be optimized(looking at you timeouts), but unfortunately I'm not very knowledgeable with async and promises;
  • The only js and css used together with my own is Flickity, an API used for carousels;
  • The MVC architecture was respected and used in most of the project.
  • The project is not 100% functional due to a problem in the catalog controller while calling a model method and other mongodb connection object issues;
  • The data to be used in the APIs(popularity and % of prices) were not found in the database, therefore the queries used were similar to the 'get' method.

APIs Documentation

License

GNU General Public License v3.0