1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
# [ThatComputerScientist](https://thatcomputerscientist.com)
[](https://github.com/luciferreeves/thatcomputerscientist/actions/workflows/main.yml)
[](https://github.com/sponsors/luciferreeves)
[](LICENSE)
[](https://github.com/luciferreeves/thatcomputerscientist/graphs/contributors)
This repository contains the source code for my personal website which is available at [thatcomputerscientist.com](https://thatcomputerscientist.com) — a retro-looking open-collaboration blog about computer science, statistics, mathematics, programming, and more.
The website is currently in development, but I hope to release it in the future. This entire repository is open-source, and is licensed under the [MIT license](LICENSE.md). More information about the MIT license can be found [here](https://opensource.org/licenses/MIT).
If you would like to contribute to the website, please see the [contributing guide](#contributing).
## Screenshot
Below is the screenshot of how the website looks like right now. This screenshot is being updated programatically by [That Computer Scientist's Screenshot API](https://api.thatcomputerscientist.com/screenshot), and will update as I push more changes to the repository.

## Cloning, Installing, and Running
This project is built using [Node.js](https://nodejs.org) and utilizes the [Express.js](https://expressjs.com) framework. The website is deployed using [Fly.io](https://fly.io) — Please see [Deployment Instructions](#deployment-instructions) for more information on deployment process.
In order to run the project locally, create a [fork](https://github.com/luciferreeves/thatcomputerscientist/fork) of the repository. Then, clone the fork.
```bash
git clone https://github.com/<username>/<fork>.git
```
Inside the cloned repository, run the following command to install the dependencies:
```bash
npm install
```
Then, run the following command to start the development server:
```bash
npm run dev
```
Open [localhost:3000](http://localhost:3000) in your browser to view the website. Please note that the project also utilizes subdomains. As for the lack of subdomain support on the **_localhost_** page, you can open [vcap.me:3000](https://vcap.me:3000) in your browser alternatively. If you wish to navigate to a subdomain, you can use [<subdomain>.vcap.me:3000](https://<subdomain>.vcap.me:3000) in your browser.
## Deployment Instructions
The website uses [Fly.io](https://fly.io) as its deployment platform. If you would like to follow the deployment process in detail, please see [Build, Deploy & Run a Node Application](https://fly.io/docs/getting-started/node/) guide from the official [Fly.io Docs](https://fly.io/docs).
### Installing flyctl on your machine
The first step is to install the flyctl CLI tool on your machine. Installation instructions could vary based on your operating system. I am taking this from the [Installing flyctl](https://fly.io/docs/getting-started/installing-flyctl/) guide.
> It is recommeded to follow the guide for the latest installation instructions.
<details>
<summary>macOS</summary>
<p>If you have the <a href="https://brew.sh/">Homebrew</a> package manager installed, flyctl can be installed by running:</p>
<pre><code>brew install flyctl</code></pre>
<p>If not, you can run the install script:</p>
<pre><code>curl -L https://fly.io/install.sh | sh</code></pre>
</details>
<details>
<summary>Linux</summary>
<p>Run the install script:</p>
<pre><code>curl -L https://fly.io/install.sh | sh</code></pre>
</details>
<details>
<summary>Windows</summary>
<p>Run the Powershell install script:</p>
<pre><code>iwr https://fly.io/install.ps1 -useb | iex</code></pre>
</details>
<br>
### Signup or Login
Next, Create an account with `flyctl auth signup` or login with `flyctl auth login`.
### Create a configuration and deploy to fly.io.
Finally, run `flyctl launch` to create, configure, and deploy a new application. Please note that this command creates a [fly.toml](fly.toml) configuration specific to your account, so you would need to **DELETE** the file before running the command.
```bash
rm fly.toml
flyctl launch
```
### Status of the deployment
The status of the deployment can be viewed by running `flyctl status`. You can also open your deployed website by running `flyctl open` from the directory where you cloned the repository.
### Deploying Changes
After you have made changes to the source code, you can deploy them by running `flyctl deploy`.
### Automatically Deploying Changes using GitHub Actions
If you would like to automatically deploy changes to your website when you push to the repository, you can use the [GitHub Actions](
https://help.github.com/en/actions/configuring-and-managing-workflows/using-github-actions) workflow. First, you would need to create a new authentication token for your repository. You can do this by running the following command:
```bash
flyctl auth token
```
Then, you would need to add the token to your repository's settings.
Go to your repository settings, then select "Secrets" from the sidebar, and create a secret called `FLY_API_TOKEN` with the value of the token you just created.
Then, you would need to create [.github/workflows/main.yml](.github/workflows/main.yml) file. You can take a look at the file present in this repository for reference or copy and paste the following contents into the file:
```yaml
name: Fly Deploy
on: [push]
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
```
Then, you can push your changes to the repository and the workflow will automatically deploy your changes.
## Contributing
There are various ways to contribute to the project. Here is a short summary of the ways you can contribute. A detailed contributing guide is available in the [CONTRIBUTING.md](CONTRIBUTING.md) file.
### 🐞 Found a bug?
You can report a bug by [opening an issue on GitHub](https://github.com/luciferreeves/thatcomputerscientist/issues). Please include a detailed description of the bug and a screenshot of the error. You can also provide additional information about your system and browser. Make sure to use the [Bug Report](https://github.com/luciferreeves/thatcomputerscientist/issues/new?assignees=&labels=bug&template=bug_report.md&title=%5BBUG%5D) template for your issue.
### 📝 Suggestions for improvement?
You can suggest improvements to the project by [opening an issue on GitHub](https://github.com/luciferreeves/thatcomputerscientist/issues). Please include a detailed description of the improvement and a screenshot of the improvement. Make sure to use the [Feature Request](https://github.com/luciferreeves/thatcomputerscientist/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=%5BENHANCEMENT%5D) template for your issue.
### 🔨 Tinkered with the code? Submit a pull request.
If you made any changes to the source code and want it to be included in the next release, you can [submit a pull request on GitHub](https://github.com/luciferreeves/thatcomputerscientist/pulls). Please include a detailed description of the changes and a screenshot of the changes.
|