Leveraging CloudAMQP Within My Heroku-Based SaaS Solution

In the “Using Heroku to Quickly Build a Multi-Tenant SaaS Product” article, I documented the foundation for a new SaaS solution that I am building (initially for my sister-in-law) — utilizing the Heroku ecosystem. Using Heroku allowed me to deploy the app quickly, without having to worry about infrastructure, DevOps, scalability when the app gets popular, etc. The “Integrating Twilio Into My SaaS Solution In Heroku” publication provided an example of how easy it is to create a Twilio instance and integrate the solution into my Fitness-based SaaS solution. This current journey has resulted in a feature set that both trainers and their clients have been able to enjoy.

This article is going to focus on invoicing clients for services that have been performed and will utilize messaging solutions within the Heroku ecosystem. The goals of the invoice process are as follows:

  • Quick and easy to use
  • Accurate and allow adjustments
  • Notify clients via SMS, including a link to an online invoice
  • Allow clients to submit payments using Venmo

Below, is a current version of the feature roadmap:


Invoice Processing and Flow

In order to illustrate the flow for sending invoices, the following diagram was created:

flow chart

I wanted to utilize a message-based approach, based upon my past experiences and satisfaction with the pattern. While one could argue that the current processing volume does not warrant a message-based approach, I did want to prove out this concept for use when the system gains more popularity.

About CloudAMQP

RabbitMQ is an open-source message broker solution, which allows asynchronous communication between different components of a multi-tier application. CloudAMQP is RabbitMQ wrapped into a service offering. Heroku not only offers CloudAMQP at price levels that match working directly with CloudAMQP, but also makes CloudAMQP very easy to install into an application. My experience with RabbitMQ and the ease of getting the message broker up and running made this product solution quite easy for me.

In a message broker solution, there are three main elements:

  • Producerthat has a message to be processed
  • Queuethatis the mechanism to store messages until they are processed
  • Consumerthatwatches the queue and handles the necessary processing

The producer requesting a task to be completed places a message on what is called a queue. In this case, the Invoice Submission process is handed off to an asynchronous process – which avoids making the Trainer wait for the invoicing process to complete. As a result, once the Trainer submits the request, the Fitness application can navigate to other sections of the application and continue working.

On the services side, the CloudAMQP service now has a message to be processed. A consumer (running in the Fitness application service within Heroku) listens for any messages to arrive and pulls them off the queue for processing, In the case of the Fitness application, the messages will be processed and sent to the customers via the Twilio service.

Invoicing Example

At a high level, the following actions take place during invoice processing:

1. Trainer navigates to the Create Invoices menu option to request a list of current invoices.

2. The Spring Boot service performs the necessary actions to return a List<InvoiceDto> of invoice data.

create invoices

3. The trainer can make adjustments to the invoice list, including changing a session to no-cost.

invoice items

4. When ready, the trainer uses the Submit Invoices button to initiate the invoice process.
5. The Spring Boot service persists the InvoiceDTO items.
6. Each InvoiceDTO is sent to CloudAMQP and added to the queue for processing asynchronously.
7. An instance of the Spring Boot service picks up the job from the queue, processes the request, which sends an SMS message to the client for the invoice.

At this point, each InvoiceDto is available for the trainer to view.

invoice history

The Customer Flow

The customer receives an SMS message similar to what is displayed below:

text messages

At that point, the end-user can use the first link to view an online version of their invoice:


Using the invoice, the customer can click the Pay Invoice using Venmo button to pay for their sessions using Venmo or they can click the second link on the original SMS message. Both messages navigate the user to the following page:


Here the user can sign-in or sign-up for Venmo. Once authenticated, the user can accept the request for payment and pay using the Venmo mobile application.

Configuring CloudAMQP in Heroku with Spring Boot

Getting started with CloudAMQP in Heroku is as easy as running the following command from the Heroku CLI:

heroku addons:create cloudamqp:lemur

Heroku adds everything your app needs to start working with the queue. Now we need to configure our app to use the queue, and define the message that we’ll be passing through the queue.

The properties related to CloudAMQP will now be available in the Heroku instance:


These configuration values are ultimately set in Heroku as shown below:

Config Vars

Within Spring Boot, the pom.xml needs to be updated to include the following dependency to support Rabbit AMQP:


Within the application.yml the following properties are introduced in order to allow the values to be dynamic:

invoice-topic-exchange: invoice-topic-exchange
invoice-processing-queue: invoice-processing-queue
 invoice-routing-key: invoice-processing.#

The three custom properties are available in Spring Boot as part of the MessagingConfigurationProperties bean:

