Coding-Coach / find-a-mentor-api

CodginCoach API
35 stars 36 forks source link

An API for Info Retrieval - Cache on Mobile Apps, slim down Pagination #126

Closed calvinnor closed 4 years ago

calvinnor commented 4 years ago

I see that the /mentors API returns a bunch of "filters" which show Countries, Technologies, Languages. This adds significant overhead per request.

I recommend to create an API which returns the entire list. That way, frontend clients and Mobile Applications can cache this and re-use them when parsing Mentors. Something like:

{ "countries": [ { "id": "AR", "label": "Argentina" }, { "id": "AT", "label": "Austria" }, { "id": "AU", "label": "Australia" }, { "id": "AZ", "label": "Azerbaijan" }, { "id": "BD", "label": "Bangladesh" }, { "id": "BE", "label": "Belgium" }, { "id": "BR", "label": "Brazil" }, { "id": "BY", "label": "Belarus" }, { "id": "CA", "label": "Canada" }, { "id": "CH", "label": "Switzerland" }, { "id": "CO", "label": "Colombia" }, { "id": "CZ", "label": "Czech Republic" }, { "id": "DE", "label": "Germany" }, { "id": "DK", "label": "Denmark" }, { "id": "DO", "label": "Dominican Republic" }, { "id": "DZ", "label": "Algeria" }, { "id": "EG", "label": "Egypt" }, { "id": "ES", "label": "Spain" }, { "id": "FR", "label": "France" }, { "id": "GB", "label": "United Kingdom" }, { "id": "GR", "label": "Greece" }, { "id": "HR", "label": "Croatia" }, { "id": "IE", "label": "Ireland" }, { "id": "IL", "label": "Israel" }, { "id": "IN", "label": "India" }, { "id": "IR", "label": "Iran, Islamic Republic of" }, { "id": "IT", "label": "Italy" }, { "id": "JO", "label": "Jordan" }, { "id": "KE", "label": "Kenya" }, { "id": "LB", "label": "Lebanon" }, { "id": "MA", "label": "Morocco" }, { "id": "MU", "label": "Mauritius" }, { "id": "MX", "label": "Mexico" }, { "id": "NE", "label": "Niger" }, { "id": "NG", "label": "Nigeria" }, { "id": "NL", "label": "Netherlands" }, { "id": "NP", "label": "Nepal" }, { "id": "NZ", "label": "New Zealand" }, { "id": "PE", "label": "Peru" }, { "id": "PH", "label": "Philippines" }, { "id": "PK", "label": "Pakistan" }, { "id": "PL", "label": "Poland" }, { "id": "PT", "label": "Portugal" }, { "id": "RO", "label": "Romania" }, { "id": "RU", "label": "Russian Federation" }, { "id": "SE", "label": "Sweden" }, { "id": "SG", "label": "Singapore" }, { "id": "TR", "label": "Turkey" }, { "id": "TZ", "label": "Tanzania, United Republic of" }, { "id": "UA", "label": "Ukraine" }, { "id": "UG", "label": "Uganda" }, { "id": "US", "label": "United States of America" }, { "id": "UY", "label": "Uruguay" }, { "id": "VE", "label": "Venezuela" }, { "id": "VN", "label": "Viet Nam" }, { "id": "ZA", "label": "South Africa" } ], "languages": [ { "id": "ar", "label": "Arabic" }, { "id": "cs", "label": "Czech" }, { "id": "da", "label": "Danish" }, { "id": "de", "label": "German" }, { "id": "el", "label": "Greek" }, { "id": "en", "label": "English" }, { "id": "es", "label": "Spanish" }, { "id": "fa", "label": "Persian" }, { "id": "fr", "label": "French" }, { "id": "he", "label": "Hebrew" }, { "id": "hi", "label": "Hindi" }, { "id": "hr", "label": "Croatian" }, { "id": "it", "label": "Italian" }, { "id": "kn", "label": "Kannada" }, { "id": "ml", "label": "Malayalam" }, { "id": "mr", "label": "Marathi" }, { "id": "pa", "label": "Panjabi" }, { "id": "pl", "label": "Polish" }, { "id": "pt", "label": "Portuguese" }, { "id": "ro", "label": "Romanian" }, { "id": "ru", "label": "Russian" }, { "id": "sw", "label": "Swahili" }, { "id": "ta", "label": "Tamil" }, { "id": "te", "label": "Telugu" }, { "id": "tl", "label": "Tagalog" }, { "id": "uk", "label": "Ukrainian" }, { "id": "ur", "label": "Urdu" }, { "id": "vi", "label": "Vietnamese" } ], "technologies": [ ".net", ".netcore", "3d", "a11y", "accessibility", "adobe", "ai", "algorithms", "android", "angular", "angular2", "angularjs", "apex", "api", "api-design", "apps script", "architect", "architecture", "arduino", "asp.net", "asp.net core", "automation", "aws", "azure", "backend", "bash", "best-practices", "blogging", "bootstrap", "build", "c", "c#", "c++", "c-sharp", "career", "career advice", "cloud", "codeigniter", "command line", "compassion", "computability", "css", "css-in-js", "d3js", "dart", "data", "data structures", "database", "databases", "ddd", "design", "design system", "design systems", "devops", "distributed systems", "django", "docker", "dotnet", "dotnet core", "e6", "ecommerce", "education", "electron.js", "elixir", "elm", "ethereum", "express", "figma", "firebase", "flutter", "fp", "front-end", "frontend", "full-stack", "fullstack", "functional", "gamedev", "gatsby", "git", "go", "golang", "graphql", "growth hacking", "html", "hugo", "ibm cloud", "inclusion", "integration", "intersystems", "interviews", "intro", "ionic", "ios", "jamstack", "java", "javascript", "jest", "jquery", "js", "kotlin", "kubernetes", "laravel", "leadership", "linux", "lua", "magento", "management", "markup", "mean stack, pwa", "microservices", "mobile", "modern php", "mongodb", "mssql", "mysql", "native", "nestjs", "nextjs", "ngrx", "nodejs", "nosql", "objc", "opensource", "opentype", "operations", "oracle apex", "p2p", "performance", "phoenix fwk", "php", "platform", "podcast", "postgresql", "powershell", "principles", "product", "programming", "prototyping", "pug", "pwa", "python", "quality", "rails", "react native", "reactjs", "redis", "redux", "remote work", "rest", "restapi", "ruby", "ruby on rails", "rust", "rx", "rxjs", "salesforce", "sass", "scalability", "scrum", "search", "security", "selenium", "serverless", "sketch", "sketch plugins", "socket.io", "software-design", "solidus", "speaker", "speaking", "spree", "spring", "sql", "sql server", "sql servers", "start-ups", "stenciljs", "stimulusjs", "svg", "swift", "swoole", "symfony", "sysadmin", "tailwind", "tdd", "teaching", "teamwork", "tensorflow", "terraform", "testing", "tooling", "tsql", "typescript", "ui", "umbraco", "unit testing", "unity", "user experience", "uwp", "ux", "ux/ui", "visual design", "vuejs", "watson", "web", "web automation", "web dev", "web typography", "web-apis", "web-development", "webassembly", "webscraping", "websitedevelopment", "wireframing", "wordpress", "xamarin", "xamarin forms", "xamarin.forms", "xaml" ] } }

crysfel commented 4 years ago

The data returned for the filters is changing based on the results, therefore even if we create a new endpoint to get this data, we will have to call it every time we fetch new results.

However... this will most likely change once we design the new search mentors page

calvinnor commented 4 years ago

Oh, I get it. The filters and countries are a collection of what Mentors themselves have, right? So if you were to only return Android developers, the technology JSON would have just one object.

However a lot of that would be repeated across pages. Would make sense for Mobile apps / frontends to prefetch and cache these. Thanks!