Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sgoudham committed Apr 17, 2023
0 parents commit 005e6ee
Show file tree
Hide file tree
Showing 34 changed files with 3,493 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
assets
node_modules
.next
.github
.husky
.direnv
flake.lock
flake.nix
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish Docker Image

on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- '**.tsx'
- '**.js'
- 'package.json'
- 'Dockerfile'

jobs:
push_to_registry:
name: Push Image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Log Into Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build/Push Image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/website:latest
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem
.idea

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# nix
.direnv/
.envrc
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Contributing

Thank you for your interest in contributing to this project! I really appreciate it <3

## Got a Question?

Please raise an issue with the `question` label. This ensures that bugs are separated from genuine questions.

## Found an Issue or Bug?

Please raise an issue on if you think you have found any issues or bugs. Even better, it would be great to submit
a [Pull Request](https://github.com/sgoudham/website/compare) including the fix.
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Installing Dependencies
FROM node:18-alpine AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
RUN yarn add sharp

# Building Website
FROM node:18-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN yarn build

# Production Image
FROM node:18-alpine AS runner
WORKDIR /app
ENV NODE_ENV production

RUN addgroup --system --gid 1001 nextjsgroup
RUN adduser --system --uid 1001 nextjsuser

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjsuser:nextjsgroup /app/public ./public
COPY --from=builder --chown=nextjsuser:nextjsgroup /app/package.json ./package.json
COPY --from=builder --chown=nextjsuser:nextjsgroup /app/.next/standalone ./
COPY --from=builder --chown=nextjsuser:nextjsgroup /app/.next/static ./.next/static
COPY --from=builder --chown=nextjsuser:nextjsgroup /app/node_modules/next/dist/compiled/jest-worker ./node_modules/next/dist/compiled/jest-worker

USER nextjsuser

EXPOSE 3000
ENTRYPOINT ["node", "server.js"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Hamothy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
75 changes: 75 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<h1 align="center">
My Personal Website
</h1>

<h3 align="center">
<a href="https://goudham.com"><img src="assets/me-circle.png" width="150px" alt=""/></a><br>
<img src="https://raw.githubusercontent.com/catppuccin/catppuccin/bbc6efd2096b8cfa82d00f8ad1099b1b2b34fc8f/assets/misc/transparent.png" height="30" width="0px"/>
<a href="https://goudham.com">✨ https://goudham.com ✨</a>
<img src="https://raw.githubusercontent.com/catppuccin/catppuccin/bbc6efd2096b8cfa82d00f8ad1099b1b2b34fc8f/assets/misc/transparent.png" height="30" width="0px"/>
</h3>

Believe it or not, this is what I'd consider to be my first "project" involving modern front-end technologies. I don't
have much experience with the tech stack that I've chosen here or even front-end development in general.

I hope this maybe, just maybe inspires someone else to just throw themselves into a project and have some fun along the
way :D

Also, *technically*, this is a **work-in-progress** but shh...

## Dependencies

- NodeJS 18
- Yarn
- **(Optional)** Container Orchestration Tool (e.g Docker)

If you're a ~~filthy~~ [Nix/NixOS](https://nixos.org/) user, you can take advantage of the [flake.nix](flake.nix) by
running `nix develop` to automatically get a shell with all the required dependencies.

## Building

1. Install the required dependencies via `yarn`

```shell
yarn install
```

2. Run the development server

```shell
yarn dev
```

If you're a containers type of person, you can instead run the server via the
provided [Dockerfile](Dockerfile):
```shell
docker build -t website .
docker run --rm -it -p 3000:3000 --name website website:latest
```
## Deployment
This is mostly for me when I revisit this godforsaken project in 7 months having forgotten everything :P
This repository has a [publish.yml](.github/workflows/publish.yml) action which automatically builds
the [Dockerfile](Dockerfile) and pushes
to [Docker Hub](https://hub.docker.com/repository/docker/sgoudham/website/general) with the latest updates. This image
is then automatically retrieved by [Watchtower](https://containrrr.dev/watchtower/) on my server which automatically
replaces the production docker container, therefore deploying the new updates to production. (In the future, I may
switch this workflow to only use [Portainer](https://www.portainer.io/).)
### Manual Commands
```shell
docker tag website:latest sgoudham/website:latest
docker push sgoudham/website:latest
```
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md)
## License
[MIT](LICENSE)
Binary file added assets/me-circle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
devShells.default = pkgs.mkShell {
name = "yarn-shell";
buildInputs = with pkgs; [
nodejs-18_x
(nodePackages.yarn.override { nodejs = nodejs-18_x; })
];
};
}
);
}
13 changes: 13 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
output: "standalone",
i18n: {
defaultLocale: "en",
locales: [
"en"
]
}
}

module.exports = nextConfig
31 changes: 31 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "goudham",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@types/node": "18.15.11",
"@types/react": "18.0.35",
"@types/react-dom": "18.0.11",
"autoprefixer": "^10.4.14",
"eslint": "8.38.0",
"eslint-config-next": "13.3.0",
"keen-slider": "^6.8.5",
"next": "13.3.0",
"next-seo": "^6.0.0",
"postcss": "8.4.21",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "3.3.1",
"tailwindcss-animate": "^1.0.5",
"typescript": "5.0.4"
},
"devDependencies": {
"@catppuccin/tailwindcss": "^0.1.1"
}
}
17 changes: 17 additions & 0 deletions pages/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { pacifico } from "@/pages/index";
import Link from "next/link";

export default function Custom404() {
return (
<div className={`flex flex-col items-center ${pacifico.variable} justify-center h-screen`}>
<div className="font-pacifico text-center leading-relaxed md:leading-normal">
<h1 className="text-3xl text-base mb-10">
404 | Page Not Found
</h1>
<h2 className="text-2xl text-crust underline">
<Link href="/">Go Back Home</Link>
</h2>
</div>
</div>
)
}
Loading

0 comments on commit 005e6ee

Please sign in to comment.