Learnings in the journey towards Node.js from iOS developer — Part 1

Kiran Sarella
2 min readJun 13, 2022

(Useful for newcomers who want to try backend ..mostly Vapor)

hmm.. where to start?

If we did all the things we are capable of, we would literally astound ourselves. — Thomas A. Edison

..as an iOS developer we knew doing UI, local storage, push notifications, handling apis content, apple frameworks and more..

..as a node.js developer what keywords may exists?

(tip: Indepth learning of each below concept should go in parallel.)

  1. we need a local server to run our code.. so install Node.js
  2. Have to learn javascript (don’t focus on language, we can learn while writing code, just basic syntax is enough)
  3. Which editor have to use? VSCode (we can use Xcode with Vapor in near future 😉)

next..

4. have to choose a web framework.. why?

web framework contains libraries that handles core things (similar to our Foundation, UIKit)

Chosen Express (there are many others..) based on the web framework our project folders structure will be vary..

ok.. how to install this express framework?

5. via npm

what is npm?

node package manager — contains all frameworks, open source libraries in the form of packages. (similar to our new SPM)

So, learn npm commands to install, remove, manage dev/global dependencies in your project (package.json), also learn npm commands to create a project, to start, stop the app.

6. have to learn basics of HTTP — Protocol, Restful API — concept

why? to construct HTTP APIs

(example to create a new user api: POST https://company.in/stage/api/v1/user)

HTTP methods (get, post, put, delete..)

HTTP response status codes (200, 201, 404…)

HTTP Headers (later..)

(thanks to this diagram creator)

listout required apis in google sheets as below

ex: listing apis in a google sheet

worth watching this beautiful presentation — thanks to Mohamed Taman

Effective Design of RESTful APIs

7. Prepare api documentation using apiary or swagger

for each api, define

  • route(api endpoint, http method)
  • request, response formats with proper status codes

mostly response format contains one success format (with status 200 or 201..) and multiple error formats (401, 404..)

(cont..)

suggestions are welcome 😊

have a perfect circadian rhythm day

--

--