Back
KimSia Sim

KimSia Sim

@kimsia

I’m building greendeploy.io while doing automation projects for MNC clients. Autonomy >>> max economic gain or max security
347
Joined April 2021
Load previous page…

There are only two mistakes you can make:

  1. you picked the "wrong" framework as in you should have picked the other framework.
  2. you wasted time debating yourself what to pick longer than necessary.

the first one is not as problematic as the second. let me explain.

  1. it is reversible. so once you realized you made a wrong choice, you can simply stopped and switched. yes, the time spent previously is lost but is not a complete loss because a lot of the concepts can be carried over as both follow the MVC structure. Django calls it MTV but is different names for the same thing. any experience building a website with one framework also can be reused when you switched to another framework because the experience is more to do with the nature of website building than the specific framework itself.

  2. you need to debate with your self but beyond a certain point any additional debating is a waste and this is a complete waste. none of the time spending extra debate / research is transferable to any django or ror frameworks. none of the time spending extra debate / research is transferable to the general experience of building websites.

so once again pick the lesser of two evils. Do enough research set out a criteria, then apply that criteria and choose. Dive in deeply into one framework. Set a timebox on when to re-evaluate your choice. I recommend evaluating after building 3 mini sized websites or 6 months of part time building at abt 10 hrs a week at least, whichever is longer. If you can build full time (i.e. abt 30-40 hrs a week), then shorten to 3 mini-sized websites or 2 months of full time whichever is longer.

That should cover most edge cases i can think of.

@kimsia I appreciated your response. I think for now I'll go with Django. After 3-4 products. I'll see if I want to change the framework. Thanks for clearing my doubt. Also, if I'm going with Django. What should I do? do I first learn the full framework or just learn the API part and for the frontend, should I learn react.js?

Welcome 🙏

There is no “should”

Personally I thought be better for me if i learn how to do headless ie split into django backend and then react frontend.

I did kinda do that for that client project I told you from earlier.

Looking back I will say it’s a mistake.

In order to master react I needed time I don’t have.

Now my frontend is horribly outdated and I have no time to properly improve it

Ultimately my goal is same as you : build a product like a SaaS and run it as owner

If u need nice Ajax effects u can always try htmx which is good enough

Now I’m trying to slowly transition away from react to htmx.

I now agree with the philosophy of run less software by intercom. Google that article read it then hopefully you understand. I regret not knowing this earlier but like I said nothing is truly wasted. Just a matter of going shorter route or the longer route.

@kimsia In regards to react, you basically decided the time investment of both mastering Django and React together is too high so you wanted a simpler frontend? is that right?

If I can go back in time I will say to my previous self

“success is a multi variate function”

If under different circumstances eg i have enough free time under no work pressures will find django and react still too much?

Will a different person with my exact circumstances come to same conclusions?

I have to be intellectually honest

Not necessarily

Out of the same honesty value was it too much for me?

Yes and for the foreseeable future as well

For what I want to accomplish do I absolutely need react? No

Hence my conclusion is highly personal to my unique circumstances and my own innate capacity

Different people may reach different conclusions.

I make no sweeping statements about django or react in and of itself.

My comment only covers the interaction of my experience with those domains plus my circumstances

I can tell you I spent a lot of money trying to be good at react close to 1500 dollars over a few years

I really tried

Pick the one you’re more familiar with.

I was equally familiar with both abt 3-4 years ago when I started with a new client project when I had to pick a framework. Which meant at that time about zero.

Abt > 10 years before I used rails 2 in a stock market simulator project. Then I was project managing a django project and sometimes I had to go in and look at the code and help with small changes.

In the end I decided to pick django simply because I wanted to learn python.

Both are good enough

In fact I’m here in WIP because I’m my journey to learn django I “internet met” @jefftriplett who gave me invite here.

I faced this X and Y problem many years ago (>15 y ago). I was also told both are good enough. While intellectually I understood, I still persisted research.

Which was a waste of time.

Not saying you will also do that but if you do I understand and emphathize. Been there done that.

All I can say is this: either you pick a framework and move on to more impt stuff like understanding your user problem

Or

You spend more time researching like I once did.

I know the pain of using extra research as a way to procrastinate which is why about 3-4 years ago I decided to leave the php ecosystem when taking on a new client project, I needed to choose again. This time, I didn’t spend too much time with such research I did a cursory one between python and ruby and Javascript

Then between flask and django

Then that’s it.

Being intentional to be better in any framework or language matters more than the choice of language or framework

This is true for web technology afaik

Good luck 🤞

