teleren/devto huggingface dataset:
Node Clean Architecture Template
Tags: node, javascript, typescript, architecture
Published: 2022-04-14 13:04:04

## Preface

Writing highly scalable, testable codebases that are easy to maintain is the dream for most engineers and is some of the problems that software architectures aim to solve.

Software architecture serves as a blueprint for a system. It provides an abstraction to manage the system complexity and establish a communication and coordination mechanism among components.

Having worked in many JavaScript and TypeScript codebases throughout my career, I often find that they do not conform to an established architecture which is very different from more established languages such as C# and is why I decided to build this template.

## The template

The template conforms to the Clean Architecture principles and encourages established practices.

### Features

- TypeScript first
- Dependency injection via Awilix
- CQRS (Command Query Responsibility Segregation)
- High test coverage (unit, integration and functional tests)
- Automatic error handling
- Logging
- Versioned APIs
- Swagger
- Prisma ORM

{% github https://github.com/JamieLivingstone/node-clean-architecture %}

## Why clean architecture

Clean architecture is a battle-tested software architecture that offers many benefits.

- **Highly Testable**: Clean architecture is designed with testing in mind
- **Framework Independent**: Doesn’t rely on tools from any specific framework (language agnostic too)
- **Business logic is encapsulated**: Easy to add new entry points to the system (e.g. GraphQL)
- **Database Independent**: The majority of your application will not know or need to know what database it’s drawing from. This means you can adopt a new database with no changes to the majority of the source code
- **Flexible**: Refactoring and maintaining your code will become easier and will demand little effort

Learn more about the architecture by reading [this](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html) blog post by Robert C. Martin (Uncle Bob).
Fixed 'fatal: Couldn't find remote ref refs/heads/gh-pages' after running:git push origin :gh-pages'
Tags: react, ghpages, deployment, webdev
Published: 2022-04-14 12:38:45


 Oh, this is weird :(

-  After a long time, I planned to deploy my react app to github in a different path, so I removed the gh-pages branch from my previously deployed path.
- Then, I tried to my deploy app. 

- Oh, I didn't expect this error should come up.

![Error](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/djf7ndy3eer7x24qq9ox.PNG)-

- I had been trying to fix the issue for a while , but finally a simple trick did work well.

- This is my script which I had it before the error was occurred. 

`  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },`

- I changed only the deploy script from `"deploy": "gh-pages -d build"` to `"deploy": "gh-pages-clean gh-pages -d build"`.

- Then, I tried `npm run deploy`, now the gh-pages cache got removed and ready to capture new changes.

- After that, I changed the deploy script back to normal `"deploy": "gh-pages -d build"`.

- Now, I ran `npm run deploy`, now it worked like a charm :)


![Fixed](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j6fmsv83hkmdjv8kqpir.PNG)
What are your go to podcasts? 🎧
Tags: discuss, podcast, webdev, productivity
Published: 2022-04-14 12:26:33

I, myself have quite a few podcasts I listen to depending on my mood, whether I want to learn something new, I’m going for a walk or generally just want to chill. 

I’ve been recommended nearly all the podcasts I listen to and I’ve learnt a lot from them so I wanted to know what do you listen to? What do you recommend? 🙂 

**I’ll go first,**

Crime Junkie (audiochuck) or The Casual Criminalist (Cloud10 and iHeartPodcasts) - _I’m quite the crime junkie myself and so these are perfect for that. One is more casual than the other but they both really do their research on the cases and tell them in a great way._

Syntax - Tasty Web Development Treats (Wes Bos and Scott Tolinski) or Ladybug Podcast (Emma Bostian, Sidney Buckner, Kelly Vaughn and Ali Spittal). - _These are my two go toos if I want to learn something new, I’ve listened to many of their podcasts about Digital Content, Node.Js, study guides, what’s new in the tech industry. They both have some great material!_

Lastly if I’m feeling historical is Dark History (Audioboom Studios) - _I’ve learnt some great things from this podcast about the darker stories of history that you may not know of or you definitely didn’t get taught in school!_

What about you? 🙂
Assignment of elements of an array
Tags: javascript, programming, beginners, help
Published: 2022-04-14 11:57:30

Hi, I'm not a programming expert, I need a little help.

Using JavaScript, I would like to create an array [5, 6, 7, 8, 9, 10] and then I need a loop that fills me with another array called Role [].

If (array == 5) I randomly want 3 Role elements to have the value "Resistance" and 2 "Spy".
Else if (array == 6) I randomly want 4 Role elements to have the value "Resistance" and 2 "Spy".
Else if (array == 7) I randomly want 4 Role elements to have the value "Resistance" and 3 "Spy".
Else if (array == 8) I randomly want 5 Role elements to have the value "Resistance" and 3 "Spy".
Else if (array == 9) I randomly want 6 Role elements to have the value "Resistance" and 3 "Spy".
Else if (array == 10) I randomly want 6 Role elements to have the value "Resistance" and 4 "Spy".

Thank you in advance.
Thoughts of Learning typescript for the past few weeks
Tags: javascript, webdev, beginners, typescript
Published: 2022-04-14 11:40:19

For the past few weeks, I have been learning Typescript. So, just to understand my learning I want to answer a question about typescripts.

## What is typescript?

According to their [website](https://www.typescriptlang.org/), “TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.” 

Through my learning what I understand is that typescript is an extension of JavaScript. It helps you validate your variables and functions in a better way with faster implementation. Also with typescript, we can handle our errors faster and can detect them very easily. It increases our productivity by adding some additional syntax and by catching errors earlier by our editor. 
![It is JavaScript Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/puijdu5b45io9v5zvviz.png)

In the above screenshot, we can see two-variable declared with the let keyword. later it was changed into different types as "a" to number and "b" to string. Which is completely okay in JS. But in typescript, you need to declare the types so that further changes of value can remain in the same type. Like below.

![Typescript code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yd6mu6lt3nti41lyjcqf.png)

Although in typescript there are some syntax and methods that can convert a variable to multiple types.
About my newly learned technology (Redux toolkit)
Tags: javascript, react, redux, programming
Published: 2022-04-14 11:01:20

At the start of the end-game, I was tasked with learning Redux. The difference between React and Redux was not clear to me for quite some time when I started learning React for the first time. First of all, let's talk about redux. Redux is an open-source JavaScript library for managing the application state. Usually is used with libraries like React or Angular for building user interfaces. This tool can be a means for cleaning up React applications. As a MERN stack developer, I use redux on react. Especially when I have a medium and large project with a lot of reducers and actions, I have probably already decided to keep the action types as constants in the strings using redux, which is a good approach. 

Let's talk about my learning process. I checked the Redux documentation. It was pretty good, actually! For some reason, it just didn’t entirely click for me. I checked a bunch of YouTube videos as well. The ones I found just seemed rushed and not detailed. Then after some days on our course added an advance crash course about redux. Our instructor did a great class about redux. Still, I'm working on it.

I have taken into consideration my struggles. You did fall a few times, but that was okay. earning to walk also had a learning curve to it. However, with a systematic approach to learning, I overcame that.
How to Install Jupyter Lab for Python in Windows?
Tags: beginners, python, jupyter, programming
Published: 2022-04-14 10:57:30

Working with the '**[jupyter](https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html)'** Notebook is familiar to everybody who is engaged in developing through Python. This is an 'iPython' console which is regarded as the best for carrying out data analysis and machine learning related work. The notebook provides easy code execution and displays various graphs and glyphs within the console. Also, it provides the provision to download Python packages within its console and allows users to carry out web scraping related activities. But, what if I tell you that there is more to it that is; there is one cooler version of this 'jupyter' that provides more no. of features than this obsolete one.

Yes, the name of this advanced jupyter is jupyter Lab. It is an extension to the normal jupyter Notebook as it allows users to work in multiple files. This can be elaborated as jupyter Lab provides much functionality that users can access at the same time while working with a notebook like opening the text editor that is provided within jupyter lab, opening Markdown editor, opening the command prompt, python console. This makes jupyter lab more robust and acceptable by Python developers out there. We can even replicate our present iPython notebook into many to view our work more easily.

All the work that we have done can either be saved to our local system or can be saved within the Jupyter lab. So, it acts as a vault in saving our work to access it in the future. Also, this lab comes with a provision to set different themes we like (Dark and White) and also increase and decrease the UI size as per our comfort. These things make this a powerful tool when it comes to performing data analytics related work as well as general Python related development.

So, how to download jupyter Lab for our Windows operating system and how to open the same??? The answer to this question is given below:

# Pre Requisites

- Python
- Pip should be installed within the system.(mostly it will be installed while installing python)
- Good internet connection.

# Installing Jupyter Lab via Python Through Terminal:

The installation steps of this tool are just like other packages that is can be installed through pip.
- Just open your terminal (if your using windows open cmd)
- Just type in the command prompt: 

```
pip install jupyterlab

```
After the installation finishes type  command within the command prompt and wait for the browser to open jupyter lab for you.

```
jupyter lab
   (or)
python  -m jupyterlab

```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d49iiak1t47ofzaprkxq.png)
 


We can install jupyterlab through anaconda, and desktop version also available.

**[click here](https://jupyter.org/try)** to try the jupyterlab 












# Conclusion

We can conclude that Jupyter lab dominates over the normal Jupyter and one must prioritize this rather than going with the Jupyter installation..
Bitcoin Script | Cryptocurrency Exchange Script | Crypto Trading Script
Tags: cryptocurrency, bitcoin, blockchain, startup
Published: 2022-04-14 10:54:38

## How to build cryptocurrency exchange website?


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g52i5v31lvdh18rn20bj.png)

Become an Industry Player and Launch Digital Asset Exchange
Launch a Cryptocurrency Exchange with

1. Cryptocurrency Liquidity
2. Blockchain Wallet
3. Crypto Token

Use the fastest and high secure crypto trading and exchange solution in the world to power and host your own exchange. [Cryptocurrency Exchange Script](https://www.blockchainappsdeveloper.com/cryptocurrency-exchange-script)

Trade Smarter
Our quantitative crypto exchange platform permits traders to build, test, optimize, and deliver trading strategies across, futures, equities, options, functionalities, and cryptocurrencies.

BlockchainAppsDeveloper provides the best [white label cryptocurrency exchange software](https://www.blockchainappsdeveloper.com/cryptocurrency-exchange-script) on the market and the world's best, fastest, high secure, profitable NFT and decentralized finance exchanges are powered by BlockchainAppsDeveloper.
Collaborate with Peers on GitHub
Tags: software, github, learning, webdev
Published: 2022-04-14 10:25:15

If you are working in an organisation where GitHub is used as a source code hosting site, then this post will be a helpful one for you.

Nowadays, as devs, we are following some of the best practices like forking the repository from the main organisation's account, and we come across a situation wherein you want to collaborate with your peer on a feature and you decide to push the code on the same branch.


![Github collaboration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yib9s4xsemw1yve260mm.jpeg)

Some of the commands that would work on the peer's forked repository (Can be followed in this order) :-

```
git remote add theirUsername https://github.com/theirUsername/repoName
```

```
git fetch theirUsername
```
```
git checkout -b myLocalBranch theirUsername/theirBranch
```
```
git add/commit the changes
```
```
git push https://github.com/theirUsername/repoName HEAD:branchName
```
```
git pull https://github.com/theirUsername/repoName branchName
```


Hope this post will help you in better collaboration in a long run.
**_Happy learning !!_**
Step by step guide on Mailchimp integration in laravel
Tags: laravel, mailchimp, tutorial, guide
Published: 2022-04-14 09:47:39



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tw91sks4wifmdf3djz6m.png)

Mailchimp is the most popular email marketing service and can manage the subscribers to your websites and get a newsletter about new content or deals. You can automate the email service using the MailChimp email tool. In this article, we integrate the Mailchimp service into the laravel application.

# Step-by-step guide on Mailchimp integration in laravel:

1. Get Mailchimp API key and audience ID:
Click here to create an account on the Mailchimp platform. If you have an account, follow the step to get API credentials from your account.

[Read More](https://bit.ly/3uDso0v)
HackerRank — Problem Solving — JavaScript — Solve Me First
Published: 2022-04-14 09:31:03

Throughout my undergrad, problem-solving was not my strength. I tried URI Online Judge, solved a few, gave up, and tried again and gave up again.

After working as a software professional for almost two years, I decided to polish and sharpen this skill once again. This time I started with HackerRank and solved a few problems using JavaScript.

On all a sudden, I felt that documenting this whole journey would be great and this will keep me motivated for a longer period of time.

So, here comes the first of many.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2q8gg0tku1hlzx29fhn0.png)

Solution:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m2yxbybbm480lq2dazsz.png)
Conditional statements and loops Practices in Javascript.
Tags: javascript, webdev, programming, tutorial
Published: 2022-04-14 09:17:34

![challenge](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9xwyub4itmfwd6why7mz.png)

---

 
**You’ll learn :**
More about conditional statements if, if else and switch and get better with using them the right way, also you’ll learn when and how to chose one loop statement over others.
Conditional statements :

---

1/ Check a number is even or odd :
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jshljpnf1a9mpw1mk2oa.png)
 
