Steps for Implementing a More Robust Backend Development Architecture Part2

In part 1, we mainly looked at laying out the groundwork for the backend project, including setting up console logging (morgan), eslint, installing various dependencies, configuration for MongoDB connection, util files such as logger, creating the models I needed, coding the express app (app.js), and finally, populating the database with some initial data to work with. In this part, I’ll begin by documenting how I go about creating and testing the routes. Then, we’ll look at middleware and error handling. Finally, I’ll connect the frontend to the backend to make sure that all the data is being pulled correctly. ...

September 23, 2021 · 4 min · Lei

Steps for Implementing a More Robust Backend Development Architecture (Part 1)

You’ve arrived at the moment where your project is getting serious and you need to begin coding some serious backend. This guide will get you started. Goal of Backend Restructure Goal of the development project is to get the backend to look like this: Backend architecture: Index.js App.js Routers: Streams Router Trades Router User Router Login Router Models Trades Model Streams Model User Model Utils Middleware Logger config.js Tests setting up test environment Laying the groundworks Step 1: Take stock of current project dependencies and structure Examine package.json to see what dependencies it currently have. Examine the project folder structure and files to check where is the backend mostly stored. For a simple express server, it is possible that all the routes, middleware, models, are stored in index.js. ...

September 22, 2021 · 8 min · Lei

Steps for Setting Up the Backend During Development

Alrighttttt I am about to embark on some backend development for my Streams app. This document acts as a kind of guide for future development processes, as the exact processes are rather rusty in my mind. I am starting out from completely no backend on my simple React app, with a couple of frontend components. I think the first thing I need to do is to set up an express server. ...

August 25, 2021 · 3 min · Lei