Giter Club home page Giter Club logo

kowalla-backend's Introduction

Kowalla API

API Overview

This API is built using a standard structure of models, routes, and controllers.

The backend database is using MongoDB, with most items being tracked by storing IDs of two other objects, such as the Subscription object, which would have a profileId to indicate what user subscribed, and a space or project ID to indicate where they subscribed to. Models are built using Mongoose, and mongoose-unique-validator to enforce the requirements placed on them.

Routes are organized by the areas that actions take place in, so for example you'll find the upvote routes within the "comment_routes" file. There may be a few outliers, but most routes should follow this standard.

The controllers are separated out and should mostly pertain to the action they're referring to, unless a more complex user action is occurring.

Hazards:

  • There may be lots of comments and code in here that hasn't been refined or removed. In the front-end, I've spent a bit more time removing code that is no longer used, and doing cleanup along the way. The backend has not received the same level of treatment.
  • There is no global error handling wrapper besides the wrapper for unauthorized requests, so some functions are inconsistent in how they handle errors.
  • Not to lay blame, but to lay a bit of blame, my former partner had some convoluted naming conventions, so in some areas there may be some variable naming and function naming that isn't the most intuitive. Webstorm should help with that, but it can still be annoying.

kowalla-backend's People

Contributors

aleckhoury avatar tobthecreator avatar kevinwritescode avatar aceablealec avatar

Stargazers

 avatar

Watchers

 avatar

kowalla-backend's Issues

Consider uniform API response

Consider creating a uniform API response {isSuccess, errorList, body}. You are fully restful but that puts a lot of strain on the front end to determine and display errors. That may be where you want that processing to be, but I find it more useful on the backend which frees up lesser devices(Phones) from more processing.

Use Throng for better resource utilization

JS is not multithreading. It uses a non-blocking IO. If you want to get the most out of the hardware you are using in Heroku or wherever, you will want to start a copy for each thread. The throng library is super good at that. You can look at CXI for an example.

Consider using Express.Router

Using express.router to control your routing will give you more options and much more control. It is also easier to navigate as a developer. Consider a separate routes index file as well instead of list at the head of the main start script.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.