My Web Development Process Part 2: Code
Tags: webdev
Published: 2019-03-04 01:52:32

---
title: My Web Development Process Part 2: Code
published: true
cover_image: https://thepracticaldev.s3.amazonaws.com/i/jg6wzqifsb3jdmw8178z.jpg
description: Discussing how I develop web-based apps from design and code to deployment.
tags: webdev
---

> I'll be discussing how I develop web-based apps. I'll include how I do things, what software I use, and resources that helped me. I'm still a college student. So I expect that my web development process will greatly evolve once I enter the workplace and gain more experience.

In this post, I'll be discussing the **code** part of my process.  If you missed the first one, feel free to read the Design Part of my process. 😊

{% link https://dev.to/jorenrui/my-web-development-process-part-1-design-7l1 %}

For now, I'm following these steps:

1. Research and Ideation
2. Design 
   - User Experience (UX) Design 
     - Rough Sketches
     - Wireframe
   - User Interface (UI) Design
   - Database Design
3. [Coding](#code)
   - [Front End Development](#front-end)
   - [Back End Development](#back-end)
4. [Test and Deployment](#test-deploy)

---

## Coding <a name="code"></a>

Now that the designs are finalized, we can now start coding. My process consists of two parts:

- [Front End Development](#front-end) - where I translate design to code.
- [Back End Development](#back-end) - where I add some logic and database.

I do front end first, then the back end after. 

I put breaks in between whenever I'm coding. This lets me ponder on the task I'm working on. I also realized that when I ran into a bug, breaks help. I'll set a time frame to work on that bug. When the time is up, I took a break whether I like it or not.

I let my mind wander while I do other stuff that isn't coding. This makes me think of the solution from a different perspective. Not only machines overheat when overused, so does your brain. If you want to deliver your best, then you should practice self-care.
<br><br>
### Front End Development <a name="front-end"></a>

Before I code, I gather the assets that I need such as:

- Fonts and Icons
- Pictures
- Others

I also think of these questions

- Am I gonna use templates or should I go with a *custom one*?
- Am I building this app with *scale* in mind?

These questions are often considered in the design and planning phase. So you may know the answers by now.

*If* you're using a **template**, then you can skip this part and go straight to [Back End Development](#back-end).

*Else if* you're going to create a **custom one** then go ahead.

#### The Grid

I first start with analyzing the layout of the design. I identify the *squares* in each screen.

Let's take this as an example:

![Tribute Page for Steve Jobs](https://thepracticaldev.s3.amazonaws.com/i/yiw4ko20jk74r2v0tqlr.png)
<figcaption>
    <a target="_blank" href="https://jorenrui.gitlab.io/fcc-tribute-page/">Tribute Page I built for CSS Grid practice</a>. Check the repo <a target="_blank" href="https://gitlab.com/jorenrui/fcc-tribute-page">here</a>.
</figcaption>

Those elements are all contained within a *box*. Highlighting them, the result would be:

![Tribute Page for Steve Jobs drawn with colored boxes](https://thepracticaldev.s3.amazonaws.com/i/b96eumsow99n2oqh9z2g.png)

I took a top-down approach. Starting from the bigger components then down to the smaller ones.

![Side by side picture of the Tribute Page](https://thepracticaldev.s3.amazonaws.com/i/7y3nw2geia5zknnyup9p.png)

This way I'll get a clear grasp on its **grid layout**. In here, the design has two major columns. The left is for the image with its caption, and the right is for the quote and some info. If the image on the left covered the whole left column, then I'll know that it's a background of a `div`. But since it isn't, I can tell that it is an `img` tag inside a `div`. Though, it depends. One can have many solutions for an answer. You just have to pick the most suitable for that situation.

Knowing how the layout is organized helps in knowing what kind of grid you're going to make. Then, I code the grid (CSS Grid, Bootstrap, etc.). I temporarily add background colors to visualize it.

![Grid Layout](https://thepracticaldev.s3.amazonaws.com/i/owdz1tgvvj1ihdlokswd.png)

You can see the CSS Grid using Developer Tools:

![Developer Tools](https://thepracticaldev.s3.amazonaws.com/i/kb1vwsrnan0kf369mzkf.png)

![A page in which the CSS Grid Layout is highlighted](https://thepracticaldev.s3.amazonaws.com/i/jhh5dakqugiyc4z0ddfg.png)

Though, you can also use it to see the grids you made using frameworks. Just use Developer Tools to your own advantage.

#### Iterate throughout the pages of the website

Then, I'll repeat these steps:

- Make a Grid (HTML & CSS)
- Add elements (HTML) - preferably use semantic tags
- Add styles (CSS)
- Add behavior (JS)
- Make it look good on different browsers (support IE, I dare lol. Just think of [graceful degradation](https://developer.mozilla.org/en-US/docs/Glossary/Graceful_degradation))
- Polish its responsiveness for mobiles, tablets, etc. (Media Queries)

When I code, I go through each section per page. Then each page per website.

![Multiple images of the development of the tribute page from start to finish](https://thepracticaldev.s3.amazonaws.com/i/vtskio8w9am4p19vlrie.jpg)

Don't forget to polish your site for SEO and Accessibility.

When the front end is done, I test deploy the app. Then, ask a teammate to test and review it. After that, I work on the revisions or bug fixes.

Though, your process may evolve as you decide to use frameworks, libraries, preprocessors, task runners and such. What I've shown is the simple way (for me, I think haha) in doing the front end.
<br><br>
### Back End Development <a name="back-end"></a>

I've only done back end twice: during my OJT and now in my current school project. So, I got nothing much to say in this.

Anyways, my process kinda looks like this:

- Code the Database (Tables, views, and etc.)
- Populate the Database
- Work on Authentication (Login, Register, and etc.)
- Work on each module (Do them based on priority)
  - Add CRUD Operations
  - Add Tricky Operations
- Polish the Access Control
- Polish the Security/Validations

I prefer having mock data to work with that is why I start with the Database.
<br><br>
### Code Editor (in case you're curious)

For my code editor, I use:

- [Visual Studio Code](https://code.visualstudio.com/) (powerful editor that has built-in git and terminal)
- [Sublime Text](https://www.sublimetext.com/) (simple editor that is quick and easy to use) then pairing it with [Hyper](https://hyper.is/) (a beautiful interface)

I often switch around these two editors depending on my mood. Anyways, there are also other editors you can try out:

- [Atoms](https://atom.io/)
- [Brackets](http://brackets.io/)
- [Vim](https://www.vim.org/)
- Others

I've installed both [Firefox](https://www.mozilla.org/en-US/firefox/new/) and [Chrome](https://www.google.com/chrome/). While [Microsoft Edge](https://www.microsoft.com/en-ph/windows/microsoft-edge) is already installed. I mainly use Firefox for development then check the app using the other browsers.

---

## Test and Deployment <a name="test-deploy"></a>

Now that the coding/development phase is done, we can now start testing. By the way, you can do Test Driven Development in the previous phase. It is where you write tests first, then work on creating functional code that passes these tests.

After doing some front end, I test out my code if it works on all browsers. Then, I test out the functionalities one by one after adding some back end. When everything is all set, I test deploy the app and ask someone else to review and test it. Often times, they'll discover an issue. 

In the beginning, I used these for deployment:

- [000webhost](https://ph.000webhost.com/) - it can host PHP+MySQL apps for free. (Yes, I use PHP for now... hehe)
- [GitHub Pages](https://pages.github.com/) - for static websites

I was intimidated with the Command Line Interface (CLI) at first. I even upload files to GitHub instead of using Git lol.

Now, I have seen the awesomeness and the glory of using the CLI. So I now use these for deployment:

- For Static Websites:
  - [Netlify](https://www.netlify.com/)
  - [Surge](https://surge.sh/)
  - [GitHub Pages](https://pages.github.com/)
  - [GitLab Pages](https://about.gitlab.com/product/pages/)
- For Web Apps:
  - [Heroku](https://www.heroku.com/)
  - and [remotemysql](https://remotemysql.com/) - for testing only

You might want to check out this article regarding Deployment 👇

{% link https://dev.to/jorenrui/6-ways-to-deploy-your-personal-websites--php-mysql-web-apps-for-free-4m3a %}

---

## Wrapping Up

Seeing how requirements turn into designs which in turn be translated into code is awesome. You don't need to dive in deeper in other phases. Gaining some insights is enough. Understanding the fundamentals of other areas besides coding can help you grow as a developer.

For the coding part, all I can is that *tests* are important. Do it before or after you code the functionalities. Just don't forget about it. Also, getting feedback from your teammates is valuable. They may see something you might have overlooked.

Hope that sharing my web development process helped you in any way. Now I'm curious how you guys do yours. 😆

Thanks for reading and happy coding! ✨