public class MessagingConfigurationProperties {
private String invoiceTopicExchange;
private String invoiceProcessingQueue;
private String invoiceRoutingKey;

Finally, the messaging configuration class is configured as shown below:

At this point, Spring Boot can now connect to CloudAMQP to process messages in the topic exchange and queue.

Processing Requests

To process invoices using the CloudAMQP service, a request enters the system via the InvoiceService(the producer):

The InvoicePublisher class performs the task of sending the message to CloudAMQP (the queue):

From there the InvoiceProcessor class (the consumer,running on a Spring Boot service API instance), receives the message and processes the request:

The SmsService sends the invoice information over SMS and the Invoice object is marked as processed.


Before this functionality was introduced, my sister-in-law was manually sending invoices to her clients. She would look back at the sessions that had been completed since their last invoice, then note the cost for each session and the date range. The next step would be to paste a generic message about the invoice and update the values to match her client’s information.

The new process takes a mere fraction of the time to complete and has the ability to resend invoices at a later time. The system is smart enough to know which clients to invoice and which invoices still remain open. This allows my sister-in-law to focus on training her clients knowing that all of the invoicing goals (noted above) have been met.

In a similar fashion, Heroku provides the necessary tooling to introduce messaging concepts into an existing project with little effort. Just like the Heroku service does the DevOps work for me, CloudAMQP provides a quick setup and allows me to turn my attention to building intellectual property within the Fitness application to yield a better application experience.

In the current state, my Heroku ecosystem for the Fitness application currently appears as shown below:

gitlab system

I look forward to building upon this design as development continues across the feature roadmap.

Have a really great day!

Source link

What is the Graphic Design term for this kind of work?

What is the Graphic Design term for this kind of work?

What is the Graphic Design term for this kind of work?

In this project I did quite a few years ago, I used only the letters of a word, "leopard" to create an image representing a leopard in Illustrator. Is there a term for this?

submitted by /u/VelociPrime

Source link

Buy me a coffee

edent/SuperTinyIcons: Under 1KB each! Super Tiny Icons are m…

Under 1KB each! Super Tiny Web Icons are minuscule SVG versions of your favourite logos. The average size is under 465 bytes!

The logos have a 512×512 viewbox, they will fit in a circle with radius 256. They will scale up and down to suit your needs.

Say thanks!

Buy me a coffee

How Small?

What’s Available so far?

Social Media



Google (Old)

Google Maps (old)

713 Bytes
Gmail (Old)

584 Bytes
Google Drive (Old)

313 Bytes

397 Bytes











Operating Systems / Kernel



Why so smallious?

Bytes cost money. They cost money to store, transport, and process. Simplicity should be our goal in all endeavours.

Scream if you want to go smaller

These files were edited by hand in Inkscape, Illustrator, or a text editor, then were minified using Yann Armelin’s SVG Path Editor, svgo, and svgcleaner. Further smallification may be possible. Try it!

