# Introducing Diode: Easily deploy your web apps in two steps 🚀

# What is Diode 🧑‍💻


![Screenshot 2022-06-30 at 1.21.28 AM.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1656532322603/Lsyme5J7Q.png align="center")

Diode is a platform that lets you deploy your web apps on Linode in two easy steps
 
- Connect your source code 
- Choose instance details

so that you can spend more time on developing awesome products and less time worrying about getting them up and running 😉


# Inspiration 💡

The inspiration to build Diode came from two different demographic of people, sharing the same problem.

### Side Projects 🗃

As developers, we all have side-projects that got stashed away and never made it to production. A lot of people find getting their application up and running takes a lot of time, both in terms of operations and learning the tools.

### Newbies 👶


A vast majority of newbies skip the deployment part after they have built their initial projects. Learning the tools and setting them up on a remote server is quite daunting for someone who just learned the basics of how things work.

![EVVBLqjXgAAX5Il.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1656103181590/DIJn8OiN7.jpeg?height=350 align="center")


Even though there are some platforms like Heroku and Railway, they require some additional files like a `Procfile` to deploy. We tried making Diode as easy to use as possible so that it saves effort and is beginner-friendly at the same time.

# Features ✨


- Choose region & Linode Plan suited as per your needs 🌍
- Monitor deployment status 🔴 🟡 🟢
- Check live metrics like CPU usage, memory usage of your Linode instance 📈
- Check `output` & `error` logs of your application 📝
- Re-deploy changes ♻️

#### Supported Buildpacks

Currently, we support the following frameworks/libraries for 2 step deployment: 

<img alt="FastAPI" src="https://img.shields.io/badge/fastapi-009688?style=for-the-badge&logo=fastapi&logoColor=white"/>
<img alt="Flask" src="https://img.shields.io/badge/flask-000000?style=for-the-badge&logo=flask&logoColor=white"/>
<img alt="Flask" src="https://img.shields.io/badge/react-61DAFB?style=for-the-badge&logo=react&logoColor=white"/>
<img alt="NodeJS" src="https://img.shields.io/badge/node.js-339933?style=for-the-badge&logo=node.js&logoColor=white"/>

# Instructions 👩‍🏫

### Ingredients 


- A GitHub account
- A repository which you want to host
- A Linode account (obviously!)

*Note: Currently, we only support Public Repositories. We are planning to bring support for private & organization repositories soon**

### Recipe 

#### 1. Generate a Personal Access Token from your Linode Account

![Screenshot 2022-06-29 at 12.35.15 PM.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1656486319110/V6s6BGMxq.png align="center")

While generating the token, make sure you have selected `Read/Write` access for  `Account`, `IPs` and `Linodes`.

Copy the token generated as it will be used in the next step.

#### 2. Head to [diode.radioactive11.com](https://diode.radioactive11.com)


![login.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1656532402966/LqdvLDa22.png align="center")

Enter your Personal Access token which was generated in the previous step. This will allow us to manage instances from your account.


#### 3. Choose a Repository


![repo.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1656534720036/0-P1bVDWG.png align="center")

For this example, I will choose my `FastAPI Sample App`. Next, choose the buildpack, which in this case would be FastAPI


#### 4. Enter `Environment Variables` (optional)


![env.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1656534834220/Koe0ccwIK.png align="center")

Enter the environment variables (often saved in the  `.env` file)


#### 5. Name your Project and Select a Region

![name.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1656535427749/b9LnPj9pz.png align="center")

Choose a name for your project and the region where it will be hosted. Prefer choosing geographically closer regions for less latency. In this case, I will choose `ap-west`


#### 6. Choose Instance Type


![instance.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1656535652983/_FDdoZota.png align="left")

Based on the performance requirements of your application, choose an instance type. For this example, I will choose a `g6-nanode-1` as it is the simplest Linode option for this sample app.

*Note: The create instance action takes a little bit of time so please be patient 😅*

#### 7. Deploy 🚀 


![deployment.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1656536809564/ZP6xFD7zU.png align="center")

#### 8. Metrics 📈


![graph.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1656537129267/QT0DukxWV.png align="center")

You can view your Linode's metrics from the dashboard by selecting an app. 

Sit back and watch your app get deployed 😎


### Result


![result.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1656536833342/5jzhAmWkh.png align="center")

# Built With 🛠

#### Backend

There are two backend servers, one using `NodeJS` with `Mongo DB` for handling the user accounts, and `FastAPI` with `Celery` and `Redis` for automating the deployments and managing User Linode accounts. We used Linode to host these servers.

#### Frontend

We built the frontend using `Next.js` which was hosted on Vercel.

#### Code Quality
We used ESLint & Prettier for JavaScript and Black for Python to keep the codebase nice and clean 🌟

# Development Roadmap 🛣

While building Diode, we felt that there were a ton of useful features that we could have implemented but weren't able to do so because of time constraints (we had our end-semester exams 😢). Here's a list of things that we plan to integrate soon!

#### 1. Support for Private GitHub repositories
#### 2. Automatic deploy on `git push` to selected branch (CI/CD)
#### 3. Providing domain name instead of IP addresses to user (eg. superbass.diode.com)
#### 4. Improving the UI

# Open Source 🤗

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

- Fork the Project
- Create your Feature Branch `(git checkout -b feature/AmazingFeature)``
- Commit your Changes `(git commit -m 'Add some AmazingFeature')`
- Push to the Branch `(git push origin feature/AmazingFeature)`
- Open a Pull Request

# Try it out 👾

%[https://github.com/radioactive11/diode]
[Link to Website](https://diode.radioactive11.com)

%[https://www.youtube.com/watch?v=poy3rXN0uvw]

# The Team 🤖

- [Arijit Roy](https://github.com/radioactive11/)
- [Kartik Goel](https://github.com/kg-kartik/)
- [Gautam Arora](https://github.com/Gautam-Arora24)
- [Esha Baweja](https://github.com/eshabaweja)

# Note of Thanks 💚

Thank you Linode & Hashnode for hosting this amazing hackathon. We got to learn a lot while building this project 🥳


