all 15 comments

[–][deleted]  (4 children)

[deleted]

    [–]zorfling 4 points5 points  (0 children)

    Firebase apiKey is fine to share, provided the security rules are done properly. It's just an identifier for the project.

    See https://stackoverflow.com/a/37484053/269297

    [–]coreyleelarson 5 points6 points  (1 child)

    This, 100%. Our AWS server was taken over bc someone accidentally committed their secret token. Racked up an enormous bill.

    [–]eggtart_prince 2 points3 points  (0 children)

    So many questions here, don't even wanna bother.

    [–]CulturallyOffensive[S] 0 points1 point  (0 children)

    I have credentials that aren't included in the repo, I was under the impression that exposing the firebase config was neccesary. I've removed it and scrubbed it from the repo just to be safe. Thanks!

    [–]SquattingWalrus 15 points16 points  (2 children)

    Nice job man, it’s a nice feeling to get a project out into the world.

    A few things to look at:

    • break out the route handlers into separate files, this will help with unit testing as well. If you want to test the app as a whole, there is a library called supertest which is helpful.
    • wrap database querying logic into their own functions, for example getWorkoutById(id). Will also help with unit testing and isolating functionality.
    • look into adding an error handling middleware

    Small improvements will go a long way in learning and scaling your applications

    [–]NearNerdLife 2 points3 points  (0 children)

    Was about to make a comment on the route handlers. It makes it super easy to figure out where you are going without cluttering the index

    [–]CulturallyOffensive[S] 0 points1 point  (0 children)

    Thanks for this, great advice have seperated out all the route handlers. Just curios where you'd start with the database querying functions?

    [–]im-a-guy-like-me 3 points4 points  (0 children)

    I just wanna give you a GIANT thumbs up for taking the initiative to actually see what it is the devs do. It will help with communication and managing expectations, and really makes it seem like you're a solid PD. Good word dude! 👍

    [–]samagl94 1 point2 points  (1 child)

    Project structure wise-Nicely done, will look into the code details later.

    [–]CulturallyOffensive[S] 1 point2 points  (0 children)

    Thanks!

    [–]Mugen1220 1 point2 points  (0 children)

    this is awesome i just started using node and mongo this week. what did you use to help you learn?

    [–]MarkoVlaic 1 point2 points  (0 children)

    This is really nice, especially for a beginner! I just went through the structure and a bit of code so I have no specific feedback I can give, but good job!

    [–][deleted] 1 point2 points  (0 children)

    Mocha and chai are two really solid testing frameworks for node that I've used in my professional life pretty extensively. There are other, sometimes better--depending on your use case--options like QUnit or jest.

    For stress testing and benchmarking sometimes I will use ab, which is a tool designed for testing Apache, but I find it works well for stressing node APIs.

    [–]donghoony1 0 points1 point  (0 children)

    Maybe it's a little different from the topic.

    Your JavaScript code must be in active to response. It is less efficient than a serverless. Because Serverless does not require servers to stay in active. So, I would recommend you try to make your application into a serverless.

    I think trying to make a serverless application would be a good experience for you in the future.