Deploying your application with Now

Have you ever needed to share your application quickly via a public URL Or you needed a public rest API to integrate with apps like Slack, Telegram of many others?

If yes, I would like to share with you my latest discovery:

I will demonstrate how easy to use this tool is by showing you three classic use cases. First of all, create an account (for free) and install the desktop app that comes also with CLI support. Once you have it installed follow these instructions:

# Let's create a roor project for out tests
mkdir testing-now && cd testing-now

# Inside it we will create a folder for the first use case
mkdir static-website && cd static-website

# Let's create an awesome html web page 
echo "<h1>Hello World</h1>" > index.html

# Run the now command
now --public

Once the last command is completed, you will get already in your clipboard the public where you can see your webpage

Now uses the folder name as the project name and creates an instance for each deploy and versions it with a specific hash: uafovxlpvg

Another nice discovery for me was to see that it delivers the app over https. As I was building a bot for the application Telegram, it’s API requires that it communicates only over https. Without having to middle around with certificates, now had this functionality build out of the box.

Let’s continue to the second example:

# Go to the root project and create a new folder
cd ~/testing-now

mkdir node-app && chdir node-app

# Let's create a standard express app
npm init

npm install express --save

Create a file called index.js:

const express = require('express')
const app = express()

app.get('/', (req, res) => res.send('Hello World!'))

app.listen(3000, () => console.log('Example app listening on port 3000!'))

Check that your package.json contains a start script:

{
  "name": "app",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "node index.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^4.16.3"
  }
}

Run again the now --public command and you will have now a public accessible node app. In my case https://app-wzjjetdmmx.now.sh/. Like before, Now scanned the contents of the folder, detected the package.json file, created an instance using the app name and versioned it with a new hash.

For the last example, we need to go back to the root project and create a new folder

# Go to the root project and create a new folder 
cd ~/testing-now

mkdir docker-app && cd docker-app

Create a new file called server.go:

package main

import (
    "fmt"
    "net/http"
)

func handler(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintf(w, "Hello World! How are you today %s!", r.URL.Path[1:])
}

func main() {
    http.HandleFunc("/", handler)
    fmt.Println("Server running...")
    http.ListenAndServe(":8080", nil)
}

Create a Dockerfile with this content:

FROM golang:1.8

WORKDIR /go/src/app
COPY . .

RUN go get -d -v ./...
RUN go install -v ./...

EXPOSE 8080

CMD ["app"]

Once you run the now --public command you will have, out of the box,  a complete docker container running and available on a public URL. You can decide what programming language to use, what image from docker hub fits better your needs, but the possibilities are amazing.

You can use any of the images available on docker-hub, meaning you can build an application on go, on python or any other language that you want.

Amazon AWS and Google App Engine offer similar service, but what impressed me the most at Now is the simplicity of the whole process. I can’t tell you how many times I got lost in the Amazon AWS UI or triggered the wrong command…

I think the guys at Now did a terrific job and they have my appreciation. Their free tier is perfect for testing, prototyping and creating proof of concepts. If you want to scale your idea they also offer suitable packages and great support. My recommendation to all of you to give it a try and here are some additional resources on what else you can do with now:

A software developer’s journey to success – part two

Welcome back to the second part of this journey. If you haven’t checked the first part, you can do it here.  We will start with the topic of communication, what are common issues or surprises that you might have. We will end when reaching the subject of physical and mental energy, an area that if neglected can have negative consequences in the long term. So grab a cup of coffee and let’s begin.

Communication

For more than eight years, I have been working in an international environment with persons from all over the world. I discovered that communication or lack of it, is the main source of issues. There are many reasons why communication fails, from misunderstanding to different expectations before even talking. I soon realized that different cultures or personalities have specific communication preference. For example, some people, prefer making small talk before going to the main point, others feel that small talk is a waste of their time and are even demanding to point quickly what you truly want. Some people prefer face to face conversation others would like to use email or other digital channels like slack or another digital form.

The most critical element in communication is the perceived message.

One thing that helps me the most is to bring up the topic of expectation on communication as early as possible in the relationship with other person. When both parties know what each other prefers the chances that issues arise are quite low.

I find effective if you are asking the other party to paraphrase it or write it down in an email. This method will be able to reduce a lot of misunderstandings or make it easy to spot any differences.

Personal Branding

Before going into the topic, let’s find why this aspect should matter for everyone.

