Otoniel Reyes's Blog

My journey as a software developer and entrepreneur

  • How to automate an Angular project’s auth system creation

    How to automate an Angular project’s auth system creation

    Maybe you have read my last post about automating a NestJS authentication system. Now, of course, I had to automate the same for Angular. Since I code mostly with this stack, this is going to save me 3 to 4 hours in each new MEAN project I start from now, and so you can too now. Thank me later XD.

    Follow along to know how I did it, how challenging it was, and how to use my script.

    Automating an Authentication System UI?

    Oh yes, of course. People often recommend being lazy to be able to be productive. That means, for those of you that didn’t understand, that the lazy worker is the one with the effort worth time-saving solution. In this case, I started with the NestJS part automation, later, just asked myself, why don’t repeat the same for the UI? And for sure, it is still the same problem: Setting up every project involves authentication.

    So here I am, now trying to repeat the same, this time with the visual part of the task. I had the NestJS automation, so following it, copying some code from my last project I build a simple yet useful piece of automated code. Now, same as the last one, I just need to run one command from the terminal, and instantly I have a full authentication system. This auth system includes the same user profile as the API boilerplate. Maybe predictable, yes, but here are the components of my automated script:

    • Login
    • Signup
    • Password Recovery (request)
    • Password Reset
    • User Profile
    • An Authentication Interceptor
    • Auth Service
    • Tailwind Installation and configuration
    • An environment file
    • Every interface needed (API responses, user, and payloads)

    Was it worth it?

    Hell yeah. If you put this and the another one automation together, now I’m saving 3 to 4 hours to myself. Think of this like when you go camping, and you already have all you need packaged in a really large backpack. Maybe the day you were preparing that backpack, you feel way too awkward. But without any doubt, now you need it, it totally makes sense, right?

    So a little insight here is for businesses, build yourself a system that save you as much time as possible, so you use your time just for the things that make you more money. In our case, developers, automate as much as you can to build yourself a concrete wall of productivity and become high performers in our field.

    I get it, it’s awesome, but, how can I use it?

    To use this automation script, it’s basically the same as the last one, once you’ve created your project go to the root directory in a terminal. Once there, just run the script with the raw file using curl:

    curl -sSL https://gist.githubusercontent.com/kenliten/d6a7028310d43d87ed889c779f3b8007/raw | sh

    Wait for it to complete, and, yes, that’s it.

    If you like it, please consider sharing it with your friends or colleagues and follow me on social media.

    That said, wish you a merry x-mas and happy new year.

    Peace!

  • How to automate user auth system creation in NestJS

    How to automate user auth system creation in NestJS

    In this tiny post, I will explain the process I have followed to build a User Authentication System for all of my non yet created NestJS projects.

    Let’s dive in the creation of a crazy automation task: Auth System with roles and support for Google auth.

    I was in the startup process to start a new project for a client. Then I found myself with a task I’m sick of, auth system. I mean, almost every single MEAN project will need an auth system. In this exact moment, I realized I can be way more productive if I had a script that makes up this configuration for me. Just like Nest, Angular and Rails have their generators, I can create a script for this.

    So I got hands on the dirt and (with a little help from Duck.AI to get started, duh!) crafted a single bash script that:

    1. Installs every package I will need for the authentication system
    2. Creates the folders I will use for the authentication system (including user management)
    3. Crafts every file the authentication needs (except for the spec files)
    4. Creates both .env and .env.example files
    5. Prints out the next steps to complete the setup, so you just need to copy and paste within the app.module.ts file

    So, wrapping my journey, I would say that:

    It literally took more to automate the process than actually do it by hand. But, next time will be a no-brainer to achieve the same, in just 20 seconds.

    It is really worth it when you can automate a task or create a system that saves you time. I think it is particularly important when we’re talking about a time-consuming task.

    Lastly, of course, I have uploaded it to GitHub (That way I can use it from any place in the world).

    Here is the link.

    As an addition, if you need some help automating any task is taking you a lot of time, reach me or text me out.

    Nothing more to say, this is it. I need to get back to work.

    Peace!

    EDIT

    I’ve created an Angular auth system automation too, check it out here.

  • The Downside of Being Different: A Misunderstood Mind’s Perspective on Life

    I’ve been so different from anyone for such a long time, it become normal for me. Even though is really hard to be misunderstood every time, you end up feeling good about it. Now, before I describe the downside of being different, allow me to introduce myself.

    I’ve been so different from anyone for such a long time, it become normal for me. Even though is really hard to be misunderstood every time, you end up feeling good about it. Now, before I describe the downside of being different, allow me to introduce myself.

    I really appreciate you’re here, really. In the following 700-ish words, I’ll do my best to give you an all-inclusive guided tour to my weird (the good weirdness) mind, so hold to your seat, grab yourself a drink and let’s do this.

    The very basics of being me

    My full name is Otoniel Reyes Galay, I am a 31 years old guy with a stormy background. I am from the Dominican Republic, born in Santo Domingo and raised in Miches, a small coastal town in the east side of the country famous for a long list of bad things and even though everyone knows it, they still call it the "Perfect Paradise", I have never realized if it is a joke, ignorance or maybe faith.

    I’ve being tied to so many titles I hate, but basically and hopefully, time had given me the ability to stand, I would say that, my superpower is to keep standing.

    Looks like my life has been a disaster. I’ve been broke so many times, had terrible credit, had to ask my father for money so many times, it ashamed me to look at his eyes. Haven’t been rose color at all, but that’s the beauty. I’ve learned so much I can talk about life from a million perspective, so every experience had become a good reason to believe me when I talk to others.

    A playground early life full of joy

    As a kid, I learned to play various musical instruments, mainly Latin percussion. Thanks to my mom, I strummed my first guitar chords, which opened the door to a whole new world for me. Over the next ten years, I learned to play wind, brass, string, and percussion instruments.

    My mom also took me to typing classes, an informational technology and office suite course, and not one, not two, but three English language courses. By age 15, I had earned around 20 certifications from various courses and workshops.

    Being active in church since I was 6 helped me develop my interpersonal and speaking skills early on. I lost my stage fright by participating in dramatizations, doing mimicry, poetry, singing—you name it! My childhood became a self-development playground. I explored everything I wanted and learned so much, thanks to people like Mom and Dad, Marcela, Eli, Joel, Joselo, Rafael, and many others involved in my early development. Thank you all from the bottom of my heart.

    I have always been passionate about drawing and painting. Unlike most children, I truly wanted to learn how to create paintings like the greats. Over the years, I developed a deep appreciation for artisans. I built my own flutes and even constructed an electric violin. As time passed, I learned how to make sofas and basic furniture. I’m not sure if that’s why I love carpentry so much, but there are still plenty of things I’m into and have tried in life to discover what I truly want to do with my existence.

    The high school me

    In high school, one of my teachers inspired me. He was the only one in the area who had actually written a book. I have to admit that before I saw his book, I never took the time to think about writing something myself. This was one of my first approaches to creating something unique. When I combined that inspiration with lessons from another Spanish teacher who taught me about rhythm, metric, and basic poetry writing, I found the origin of the 320 poems I wrote, along with two novels and a few short stories.

    Moving on to music, I wrote many pieces, especially for guitar—one of which is still on Instagram, so check it out after you finish reading! I also created 8-bit music and graphic resources for video games (of course, I love video games, but I prefer creating them to actually playing them). I released a free 8-track album on Bandcamp. Additionally, I crafted hip-hop, reggaeton, and other instrumental music as a hobby, using those tracks to record self-written songs (with the worst quality you could imagine) with my close friends and family.

    As for drawing, I still have notebooks filled with my older drawings, and I’ve shared a few on my Instagram and my old OpenGameArt account. Feel free to explore, and by the way, leave a good follow! XD

    A professional life comes in

    So far, you have read about a lot of things about me, right? Well, I haven’t finished yet. Told you I took computer classes, for sure, but, haven’t said that, in that course, I gain the curiosity that brought me here: how is software created.

    In that course, I learned the basics of computers, but wanted to know how to actually create those things in the screen by myself.

    Some years later, I went to college to study Pedagogy, there I found a friend for life, Danilo, who developed even more that question. After a month my mind was finally open to the external world with internet, that was all I needed.

    I started by learning about algorithms and programming languages, and created simple software in C++ and C# before knowing, actually, nothing deep. A year later, I took a free course on HTML and CSS, then JavaScript, and never stopped, I’m still learning a lot of things about computers, technologies and software development.

    Finally, in this part of my life, I founded my first 3 businesses, all of them failed before starting. The good one, that evolved overtime, was website design/development, so that was my first almost-successful small business.

    So far, I was (and still do so) a full-time teacher with a web design side hustle. Started freelancing to keep the business alive, found some international customers, others national ones. Built a nice looking portfolio, and, guess it? Impostor syndrome came.

    A little room for personal development and success

    You can’t imagine how cruel we can be with ourselves. It became a routine to look at me and say only bad things about the reflection. What’s interesting, though, is that we struggle so much to do the same to others. Somehow my depression woke up, found myself fighting with me for a long time.

    Voices inside my head kept telling I wasn’t enough in any way. I lost myself and had to take a break from even teaching. Stayed at home for, like, 40 days until came back to school and decided to keep pushing forward. I started reading the Personal Excellence blog, watching TED conferences and forced me to think straight.

    That was enough to put in my head the hunger of success. I started following inspiring people everywhere, changed my music collection, and created a want-to-read books folder.

    I started a blog to showcase my things. Separated into categories, one blog for each of my major interests. That was a big mistake. This is the fourth time I start blogging, and the differentiator is the attitude.

    Learned from Dan Martell, I started buying back my time to be better. Of course, I’m not making tons of money right now, because first, I have a thing or two to do.

    Lessons I learned from being different

    Everything I have experience until today, have given me a different vision of life. A vision you won’t find in a single book. I’m building my philosophy around the pieces of information I get from all the people I admire. The people I envy, those who already are where I want to be, taught me this:

    Stop Scrolling

    Get rid of your freaking phone, as much as possible, as soon as possible. It will be always impossible to you achieve the goal if you are distracted. I think you are a slave if you are over 15 minutes a day on the phone for entertainment. Maybe you have been putting too much effort to tell yourself you’re good, but no. You’re wasting your time, so go out, find a good idea, greet someone, whatever, just get freaking up.

    Do it all

    Everyone knows we need to work out, to read, to work, to reach and so on. The thing is, if you want to excel, you should write a list of the things you have to do. Keep track of doing them, consistently, force yourself, and teach yourself you can do it all.

    We have told to ourselves too many times that it is not possible to do everything we need to. That’s the root of the problem. First, you need to reconquer the positive thinking you had when you were a child. Everybody had it until ourselves or someone else forced us to conform and surrender. Let’s conquer ourselves back again!

    Invest in yourself

    Start investing in yourself, no matter what, that’s a not negotiable right there. You rather buy a good book than have a nice dinner, it is worth it, I promise. Take time off, go for a little walk, wake up early, shut out loud your dreams, so the world knows them. Make the crowd fear your hunger. Make them look at you like you are crazy, so the wrong people will take a step away by themselves.

    Find someone as crazy as you are

    Most of the time, we want to be lonely wolves, but, the truth is the key to win is having the right people around you. If your circle is not the one you need, switch it. If your city can’t give you what you need, move. And, at the end of the day, look for those whose share your vision and align in values. That’s the people that make you win in life. Those are the ones I am looking for, so I that’s you, follow me, we’re going to conquer the freaking world.

    The downside of being different

    So, here’s is the downside of being different: Most people are waiting for you to fail to feel good with themselves. I swear that most people want you to fall to justify their laziness. Bet you that most people want you to be broke so they can look at you to feel relief.

    So, the downside, and the reason I feel misunderstood, is kind of easy. Most peeps can’t look at life as I do, can’t feel like I feel, when pick up the phone in the middle of a conversation.

    To me, it is really sad to see my loving ones, to lose their lives at the phone. I feel like I don’t belong here, and much people notice it and treat me like so.

    I have learned to celebrate the less significant success, even just an appointment with a lead. Winning is just that, but you have to decide to win to be a winner because most wins are ignored. Stop complaining and take time to ask how to do it better. Start asking better questions.

    Now, if you have a problem with your phone and want to know how to stop scrolling, read here.