Start with an audience group you like or even better yet already a part of.

Why?

  1. It's very unlikely you dislike an audience group you're part of.
  2. It's very unlikely you cannot connect with an audience group you're part of.
  3. It's very unlikely you cannot understand deeply the kind of specific pain points or pressing needs of your fellow tribe members from the same audience group you're part of.

Tho it's possible you belong to an audience group that cannot pay or cannot pay enough for your efforts. But if you find something pressing or important enough, someone will pay...

There are many ways things can go wrong.

Let's start with the build first approach.

  1. You build a product but cannot get easy access to audience.
  2. You build a product can get easy access to audience but they not interested.
  3. You build a product can get easy access, they interested, but they cannot pay or cannot pay enough to make it worth your effort.

These 3 are for the build first approach.

Then the audience first approach (which i prefer) also can have many things wrong.

  1. You find an audience but you cannot connect with them.
  2. You find an audience you can connect with them, but you don't like them so you cannot stay connected with them for long.
  3. You find an audience, you can connect with them, you like them but you cannot build the things that solve their pressing needs or pain points.
  4. you find an audience you can connect with them, you like them, you can build but they cannot pay or pay enough to make it worth your effort.

The problems with build first tend to be the mirror image of audience first and vice versa.

Of all the problems i have, the least problem is building. Hence i choose the audience first approach. If i can find an audience and i like working with them and understanding them, and they can afford to pay, eventually i will be able to build something that works for them.

Case in point is my current revenue source a MNC client who can afford to pay, the main people i work with are nice and competent, tho i think some of the instructions from their upper management are a bit suboptimal and a small minority of the end users are not very good at their work which impacts me, and they asked me to build something i had no experience building and was complicated but eventually i figured it out .

Even tho it was not perfect and a bit 💩 but they kept using it cause it was so important for them.

Every time i build something before talking to any target audience or is a group i'm not already part of, it always fails.

Your mileage may vary.

Not sure you meant by "managing creds", I'm looking at storing codebase specific env variables for production on github secrets at the repo level.

Then somehow use github actions to deploy and re-create the .env file for production environments

UPDATE:

I wrote up of my current approach as a SO answer to my own question.

Reproduced below:

I realized I should have fleshed out the whole target scenario more explicitly in terms of hard requirements.

Target scenario: how to deploy from GitHub to a Ubuntu VPS

Hard requirements

Must use:

  • Github Actions
  • Ubuntu LTS VPS (I use DigitalOcean)

Must see:

  • the codebase on the VPS be updated to latest main branch
  • there is a new .env file in the project path on the VPS

Approaches

I discover 2 general approaches.

Approach 1. multiple actions + rsync method

Outline:
1. checkout action then rsync to update codebase
2. create-envfile then rsync

This approach uses mixture of GitHub Actions. Namely, checkout and create-envfile

Approach 2. ssh-action with bash script + git clone method

  1. ssh-action then
    1. git clone using bash script to update codebase
    2. create envfile using bash script

This approach uses 1 GitHub Action but it needs more bash scripting

I chose approach 2 because git clone is superior to rsync.

This is my ci.yml

name: Deploy via SSH
on: [workflow_dispatch]
jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-latest
    steps:
    - name: Deploy via SSH
      uses: appleboy/ssh-action@master
      with:
        host: ${{ secrets.SSH_HOST }}
        username: ${{ secrets.SSH_USERNAME }}
        key: ${{ secrets.SSH_KEY }}
        script: |
          # git update to latest codebase on main branch
          cd /path/to/project && git pull
          # updating the .env file
          cat <<EOF > ${{ secrets.ENVFILE_PATH }}
          # start of envfile
          DJANGO_SECRET_KEY=${{ secrets.ENVFILE_DJANGO_SECRET_KEY }}
          # end of envfile
          EOF
          # see end result of envfile
          ls -l ${{ secrets.ENVFILE_PATH }}

As for how to save the secrets to your GitHub repo for SSH access, please check this article

Note: the cloudflare was overzealous in hiding the repo and branch name which uses the @ symbol. So best to go read the SO answer to see the full response

Thank you for sharing KimSia :)

Is the direnv used for development envrionments on laptop? or also for production environments on linux VPS servers?

Another vote for direnv 👆only in development though - on production I usually use a PaaS (Heroku, Netlify etc).

Yes I did I spoke with 5 people as of today. Tho 1 of them I stumble on via Twitter so he’s not added on to the wait list. Strangely he spoke with me the longest. Nearly 3 hrs

Waitlist is now 8 people long