Imagine that you are a company and you provide services or products to clients. How successful do you think that company would be if no one knows it?

Having the best products, skills, or ideas will not help you if people do not know about them. To have people buying your products or invest in your ideas they first have to know you.

The same also applies to individuals. If you want to “sell” your skills, ideas or knowledge, you must stand out!

Take advantage of every opportunity to increase your visibility. Start by presenting the team results in the review meeting. Hold presentations and talks to your team and your company. Go to meetups, present to a broader audience, set up your blog.

When twitter, facebook or other social platforms appeared I underestimated how useful these tools could be. They are easily misused or used for trivial things. However, when used correctly you can create a complete brand around you or become an international influencer in a domain or specialty.

Marketing plays a crucial role, and personal branding can open new doors and opportunities that otherwise would be very hard to benefit from. Do not underestimate it!

Financial Literacy

I find this subject undervalued in our educational system. We are taught to get good grades, don’t make mistakes,  learn a specialty and get a well-paying job. I would like that we provide our children with more than one way to become successful, whatever success means in their eyes.

Robert Kiyosaki in his book “Rich Dad Poor Dad” presents his idea that our system creates what he calls the “Rat Race,” a vicious cycle between desire and fear.

For example, once you have the job and start accumulating savings, desires kick in, and you will start wanting a new phone, a new car or a new house. As expenses rise, the fear that you will not be able to afford or provide for your family pushes you to work more, get a raise and have a higher income. Once you reached a comfort level again,  you are back to the beginning, and you will start to want more.

It is vital as early in your career or life to take control of your desires and fears and educate yourself. For example, find out the difference between an asset or a liability. Robert Kiyosaki has a simple definition:

Anything that puts money in your pocket is an asset, anything that takes money from your pocket is a liability.

He also shares the importance of building more and more assets, while keeping in check liabilities. Ask yourself a lot of questions and challenge the conventional view on these elements. e.g., is owning a house an asset or a liability, is your blog an asset or a liability, is your car an asset or liability, etc.

The typical mentality for increasing your income is to bring more value to your company, ask for a raise or go to another company that pays better. I don’t say that this approach is bad. However, the possibility to scale this type of income is quite limited. Passive income is a great tool that can contribute to your financial success. Passive income is also working when you are on holiday or doing something completely different (e.g., selling an e-book, blog advertisement, dividends, etc.) For more information on what is passive income and how to grow it go to smart passive income and meet Pat Fly one of the best experts in this field.

My advice is to learn as much as possible about this topic. Create a financial plan for yourself that involves multiple channels of incomes. Put the focus on growing your passive income, and you will gain the freedom that everyone needs.

Physical and Mental Energy

At the beginning of my career, I would never imagine that someday I will write a section about this theme. However, getting older and discovering how valuable time is, I see that it would be a big mistake to skip this area.

So let’s try to make things more concrete. How do you usually feel when you wake up in the morning or at the end of the day? Have you observed how your behavior changes when you are focused or when you are are doing one million things at once or when you are happy or upset?

I think that for keeping a sustainable working pase and preventing the burnout effect, you have to keep these energy levels in check.

Physical energy is quite easy to understand and observe when you are fresh or when you are tired.  Mental energy is harder since it involves a reasonable level of self-reflection and knowing when you are emotionally charged or clear headed.

Being able to observe these two elements, will give you the opportunity to schedule your activities and tasks to generate the most output. For example, when I know that I have to concentrate to write an article or analyze some business data, I will schedule a time slot in the morning. For me, that represents the time of the day that I am clear headed and fresh, but there are others who have this state in the evening or the middle of the night. Activities like calling different parties or having meetings I usually do after lunch.

If you are angry or upset, and you go to a meeting or have a conversation with another person, make sure that you keep out these feelings. Be respectful and professional all the time.

Summary

We started this journey discussing that it is ok to make mistakes and most important to learn from them. After that, the discipline and a good work-life balance will give you the endurance to have consistent results. Being aware of common issues in communication and how personal branding works can separate you from the crowd and open new doors. We also looked at how critical is to develop financial education as early as possible in your career. We ended by pointing out that we have to take care of our body and mind, so we are in control of the results that provide at any moment of the day.

I hoped you liked the journey and that it made you aware of the elements that can make not only your career but your whole life a success.

A software developer’s journey to success – part one

