Coder Social home page Coder Social logo

khalilannbiya / notes-app-queue-consumer Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 29 KB

Practice case studies in the Belajar Fundamental Aplikasi Backend class at Dicoding | A program that acts as a consumer in the message delivery architecture through a message broker

JavaScript 100.00%
message-broker nodejs rabbitmq rabbitmq-consumer

notes-app-queue-consumer's Introduction

notes-app-queue-consumer

A program that acts as a consumer in the message delivery architecture through a message broker

Tech Stack

  • Server : Nodejs, RabbitMQ, PostgreSQL

Run Locally

Clone the project

  git clone https://github.com/khalilannbiya/notes-app-queue-consumer.git

Or Download ZIP

Link

Go to the project directory

  cd notes-app-queue-consumer

Install the package using the following command:

  pnpm i 

Copy and paste the .env file using the command:

  cp .env.example .env

Let's Configure the .env file

  • For PGUSER to PGPORT, it's the PostgreSQL database configuration. Make sure PostgreSQL is installed on your local machine. You can follow these steps: https://www.w3schools.com/postgresql/postgresql_install.php. Ensure that the configuration in .env, specifically the variables PGUSER, PGHOST, PGPASSWORD, PGDATABASE, PGPORT, matches the configuration in the .env of the producer project, in this case, the producer project is https://github.com/khalilannbiya/notes-app-back-end.git. Here's an example:
    PGUSER=pengembang // Make sure you have created the 'pengembang' user in PostgreSQL
    PGHOST=localhost // The host for PostgreSQL can vary depending on where the PostgreSQL server is hosted. If PostgreSQL is hosted on your local machine (localhost), you can use localhost or 127.0.0.1 as the host. However, if PostgreSQL is hosted on an external server or in the cloud, you should use the IP address or hostname of that server
    PGPASSWORD=veryhardpassword // Provide a strong password and make sure you remember it
    PGDATABASE=notesapp // Fill in the database you want to use and make sure the database has been created
    PGPORT=5432 // Also, make sure to check the port used by the PostgreSQL server (default is 5432)
  • For SMTP_HOST to SMPT_PASSWORD are credentials from the Mailtrap SMTP server. Make sure you have created a Mailtrap account at https://mailtrap.io/register/signup. Then, check the SMTP server information we need. Here is how: https://help.mailtrap.io/article/109-getting-started-with-mailtrap-email-testing
  • For RABBITMQ_SERVER, it is for configuring the Message Broker. In this case, Rabbit MQ is used. Make sure your machine already has Rabbit MQ installed. You can follow the installation guide here: link. Usually, if running locally, its content looks like this:
    amqp://localhost

Since we are using a Message Broker, and this project is a consumer, don't forget to clone the project https://github.com/khalilannbiya/notes-app-back-end.git as a producer, then follow the installation steps in the project's repository. And, remember to run them simultaneously after setting up the projects to avoid any errors.

Make sure that the PostgreSQL, RabbitMQ servers are already running.

Run the server:

  node src/consumer.js

Documentation

Feedback

If you have any feedback, please reach out to us at [email protected]

notes-app-queue-consumer's People

Contributors

khalilannbiya avatar

Watchers

 avatar

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.