2/ Find the largest between two numbers :
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a7yipg9oe40kgf4whlxm.png)
 
3/ simple switch code

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0g6fwef471mowbac8v8z.png)
 
3.5/ Switch code

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1em3terek1er30zydy31.png)
 

4/ Simple calculator with if else :
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1monlotrqt2w5gjwe4dd.png)
 

5/ Simple calculator with switch :
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c7qfsdemllwfp1cxtwdj.png)
 

**Loops :**
1/ Print the summation of numbers between 0 and 10 :
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sti90j7vzdm8x7jp1vpz.png)
 
2/ Write a code to print numbers from 1 to 10 :
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0tlqvw7zlc2u09pkqcex.png)
 
3/ print only even numbers between 0 and 20
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4jvg9d1wn1kl9fngx4mn.png)
 
4/ simple while loop :
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k3of7l1w3clo7tjlrs61.png)
 
**all in one example :**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lyabas7usidsqwv5fmou.png)

---


References :
https://www.programiz.com/javascript/while-loop , https://www.learn-js.org/en/Loops , https://education.launchcode.org/intro-to-professional-web-dev/chapters/loops/exercises.html , https://www.programiz.com/javascript/for-loop

---
Thanks for reading, and feel free to ask any question about javascript or about this series and i appreciate any feedback to improve My content.
find me on [twitter](https://twitter.com/Osam1010), [github](https://github.com/osama865/) and [my portfolio](http://o-portfolio.netlify.com/).
Loops and Math in C
Tags: c, math
Published: 2022-04-14 09:16:55

I have over the last couple days, been learning more about the basics of C the programming language! Let me recap what I've learned for you.

I have already, similar to my sister (thalia), learned the very basics such as how to use the standard input/output library `#include <stdio.h>` and `printf("Hello, world");`.

To see more about this, please read [Thalia's post](https://dev.to/gamedev/my-simple-programs-3g97).

## loops.c

```C
#include <stdio.h>

int main(void)
{
	for (int i = 0; i < 100; i++) {
		printf("Hello, Jerome. ");
	}
	
	int i = 0;
	
	while (i <= 1000) {
		printf("%d ", i);
		i = i + 1;
	}

	return 0;
}
```

I wrote a `for` loop to print a message 100 times, and a `while` loop to print the numbers from 0 to 1000 using the `%d` format to print integers in decimal.

In the `for` loop, all of the loop control is in one place, whereas in the `while` loop the initializer, test and increment are scattered around the code.

## maths.c

```C
#include <stdio.h>
#include <string.h>

int main(void)
{
	char *star_name = "Proxima Centauri";
	double star_distance_ly = 4.2465;
	double c = 299792458;
	double seconds_in_year = 3600 * 24 * 365.2422;
	double light_year = c * seconds_in_year;
	double star_distance_km = star_distance_ly * light_year / 1000;

	printf("The distance to %s is %.0f km.\n", star_name, star_distance_km);

	return 0;
}
```

This is probably already apparent, but maths is an extremely important part of any programming language, especially if you want to make games. This is why I thought a good next step would be to see if I could make simple calculations through C. I have, again, been watching more Kurzgesagt videos on YT. Inevitably I found many great videos on their channel about space and our universe, this got me wondering about the closest stars to our own.

This little program converts the distance to the closet star from light-years to kilometres. I used `double` variables; these are double-precision floating point numbers. We can print a double with `%f` and rounded off to a whole number with `%.0f` for 0 decimal places.

Next post: [Basic Programming in C](https://dev.to/gamedev/basic-programming-in-c-243b), by Sam
Previous post: [My Simple Programs](https://dev.to/gamedev/my-simple-programs-3g97), by Thalia
Contents: [Game Dev From Scratch](https://dev.to/gamedev/game-dev-from-scratch-2do1)
Developing a Todo app with android integration testing following TDD approach — Part 3 of 3
Tags: android, tdd, programming, codenewbie
Published: 2022-04-14 09:16:06

Why do we never have time to do it right, but always have time to do it over?

First, Solve the problem. Then, write the code.

How do we test the product to find problems that only show up when all the pieces are combined and in the right place?

This is part 3 and the last part of the ongoing series of articles where we keep adding new screens with more complexity to a TODO app.

Part 1 — [How to use TDD effectively to write android integration tests](https://blog.canopas.com/how-to-use-tdd-effectively-to-write-android-integration-tests-5efc7ee48ba8)

Part 2 — [Developing a Todo app with android integration testing following TDD approach](https://blog.canopas.com/developing-a-todo-app-with-android-integration-tests-following-tdd-approach-part-2-55362637a516)

We will start off by adding update TODO functionality and later support for the complete TODO feature.

As usual, we will not focus much on the data part, where will keep saving Todos in the memory using ArrayList, which means it will be erased when you restart the app. That should be fine for our use case as that’s the part we are not focusing on and you can always replace the repository implementation with a real database if you want to persist it.

To continue reading further, [navigate to our blog website](https://blog.canopas.com/developing-a-todo-app-with-android-integration-testing-following-tdd-approach-part-3-of-3-57b41910ad99).
New Journey
Published: 2022-04-14 09:12:59

Hey Guys, this is my first post as I just joined dev.to. So a role model of mine advised me to maybe start writing, as per document my programming journey and I thought: yeah, that's a great idea as it would even push me to learn more regularly even with the other things I'm so busy with (service year...ugh). So here I am, and I'm looking forward to taking you guys along in my journey.
3 Frontend Developers' Must-Have Tools
Tags: webdev, programming
Published: 2022-04-14 09:09:27

1. AnimXYZ. AnimXYZ is a website animation tool that allows you to create, tweak, and compose animations for your website. Using CSS variables, you can create an almost infinite number of unique animations without having to write a single keyframe. You'll save time and have complete control over the movement of your elements. AnimXYZ will bring your website to life with Vue, React, SCSS, and CSS. www.animxyz.com

2. Shaper. This interactive tool will allow you to experiment with various user interfaces while they are live on the website. Typography, color, space, and layering are all examples of this. https://hihayk.github.io/shaper/

3. Theatre.Js. For the web, I created a motion design. Theatre.js is a GUI-based JavaScript animation library. The DOM, WebGL, and any other JavaScript variable are animated. It's essentially a visual editor for animating DOM objects. www.theatrejs.com

See you soon.