Coder Social home page Coder Social logo

tericcabrel / blog-tutorials Goto Github PK

View Code? Open in Web Editor NEW
327.0 7.0 264.0 6.35 MB

Sample code of my blog tutorials

Home Page: https://blog.tericcabrel.com

JavaScript 11.51% TypeScript 43.04% Shell 0.26% Java 28.87% HTML 3.94% Handlebars 1.40% Dockerfile 0.43% CSS 2.67% TeX 0.08% MDX 7.79%
typescript blog-tutorials mongodb spring-boot java jwt nodejs

blog-tutorials's Introduction

blog-tutorials

Set up a Node.js project with Typescript, ESLint and Prettier

Use MongoDB with a Node.js application

Create a REST API with Node.js, Express, MongoDB and Typescript

Upload file to Google Drive with Node.js

Upload files to the Node.js server with express and Multer

Apply conventional commit style on your project with commitlint

Minimal SpringBoot starter for a backend web application

Document a Node.js REST API with Swagger and Open API

Using MongoDB with Spring Boot project - Part 1

Generate a PDF in a Node.js application with Puppeteer

Write better bash scripts with Zx

Using MongoDB with Spring Boot project - Part 2

Using Docker and Docker-compose with Node.js and MongoDB

Validate Request Body and Parameter in Spring Boot

Write custom validator for request body in Spring Boot

Using Web scraping in Node.js to build an API to browse programming languages

Using Prisma ORM to build a Node.js application with MySQL

Send email in Spring Boot with Thymeleaf and Mailgun

Setup ZSH, autosuggestion, and syntax highlight on Ubuntu Server

Set up a personal blog with Ghost and Docker

How to deploy a AWS Lambda container with Docker

Create a GraphQL application with Node.js and Apollo server 3

Handle custom datatype in a GraphQL application with Node.js

Create and deploy a Lambda Function in Node.js with AWS CDK

Set up a React project with Typescript, Hot reload and Webpack

Create a Java project using an external dependency with Maven

Deploy a Node.js application with PM2 and Nginx

Handle database migrations in a SpringBoot application with Flyway

Create a replica set in MongoDB with Docker Compose

Implement Server-Sent Events in Node.js

Handle MongoDB transactions in Node.js using Mongoose

Using Typescript and Esbuild to deploy a Lambda Function with AWS CDK

Discover ULID: the sortable version of UUID

Read CSV file in Node.js and Typescript

Grammarly: The professional tool writers need

Using PlanetScale and TypeORM to build a Node.js REST API

Understand the shadow database feature of Prisma ORM

Upload a file to a server with SpringBoot

Protect your API routes in Next.js with Middleware

Deploy Forem on AWS and build your tech community

Deploy Forem on Digital Ocean and build your tech community

Handle Many-To-Many relationship with JPA in a Spring Boot application - part 1

Handle Many-To-Many relationship with JPA in a Spring Boot application - part 2

Generate a CSV file from data using Node.js

Deploy a Java Lambda Function and API Gateway with AWS CDK

Build an OTP in Node.js using Twilio SMS API and Redis

Build a newsletter form subscription using React and the ConvertKit API

Create a Spring Boot project from IntelliJ

Build a Web application with Spring Boot and Tailwind CSS

Deploy a Spring Boot application JAR file with Nginx reverse proxy

Deploy a Spring Boot application with Docker and Nginx Reverse Proxy

Write data in an Excel file using Node.js and Typescript

Read an Excel file in Node.js and Typescript

Connect a Node.js application with MongoDB using Prisma

Create a Docker image of a Next.js application

Data Caching in a Spring Boot application with Redis

Handle a Many-to-Many relationship with Prisma and Node.js

Caching data in Node.js application with Redis

Build a Docker image of a Node.js application

Configure rate limiting on a Node.js REST API with Express

Make HTTP requests in a Java application using Spring RestTemplate

Build a REST API With Spring Boot and MySQL

Document a Spring Boot REST API with Swagger and Open API

Send email in Node.js using Handlebars and Amazon SES

Using GraphQL union type in a Node.js application

Schedule background tasks in Node.js with node-cron

Validate request body and parameter in a Node.js Express API

My year 2022 in review

Load balancing a Node.js application with Nginx

How to Scrape Zillow using Node.js

Manage your Docker container with Docker Swarm

**Install RabbitMQ on a Ubuntu Server 22.04 **

Asynchronous communication between Node.js applications using RabbiMQ

Publish a message to many Node.js applications using RabbitMQ

Send and receive messages from a Spring boot applications using RabbitMQ

Get the user IP address in a Node.js application with Express

How to scrape amazon.com with Node.js

Install Node.js using NVM

Handle Database data integrity with the Prisma ORM

Perform Web scraping in Node.js using a scraping browser

Create a REST API with AWS Lambda and API Gateway using AWS CDK

