Dependency injection is a programming technique that makes a module independent of its dependencies. This enables you to replace dependencies without changing the module that uses them.

To illustrate Dependency Injection, we’ll build an API with the following endpoints

  1. GET /post: Gets all posts
  2. POST /post: Creates a post

and structure the API in the following way:

  1. Datasource — persistence implementation using third party modules.
  2. Repository — decouple application from persistence: has a datasource dependency.
  3. UseCase — business logic: has a repository dependency.
  4. Presentation — routes: has a use-case dependency.

1. PostDataSource


Photo by StellrWeb on Unsplash

Sources: The Accounting Game, Investopedia

Accounting has always been a mystery to me ever since school. The very term accounting give me the shivers. Why though? Is it because of the unknown?, the strange terms and phrases? And yet we all need to know a little accounting. Why? Accounting is the language of business and we all are do business in one way or another. And like with all languages we need to learn it to communicate. This blog will aim to provide the basics of monitoring the performance of your business, in particular, the balance sheet and income statement…


Photo by Tobias Fischer on Unsplash

sources: MongoDB, DynamoDB, the Internet.

When people use the term “NoSQL database”, they typically use it to refer to any non-relational database. Some say the term “NoSQL” stands for “non SQL” while others say it stands for “not only SQL.” Either way, most agree that NoSQL databases are databases that store data in a format other than relational tables.

A common misconception is that NoSQL databases or non-relational databases don’t store relationship data well. NoSQL databases can store relationship data — they just store it differently than relational databases do. …


Photo by K. Mitch Hodge on Unsplash

We’ll use the Fake Online REST API (https://jsonplaceholder.typicode.com/) to fetch a list of posts and print the first post in the list

Typescript (Web Projects)

SwiftUI (iOS)

Kotlin (Android)


We’ll build a counter app to show hot module reloading while maintaining state using webpack-dev-server or express to update the modules

React Hot Loader with Web Dev Server

Create Project

proj/
├─ dist/
├─ .babelrc
├─ package.json
├─ webpack.config.js
└─ src/
└─ assets/
└─ index.html
└─ css/
└─ js/
└─ img/
└─ fonts/
└─ components/
└─ pages/
└─ services/
└─ App.js
└─ index.js

Initialise Project Folder

npm init -y

Install Development Dependencies

npm i -D \
webpack-dev-server \
webpack \
webpack-cli \
babel-loader \
@babel/core \
@babel/preset-env \
@babel/preset-react \
html-webpack-plugin

Include .babelrc file to configure babel compilation for this project

{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
}

Install Application Dependencies

npm i -S react react-dom react-hot-loader

Create src/assets/index.html

Create the react application with react-hot-loader

App.js
index.js

Configure webpack through a webpack.config.js file

Add a “dev” and “build” script to the package.json

...
"scripts": {
"dev": "webpack-dev-server"…


Photo by Pavan Trikutam on Unsplash

WebSocket is a computer communications protocol, providing full-duplex communication channels over a single TCP connection. The WebSocket protocol enables interaction between a web browser (or other client application) and a web server with lower overhead than half-duplex alternatives such as HTTP polling, facilitating real-time data transfer from and to the server.

  1. Create WSS Server (ws server)
  2. Connect Flutter application to Socket server
  3. Run the server on your favourite Server (create a wss server)

1. Create a WSS Server

I’ve created a WebSocket server to run on port 5556 server with the following code.

server.js

Let’s run the server locally:

$> node server.js

To test the…


Bottom Navigation Bar is a component that makes it easy to explore and switch between the top-level view in single click or tap.

  1. Create Flutter Project
  2. Create Screen
  3. Create Navigation Container

1. Create Flutter Project

$> flutter create --org com.yourdomain navexample

2. Create Screen

3. Create Navigation Container (main.dart)


Photo by SpaceX on Unsplash

Create a Firebase Serverless API with Swagger UI

Install Firebase-tools

npm i -g firebase-tools@latest

Initialise Project


Here I build an API CRUD contacts application.

Photo by John Barkiple on Unsplash

App Structure

View —> Bloc — > Repo — > Network

Repository

I’ll be doing the following operations:

  1. Loading all contacts
  2. Create new contact
  3. Update existing contact
  4. Deleting contact


We are going to create a React Web Application in the following way:

  • Create Project
  • Install Dev Dependencies
  • Install Dependencies
  • Configure Babel
  • Style App
  • State Management
  • Create index.js
  • Create app.js
  • Configure Webpack
  • Add npm Scripts
  • Dev, Build and Serve Production

Create Project

$> mkdir webpackquickly
$> cd webpackquickly
webpackquickly $> npm init -y

Install Dev Dependencies

webpackquickly $> npm i -D webpack webpack-cli style-loader css-loader file-loader html-webpack-plugin clean-webpack-plugin webpack-dev-server http-server @babel/core babel-loader @babel/preset-env @babel/preset-react

Install Dependencies

webpackquickly $> npm i -S react react-dom

Configure Babel

Add .babelrc file

{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
}

Styling

We can implement css styling with css file. Let’s create a style.css file.

src/style.css

Paul Allies

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store