Did you finish the university and you got your first job as a software developer?  Do you find it hard to define and measure the ultimate success of this career? Do you wonder what awaits for you in the next two, five or ten years?

There is enough material on the internet to get an answer to those questions. However, I would like to approach this subject differently. I find that most strategies are centered too much on technical skills, tools, and coding exercises. I think all of them are essential, but I believe that, in the beginning, focusing on having the right mindset and the proper soft skills will make the difference between a good developer and a great developer.

In this post, we will start by learning to be open to mistakes, focus on training and adapt fast, use discipline to be in control of time and at the end discover how essential it is to create a healthy work-life balance. So let’s begin.

Making Mistakes

The first thing that a new developer must understand from the beginning is that it is ok to make mistakes.  Most educational systems, teach students to avoid mistakes and even use bad marks to reflect the consequences. In real life, I see mistakes are learning opportunities to understand that one action that we took had effects that we did not expect. The data gives us the ability to adapt and do it differently next time.  What is critical is not to repeat the same action over and over and always use the gain knowledge to improve.

If you just started your career and you have not made any mistakes, I would think that you are too slow on purpose and that you are not taking massive actions into developing and pushing yourself further. Now it is the time to make mistakes. Now it is the time to experiment. Now it is the time to grow exponentially.

A small tip from my side: when you failed a task, project, etc. always hold yourself accountable and never blame someone else. Find a quiet room and write down everything it happened and try to understand why it failed. Once you have this information, start researching, brainstorming what kind of actions or options you have for the next time. I believe this simple technique will guarantee that your knowledge and abilities will get broader and broader.

Learn

Start with learning enough theory to get you started. Do some research, take some online courses or workshops. The next step is to take action.  Use the gained knowledge and put it into practice. Write a small program, extend a feature or play around with some public API. The key is to understand how everything works in reality. In a perfect world, you should not have any surprises. Finding outdated documentation is common. Service calls will return unexpected results. Methods have side effects that make your life harder. At one moment you will get stuck, and it is ok. Go back to the research and discovery phase until you can move forward and repeat this cycle over and over. With time it will become easier.

To get even better show it to others and teach them. Start with helping a coworker when he is stuck or might need a different perspective. The knowledge will deepen in your mind as you explain to others, as you answer questions that you did not think of.

Discipline

Many people consider time one of their biggest enemy to their freedom. Discipline is the way how you get control of your time. Store all your tasks, deadlines in a single central place, like a todo list app. Create a routine and do a little bit of planning around the time of the day that you are most focused. Nowadays there are great productivity techniques, apps and resources that can help. You can check my earlier post on my productivity toolbox.

Learn the importance of commitment. There are moments and situations where you will have to commit to complete a task. Please do not take it lightly, since this is one of the most critical points influencing the trust that others have in you.  True commitment means massive actions and strong will not to give up. It is better to fully commit to the wrong project, rather than partially commit to the right one. You will influence others with your energy and drive, and you will become soon a key player inside of the team.

Your initial estimations will be inaccurate since you still lack the experience and knowledge. However, collect all the data, write it down and used to refine your values in the future. This will give you the confidence to say from beginning NO and to suggest a different path of actions.  Saying NO is another way that you can earn the respect of others when used correctly. Use facts and data to explain your view and always come with constructive options.

Respect your process and hold yourself accountable. This is the key to master time and not to become its slave.

Work-Life Balance

There are many reasons why you will spend more than eight hours per day at work. You will be excited about the new possibilities, opportunities or your new role. For you, it might not be a big issue yet since you are already used to going into this “overdrive” mode during the university. However, you have to ask yourself this questions: Are you putting in extra time because you’re excited or doing it because this is your new life? How are you going to feel in a year when you are still sacrificing your weekends?

Answer these questions honestly and realize that the most important resource that we have is time. Loving what you do is essential. However, now it is the time do discover what else you love doing, find out what your passions are. Take a massage course. Find out about entrepreneurship. Learn to drive a boat. Learn to play a musical instrument.  Use all the opportunities that we have today to build a well-rounded version of yourself.

In this post, we discussed how essential is to have the right mindset at the begging of your career to grow and develop. In the next one, we will cover the importance of soft skills like communication, personal branding,  financial education to even fitness and mediation. There is a long journey in front of us, however, if you are as thrilled as I am, you will follow me to discover the rewards for yourself.


Also published on Medium.