Automate the deployment of a SpringBoot application using GitHub Actions CI/CD

Set up the GitHub integration for Slack for faster code reviews

Host a static website on AWS with S3 and CloudFront

Upgrade Node.js using NVM the right way

Backup and Restore a MongoDB database

Implement JWT authentication in a Spring Boot 3 application

Implement Role-based Access Control in Spring Boot 3

Spring Boot 3 and Docker compose integration

Deploy a Static Website on AWS S3 and CloudFront with AWS CDK

Retrieve YouTube API v3 key with Node.js

Retrieve videos using YouTube Data API v3 in Node.js

Install and use the AWS CLI v2 locally

Configure a custom domain with SSL on AWS CloudFront

Install and use the AWS SDK v3 in Node.js

Handle database transactions in Node.js with Prisma ORM

Read environment variables in a Node.js application

Translate texts in Node.js with Amazon Translate

Create an OpenID Connect for GitHub with the AWS CDK

Publish a Docker image to Amazon ECR from a GitHub Actions

blog-tutorials's People

Contributors

ericovrsea avatar sadikkuzu avatar tericcabrel avatar valera-rozuvan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

blog-tutorials's Issues

[help] setup username and password and default db

hi,

sorry to trouble you , great example ! :)

i tried to setup username n password by adding

environment:
      - "MONGO_INITDB_ROOT_USERNAME=root"
      - "MONGO_INITDB_ROOT_PASSWORD=example"

but i could not login via my mongodb client
if i didnt set this, i can go into the instant mongo1 without any userid n password

How to create secret key

How to create secret key like this?

security.jwt.secret-key=3cfa76ef14937c1c0ea519f8fc057a80fcd04a7420f8e8bcd0a7567c272e007b

MongoCompass not connecting

Hey, I'm trying to test an RS locally and connect to it with mongo compass but I'm having a hard time trying to do so. Everything looks fine until i try to make the connection.

Connection URL

mongodb://localhost:27021,localhost:27022,localhost:27023/?replicaSet=dbrs&tls=false

docker-compose.yml

version: "3.8"

services:
  mongo1:
    container_name: mongo1
    image: mongo:4.4
    volumes:
      - ~/mongors/data1:/data/db
      - ./scripts/rs-init.sh:/scripts/rs-init.sh

    networks:
      - mongors-network
    ports:
      - 27021:27017
    links:
      - mongo2
      - mongo3
    restart: always
    entrypoint: ["/usr/bin/mongod", "--bind_ip_all", "--replSet", "dbrs"]
  mongo2:
    container_name: mongo2
    image: mongo:4.4
    volumes:
      - ~/mongors/data2:/data/db
    networks:
      - mongors-network
    ports:
      - 27022:27017
    restart: always
    entrypoint: ["/usr/bin/mongod", "--bind_ip_all", "--replSet", "dbrs"]
  mongo3:
    container_name: mongo3
    image: mongo:4.4
    volumes:
      - ~/mongors/data3:/data/db
    networks:
      - mongors-network
    ports:
      - 27023:27017
    restart: always
    entrypoint: ["/usr/bin/mongod", "--bind_ip_all", "--replSet", "dbrs"]

networks:
  mongors-network:
    driver: bridge

rs-init.sh

#!/bin/bash

mongo <<EOF
var config = {
    "_id": "dbrs",
    "version": 1,
    "members": [
        {
            "_id": 1,
            "host": "mongo1:27017",
            "priority": 3
        },
        {
            "_id": 2,
            "host": "mongo2:27017",
            "priority": 2
        },
        {
            "_id": 3,
            "host": "mongo3:27017",
            "priority": 1
        }
    ]
};
rs.initiate(config, { force: true });
rs.status();
EOF

rs-init.sh

#!/bin/bash

docker compose up -d

sleep 5


docker exec mongo1 /scripts/rs-init.sh

When i "docker exec -it mongo1 mongo" and "rs.status()"

connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("e2d79236-681e-4ae6-928e-e03ae11fb767") }
MongoDB server version: 4.4.16
{
	"operationTime" : Timestamp(1661026048, 1),
	"ok" : 0,
	"errmsg" : "already initialized",
	"code" : 23,
	"codeName" : "AlreadyInitialized",
	"$clusterTime" : {
		"clusterTime" : Timestamp(1661026048, 1),
		"signature" : {
			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
			"keyId" : NumberLong(0)
		}
	}
}
{
	"set" : "dbrs",
	"date" : ISODate("2022-08-20T20:08:23.821Z"),
	"myState" : 2,
	"term" : NumberLong(40),
	"syncSourceHost" : "",
	"syncSourceId" : -1,
	"heartbeatIntervalMillis" : NumberLong(2000),
	"majorityVoteCount" : 2,
	"writeMajorityCount" : 2,
	"votingMembersCount" : 3,
	"writableVotingMembersCount" : 3,
	"optimes" : {
		"lastCommittedOpTime" : {
			"ts" : Timestamp(0, 0),
			"t" : NumberLong(-1)
		},
		"lastCommittedWallTime" : ISODate("1970-01-01T00:00:00Z"),
		"appliedOpTime" : {
			"ts" : Timestamp(1661026048, 1),
			"t" : NumberLong(40)
		},
		"durableOpTime" : {
			"ts" : Timestamp(1661026048, 1),
			"t" : NumberLong(40)
		},
		"lastAppliedWallTime" : ISODate("2022-08-20T20:07:28.383Z"),
		"lastDurableWallTime" : ISODate("2022-08-20T20:07:28.383Z")
	},
	"lastStableRecoveryTimestamp" : Timestamp(1661025458, 1),
	"members" : [
		{
			"_id" : 1,
			"name" : "mongo1:27017",
			"health" : 1,
			"state" : 2,
			"stateStr" : "SECONDARY",
			"uptime" : 5,
			"optime" : {
				"ts" : Timestamp(1661026048, 1),
				"t" : NumberLong(40)
			},
			"optimeDate" : ISODate("2022-08-20T20:07:28Z"),
			"lastAppliedWallTime" : ISODate("2022-08-20T20:07:28.383Z"),
			"lastDurableWallTime" : ISODate("2022-08-20T20:07:28.383Z"),
			"syncSourceHost" : "",
			"syncSourceId" : -1,
			"infoMessage" : "",
			"configVersion" : 1,
			"configTerm" : 40,
			"self" : true,
			"lastHeartbeatMessage" : ""
		},
		{
			"_id" : 2,
			"name" : "mongo2:27017",
			"health" : 1,
			"state" : 2,
			"stateStr" : "SECONDARY",
			"uptime" : 4,
			"optime" : {
				"ts" : Timestamp(1661026048, 1),
				"t" : NumberLong(40)
			},
			"optimeDurable" : {
				"ts" : Timestamp(1661026048, 1),
				"t" : NumberLong(40)
			},
			"optimeDate" : ISODate("2022-08-20T20:07:28Z"),
			"optimeDurableDate" : ISODate("2022-08-20T20:07:28Z"),
			"lastAppliedWallTime" : ISODate("2022-08-20T20:07:28.383Z"),
			"lastDurableWallTime" : ISODate("2022-08-20T20:07:28.383Z"),
			"lastHeartbeat" : ISODate("2022-08-20T20:08:23.322Z"),
			"lastHeartbeatRecv" : ISODate("2022-08-20T20:08:23.667Z"),
			"pingMs" : NumberLong(0),
			"lastHeartbeatMessage" : "",
			"syncSourceHost" : "",
			"syncSourceId" : -1,
			"infoMessage" : "",
			"configVersion" : 1,
			"configTerm" : 40
		},
		{
			"_id" : 3,
			"name" : "mongo3:27017",
			"health" : 1,
			"state" : 2,
			"stateStr" : "SECONDARY",
			"uptime" : 4,
			"optime" : {
				"ts" : Timestamp(1661026048, 1),
				"t" : NumberLong(40)
			},
			"optimeDurable" : {
				"ts" : Timestamp(1661026048, 1),
				"t" : NumberLong(40)
			},
			"optimeDate" : ISODate("2022-08-20T20:07:28Z"),
			"optimeDurableDate" : ISODate("2022-08-20T20:07:28Z"),
			"lastAppliedWallTime" : ISODate("2022-08-20T20:07:28.383Z"),
			"lastDurableWallTime" : ISODate("2022-08-20T20:07:28.383Z"),
			"lastHeartbeat" : ISODate("2022-08-20T20:08:23.323Z"),
			"lastHeartbeatRecv" : ISODate("2022-08-20T20:08:23.629Z"),
			"pingMs" : NumberLong(0),
			"lastHeartbeatMessage" : "",
			"syncSourceHost" : "",
			"syncSourceId" : -1,
			"infoMessage" : "",
			"configVersion" : 1,
			"configTerm" : 40
		}
	],
	"ok" : 1,
	"$clusterTime" : {
		"clusterTime" : Timestamp(1661026048, 1),
		"signature" : {
			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
			"keyId" : NumberLong(0)
		}
	},
	"operationTime" : Timestamp(1661026048, 1)
}

springboot-docker-compose

Hi,I read your blog fromspring-boot-docker-compose.And I also read the Source Code.

When I run my SpringBoot project,I have this error

java.lang.IllegalStateException: No Docker Compose file found in directory

How your project find the compose.yaml then run success?
I think should config Compose file,let springboot know where to get the compose.yaml.But I see your project nothing about compose.yarml file config in the application.properties

Maybe should add something like spring.docker.compose.file=... to application.properties?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.