Skip to content

Angular and Express implementation of restcountries.com API data as part of a technical challenge.

Notifications You must be signed in to change notification settings

NiMusco/challenge-countries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🌎 Countries Challenge

Angular Express.js

demo


🔐 Datastore:

Project is using MySQL as default datastore.
See config/datastores.js:

default: {
  adapter: 'sails-mysql',
  url: 'mysql://root@localhost:3306/challenge_countries',
},

Refer to Sails :: Waterline ORM for more info.


🔌 Installation

  • Run npm start which automatically...
    • runs ng serve to build and serve Angular on port 4200.
    • runs sails lift to lift Express (Sails.js) API on port 1337.

♻️ Cron Strategy:

Cron runs every 24hs with node-cron. (every 20 seconds in this demo)

This analizes the differences between the existing data and the new one,
updating only what is necessary while ensuring no loss of data during the process.

cron


💂‍♂️ Security:

CORS is enabled, backend only accepts requests from http://localhost:4200.
See config/security.js:

cors: {
  allRoutes: true,
  allowOrigins: ["http://localhost:4200"],
  allowCredentials: true,
  allowRequestHeaders: "content-type, authorization"
}

Other considerations:
  • Filtering by name, capital, and/or continent are performed server-side.
  • Pagination and ordering are handled client-side.

👋 That would be it.

About

Angular and Express implementation of restcountries.com API data as part of a technical challenge.

Topics

Resources

Stars

Watchers

Forks