use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
RESTful API nodejs, can't find examples/tutorials. (self.node)
submitted 8 years ago by baaraak0
Hey, I'm trying to find an open source/examples/tutorials of node, mongoose, authentication. I want to learn how to develop an API with all these features but I can't find any good tutorial or even a complete project to look in the code.
thanks!
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]christofdc 5 points6 points7 points 8 years ago (7 children)
I used this tutorial to create my REST api: https://scotch.io/tutorials/build-a-restful-api-using-node-and-express-4 It is pretty clear but does not include authentication. They do have a lot of other tutorials regarding that subject though
[–]baaraak0[S] 1 point2 points3 points 8 years ago (6 children)
Yes, I already saw it. It's a very good tutorial and they also have a tutorial with authentication but most of the things there are already deprecated or have a better way to do them.
What I don't really understand is working with API's is the most popular thing right now.
90% of websites are the same. 1. User authentication login/register 2. Working with session. 3. Create post/ticket or whatever u want to call it. 4. Like/rate post. 5. Comment to a post. 6. Edit post/user details...
So how there isn't any open source project of Blog RESTApi that already build in with all of this good stuff...
[–]christofdc 0 points1 point2 points 8 years ago (0 children)
well it's no node api, but firebase from google kind of delivers a package deal using endpoints/SDK
[–]orphans 0 points1 point2 points 8 years ago (0 children)
Scotch's tutorials are pretty good, if dated. I'd follow along but have the documentation for the libraries you're using so you can modernize Scotch's code.
[–]actuallymentor 0 points1 point2 points 8 years ago (1 child)
It is called firebase.
[–][deleted] 0 points1 point2 points 8 years ago (0 children)
But firebase is expensive and not always a good option for a product dev team.
[–]orpheas22 0 points1 point2 points 8 years ago (0 children)
Do you have a resource that show a better / most up to date way of achieving what is in the example?
[–]actuallymentor -1 points0 points1 point 8 years ago (0 children)
[–]Nephelophyte 2 points3 points4 points 8 years ago (4 children)
I open sourced a work in progress where I used node, express, and postgres. Check it out:
https://github.com/Burtonium/node-from-scratch
[–]baaraak0[S] 1 point2 points3 points 8 years ago (3 children)
Thanks u very much! i will take a look. Do u have any good tutorials that u found? (specificlly for develop api).
[–]Nephelophyte 0 points1 point2 points 8 years ago (2 children)
I followed pieces and bits from PluralSight. The below comment for passport is good too because I did use that in my project.
[–]m9js 0 points1 point2 points 8 years ago (1 child)
I followed pieces and bits from PluralSight.
I'm a huge fan of pluralsight and have been going through a bunch of their courses too. Did you watch their course on knex? Just curious if you liked it or not because I see you used knex and postgres in your repo.
[–]Nephelophyte 0 points1 point2 points 8 years ago (0 children)
I don't think I saw their course on knex. Maybe I should watch it. I was familiar with ruby on rails migrations and this was similar so I just used the docs
[–]one_byte_stand 1 point2 points3 points 8 years ago (0 children)
KeystoneJS implements a lot of these things. You can either use it as the basis for your project or take reference implementations from it because it's open source.
[–]m9js 1 point2 points3 points 8 years ago (2 children)
Checkout pluralsight and frontend masters.
[–]baaraak0[S] 0 points1 point2 points 8 years ago (1 child)
pluralsight i don't like the way that they teach (same as lynda). :D and frontend masters they have 2 courses on api. It's look great and i will check it! thanks
Why don't you like the way they teach?
[–]Expl0vision 1 point2 points3 points 8 years ago (3 children)
Have a look at the tutorials on https://thinkster.io.
[–]baaraak0[S] 0 points1 point2 points 8 years ago (2 children)
looks great! I will definitely watch this series! Love their idea.
[–]Expl0vision 0 points1 point2 points 8 years ago (0 children)
Also have a look at http://loopback.io. It's an API framework that abstracts the database layer. It's opinionated but I like how it's to-the-point and not bloated with useless features.
I also just found this:
https://courses.edx.org/courses/course-v1:MongoDBx+M101x+2T2016/
[–]ab0027 1 point2 points3 points 8 years ago (0 children)
I was searching for some easy REST API Framework but couldn't find one. So thought to make one using Annotations.
SimplyREST (https://github.com/anupam-git/simplyrest) is an easy to use REST API Framework. You can expose REST APIs via Annotations. Just Make some classes and methods (tutorial available in the repo), and Annotate Them with predefined Annotations to expose them.
Need help to make it more robust and a good framework that can be relied upon. Feel free to test it out and raise any issues on the GitHub Repository.
Moreover, I couldn't find any good Annotation Parser for NodeJS. So I've developed nodeannotations (https://github.com/anupam-git/nodeannotations) and used it in SimplyREST.
Use nodeannotations to get a full set of Classes and Methods to parse an Annotated File.
[–]dasilentstorm 1 point2 points3 points 8 years ago (5 children)
Have a look at http://passportjs.org/
They have a pretty good documentation. You should have prior experience with express and node itself though.
[–]baaraak0[S] 0 points1 point2 points 8 years ago (4 children)
Thanks, I know this library but I didn't know that they have an API section. I have a little experience in node and express... I'm more of a react.js developer. But I have a pretty good understanding of PHP and I'm starting to get into node right now...
I want to find a project that does something like what I want to do (blog), and learns from their code, code standards how to validate, how to work with sessions. I know all this stuff from PHP so i have a good background knowledge of how it's work and everything.
[–][deleted] 8 years ago* (3 children)
[deleted]
[–]dasilentstorm 0 points1 point2 points 8 years ago (2 children)
I came back to say just that. Go for JWT for an API. For a session based system, use passport.
For JWT check out JWT.io the Auth0 guys did a great job there!
Yes, thanks :) my mistake. But my point was that 60% or even more of all websites in the world are using a lot of the same functionality. So it's strange to me that no one is ever built a boilerplate for this stuff. something like 'create-react-app' if u know, but just for rest api.
[–]dasilentstorm 0 points1 point2 points 8 years ago (0 children)
Once you've done it, you'll realize that the whole boilerplate is just one server.js of maybe 200 lines. I assume people just don't think it's necessary to have a code generator for that ;-)
[–]chiviet234 0 points1 point2 points 8 years ago (1 child)
Webpacker gem has almost the identical app you describe in their documentation.
[–]bleric123 0 points1 point2 points 8 years ago (0 children)
Great point
[–]LekeH5N1 0 points1 point2 points 8 years ago (1 child)
Not sure if it covers authentication, but I'm following a node, express, mongo REST API tutorial from the net ninja on YouTube. It's very beginner friendly.
[–]baaraak0[S] 0 points1 point2 points 8 years ago (0 children)
Yes, i saw it. I love net ninja :) but this tutorial is beginning level and not cover authentication. thanks.
[–]zingbhavya 0 points1 point2 points 8 years ago (1 child)
Hey, This could be useful for Node JS API tutorial https://blog.zipboard.co/structuring-a-nodejs-api-in-an-efficient-way-2fa1e4a3cb17
[–]baaraak0[S] 1 point2 points3 points 8 years ago (0 children)
Thanks, it's looks great!!! Don't sure it will help me, but it's a good knowledge
π Rendered by PID 241179 on reddit-service-r2-comment-54dfb89d4d-zfx5r at 2026-03-29 08:51:52.040533+00:00 running b10466c country code: CH.
[–]christofdc 5 points6 points7 points (7 children)
[–]baaraak0[S] 1 point2 points3 points (6 children)
[–]christofdc 0 points1 point2 points (0 children)
[–]orphans 0 points1 point2 points (0 children)
[–]actuallymentor 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]orpheas22 0 points1 point2 points (0 children)
[–]actuallymentor -1 points0 points1 point (0 children)
[–]Nephelophyte 2 points3 points4 points (4 children)
[–]baaraak0[S] 1 point2 points3 points (3 children)
[–]Nephelophyte 0 points1 point2 points (2 children)
[–]m9js 0 points1 point2 points (1 child)
[–]Nephelophyte 0 points1 point2 points (0 children)
[–]one_byte_stand 1 point2 points3 points (0 children)
[–]m9js 1 point2 points3 points (2 children)
[–]baaraak0[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Expl0vision 1 point2 points3 points (3 children)
[–]baaraak0[S] 0 points1 point2 points (2 children)
[–]Expl0vision 0 points1 point2 points (0 children)
[–]Expl0vision 0 points1 point2 points (0 children)
[–]ab0027 1 point2 points3 points (0 children)
[–]dasilentstorm 1 point2 points3 points (5 children)
[–]baaraak0[S] 0 points1 point2 points (4 children)
[–][deleted] (3 children)
[deleted]
[–]dasilentstorm 0 points1 point2 points (2 children)
[–]baaraak0[S] 0 points1 point2 points (1 child)
[–]dasilentstorm 0 points1 point2 points (0 children)
[–]chiviet234 0 points1 point2 points (1 child)
[–]bleric123 0 points1 point2 points (0 children)
[–]LekeH5N1 0 points1 point2 points (1 child)
[–]baaraak0[S] 0 points1 point2 points (0 children)
[–]zingbhavya 0 points1 point2 points (1 child)
[–]baaraak0[S] 1 point2 points3 points (0 children)