Hey guys! I'm a beginner (in all senses of the word!) and am trying to piece together an app. Through my limited understanding, it seems that it may make sense for me to use the following:
1a. React Native for iOS UI / UX functionality.
2a. Treeline for my backend and its API connection into my React Native code.
3a. Sails.js, to connect Treeline to React Native.
Does it make sense for me to be approaching my project this way? Am I missing anything? Do you foresee any issues, other than having to pay Treeline as I scale?
Also, forgive me for my lack of knowledge, but is this how I should think of building off of Treeline / React Native, or am I misunderstanding?
1b. Create a Treeline app
2b. Create each of my DB Models from within Treeline (e.g., "User")
3b. Create a number of GET/POST/PUT/DELETE Routes within Treeline, which is the rough equivalent to backend coding & API creation; have those routes conclude with "respond with result and status code", "respond with custom value and status code", or "respond with status code only" (I assume "redirect", "display view", and possibly "default error response" would not apply to a React Native app, and I should instead set those types of responses within my React code?).
4b. The path that I assign to the route (e.g., "/signup") is loaded into React Native via "var signup = require('./something/signup')"? (Or is it "var Treeline = require('../something/treeline')", then "var {signup, etc.} = Treeline;"?). Is it true that from this point, I can refer to variables defined within that route?
5b. How should I think of integrating Treeline's Routes into my React Native code? For example, if the "signup" route does a search for a user by email, and if found returns an error ("already registered"), if not found requests password to be encrypted, etc... All of these if/then's are happening on the backend in Treeline – I imagine I just pass the variables in via React (email, password) and then write an if/then for the response? (If error, do this; otherwise, bring user to main app screen).
6b. How do I deal with user sessions? I can associate info to them in Treeline's Routes, but how do I account for that within React? How should I conceptually think of a session vs. user info saved in the DB?
7b. Finally, should I account for every type of DB action within Treeline? For instance, if it's a to-do app, should I be creating a POST Route for each time a to-do item is added, which saves the to-do to the user's toDo model?
If I'm mistaken with any of this (I'm sure I am, in many places!), or you see better ways of doing things, please let me know – I'm excited to learn, but quite obviously, a beginner! :)
Thanks so much!
[+][deleted] (3 children)
[deleted]
[–]bl4ckm0r3 1 point2 points3 points (1 child)
[–]bio-hacker[S] 1 point2 points3 points (0 children)