  • Each of these has an xmlns="" in the <svg> tag. This isn’t strictly necessary – but some web browsers won’t display them as an image without it.
  • Rounded corners can be dropped – rx="80" – the effect can be done in CSS if you want.
  • The background colour can also be excluded if you’re including it elsewhere.
  • Colours can be simplified. #FF0000 becomes red.
  • The precision of the paths is mostly 0 decimal places. A few logos have 1 or 2 dp to make them look more accurate. The precision can be reduced if necessary.

Think you can make them smaller? Tell me by raising an issue!

Want more icons? Tell me by raising an issue!

Think the icons look wrong? Compare them against the official logos. If they still look wrong, tell me by raising an issue!

Android Vector Drawables

Icons also available as Android Vector Drawables, so you can easily use them in Android apps.

They are converted using Android Studio and are not guaranteed to be under 1KB.

To convert in Android Studio, go to Tools Resource Manager Drawable + Import Drawables then select the SVGs.

Note Android Studio doesn’t like rounded corners. Before importing, run sed -i '/rx="15%"/d' ./*.svg

Submitting Icons

I’d love you to submit something ? The rules are simple, your icon must:

  • be under 1024 bytes. That is, the maximum file size is 1023 bytes. No arguments.
  • fit inside a circle with radius 256 pixels. Set rx="50%" to check.
  • represent a popular service’s current logo.


At a minimum, your icon needs these components:

   aria-label="..." role="img"
   viewBox="0 0 512 512">
      width="512" height="512"

Icon accessibility

The super tiny icons are accessible by default. Each icon has:

  • role="img", to expose the <svg> elements as images in the browser’s accessibility tree
  • aria-label="XYZ" (where XYZ is the icon’s brand name), to give the icon an accessible name

Note: if using the <svg> as the src for an <img> element, the alt attribute should still be used on the <img> element because the ARIA is not recognised in this context.

CSS-Tricks has also an article about accessible SVG icons.


This is the standard guideline. Use this to help with sizing your icons and they will look good no matter what border radius is chosen.

A template for logos

  • Green is the safe zone, where the main body of the icon should be.
  • Yellow is like a road shoulder, it is there if more space is needed. It should be used for protruding elements, like corners or ornaments.
  • Red is off limits. It should not be touched by the icons. Red is also how a circular icon would look.


npm install --save super-tiny-icons


The old-school way:

<img src="./node_modules/super-tiny-icons/images/svg/github.svg" />

The modern way, the React (JSX) example:

import logo from "super-tiny-icons/images/svg/github.svg";

<img src={logo} />;

The demo repository bootstrapped with create-react-app: create-react-app-super-tiny-icons


Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]



Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]


The majority of these vector logos are based on someone else’s work.

From SVGporn – CC0

IBM, Yammer, Android, Authy, Cloudflare, CodePen, DigitalOcean, Discord, Airbnb, WiFi, Delicious, Open Source, Patreon

Where possible, they retain their original licenses. Some logos may be subject to copyright and trademark laws, but these files are small enough to memorise.

Source link

What is causing this weird spacing in the login card? (codepen and screenshot)

What is causing this weird spacing in the login card? (codep…

What is causing this weird spacing in the login card? (codepen and screenshot)

Hi everyone. I am building this login card and eventually plan on using it in a different website which uses css grid, so I am trying to build this with grid. The spacing within the card is really large even though I have not really set a margin or padding on either elements, for example, between the logo and title.

Any direction on what I can fix to change this?

submitted by /u/kylejoesph11

Source link

Can Not Hide Scrollbar Track - Webflow Custom Code

Can Not Hide Scrollbar Track – Webflow Custom Code

Can Not Hide Scrollbar Track - Webflow Custom Code

I've tried many different lines of code over the past hour in attempt to achieve this, with absolutely no luck. Here is an image of my current state, along with a link to my Head Code. Any help would be greatly appreciated!

submitted by /u/Indenze

Source link

Can I get some advice on layout and colors please?

Can I get some advice on layout and colors please?

Can I get some advice on layout and colors please?

I'm new to web-dev, and need some advice on colors and layout, especially on colors. I'm really having hard time color coordinating. Any help will be greatly appreciated. Thank you.

submitted by /u/Shinhosuck1973

Source link

First Portfolio Finally Finished! (And Resume)

First Portfolio Finally Finished! (And Resume)

First Portfolio Finally Finished! (And Resume)

So I've been learning web development for the better part of a year now. I mainly focus on frontend and I use React as a Javascript framework. I recently finished my portfolio that I plan to use to apply to jobs with and it would be great to hear what your opinions are on it! Thank you!



submitted by /u/mcbootysauce1

Source link

I built an educational word game online -

I built an educational word game online –

I built an educational word game online -

It's jquery and css3 on a wordpress cms. Used web audio api for sound effects.

Hoping it can be a useful game for teachers and homeschooling parents.

Feedback very welcome!

submitted by /u/thepianomatt

Source link

r/webdev - TIL: You can activate PIP (Picture in Picture) in Youtube (or any HTMLVideoElement)

You can activate PIP (Picture in Picture) in Youtube (or any…

So, I was skimming through MDN beautifully written docs on Web APIs and discovered there’s an API called “Picture-in-Picture” that basically lets you “detach” a video player from its context (browser tab) and treat it like a “standalone” player.

r/webdev - TIL: You can activate PIP (Picture in Picture) in Youtube (or any HTMLVideoElement)

Youtube video in PIP mode

AFAIK, Youtube doesn’t support it out of the box yet, but it is pretty easy to do it manually, you just need to select the HTMLVideoElement and $0.requestPictureInPicture() .

It’s specially useful if you have a single monitor and are following a tutorial while coding, so that you don’t need to ALT+TAB.

EDIT: There’s actually an extension in Chrome that activates PIP mode with a shortcut and it’s been developed by Google itself. Chrome PIP Extension

Source link

r/webdev - Django api to connect React frontend to local python script

Django api to connect React frontend to local python script …

Let’s say I have a python script that takes JSON input, does some analysis, and then spits out the result. I want to be able to connect it to my frontend like this:

r/webdev - Django api to connect React frontend to local python script

Where a form on the React frontend takes the user input, then uses a django api to send it to the python script where the analysis will occur before having the data sent back and displayed.

Really, my question is how do I set up this django REST api? Normally you would import from the django.db module and it would handle everything but since I am not querying a db I’m not sure what to do.

Any help/video links/resources would be appreciated!

Source link