Welcome to the source code of my personal website! I developed this website to archive my favorite projects and write about my thoughts. The initial version in 2011 was written by hand, but I ported it to Jekyll, a static website generator, in 2018, and then to Next.js in 2025. The site uses Twitter's Bootstrap for mobile/tablet support.
My website is hosted at prateeksahay.com, psahay.com, and ptkinvent.com.
Make sure you have Git LFS installed:
sudo apt install git-lfs
cd website/
git lfs install
Set up a .env.local file:
NEXT_PUBLIC_SUPABASE_URL=...
NEXT_PUBLIC_SUPABASE_ANON_KEY=...
SUPABASE_SERVICE_ROLE_KEY=...
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=...
CLERK_SECRET_KEY=...
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
With Node installed, run:
npm install
npm run dev
Make sure you have Git LFS installed:
sudo apt install git-lfs
cd website/
git lfs install
With Node installed, run:
npm install
npm run build
npm install -g pm2
pm2 start "npm run start -- -p 8080" --name prateeksahay
With nginx installed, add the following nginx config:
server {
listen 80;
server_name prateeksahay.com www.prateeksahay.com;
rewrite ^ https://$host$request_uri? permanent;
}
server {
listen 443 ssl;
server_name www.prateeksahay.com prateeksahay.com;
index index.html;
root /home/ptkinvent/website;
ssl_certificate /etc/letsencrypt/live/prateeksahay.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/prateeksahay.com/privkey.pem;
location /_next/static {
alias /home/ptkinvent/website/.next/static;
add_header Cache-Control "public, max-age=3600, immutable";
}
location / {
try_files $uri.html $uri/index.html
@public
@nextjs;
add_header Cache-Control "public, max-age=3600";
}
location @public {
add_header Cache-Control "public, max-age=3600";
}
location @nextjs {
# reverse proxy for next server
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
server {
listen 80;
server_name ptkinvent.com www.ptkinvent.com;
rewrite ^ https://$host$request_uri? permanent;
}
server {
listen 443 ssl;
server_name www.ptkinvent.com ptkinvent.com;
index index.html;
root /home/ptkinvent/website;
ssl_certificate /etc/letsencrypt/live/prateeksahay.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/prateeksahay.com/privkey.pem;
location /_next/static {
alias /home/ptkinvent/website/.next/static;
add_header Cache-Control "public, max-age=3600, immutable";
}
location / {
try_files $uri.html $uri/index.html
@public
@nextjs;
add_header Cache-Control "public, max-age=3600";
}
location @public {
add_header Cache-Control "public, max-age=3600";
}
location @nextjs {
# reverse proxy for next server
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
server {
listen 80;
server_name psahay.com www.psahay.com;
rewrite ^ https://$host$request_uri? permanent;
}
server {
listen 443 ssl;
server_name www.psahay.com psahay.com;
index index.html;
root /home/ptkinvent/website;
ssl_certificate /etc/letsencrypt/live/prateeksahay.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/prateeksahay.com/privkey.pem;
location /_next/static {
alias /home/ptkinvent/website/.next/static;
add_header Cache-Control "public, max-age=3600, immutable";
}
location / {
try_files $uri.html $uri/index.html
@public
@nextjs;
add_header Cache-Control "public, max-age=3600";
}
location @public {
add_header Cache-Control "public, max-age=3600";
}
location @nextjs {
# reverse proxy for next server
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
https://medium.com/@jgefroh/a-guide-to-using-nginx-for-static-websites-d96a9d034940
- Install nginx and python3-certbot-nginx
- Clone github.com/ptkinvent/ptkinvent.github.io
- Jekyll build
- Edit /etc/nginx/sites-available/prateeksahay.com to add 443 conf and custom 404 page
- Added webhook: a. Installed Go: sudo apt install golang-go b. go get github.com/adnanh/webhook c. Create a hooks.json which points to a redeploy.sh (search webhooks on Gmail for more info)
- Unblocked port 9000 on GCloud Compute instance
- Set up commit hook on GitHub