feat: update the readme and add wasm build script

This commit is contained in:
Jet Pham 2025-11-18 00:45:50 -08:00
parent 2ec0ee9640
commit 07584f48ec
No known key found for this signature in database
3 changed files with 144 additions and 25 deletions

View file

@ -10,72 +10,94 @@ The site originally contained a blog. It was made in Next.js plainly with plain
I started to become more obsessed with Rust and rewrote my website from being a blog into a static linktree site made in rust via WASM. It was in ASCII style using a modified fork of ratatui and had a fun implementation of Conways Game of Life in the background. I started to become more obsessed with Rust and rewrote my website from being a blog into a static linktree site made in rust via WASM. It was in ASCII style using a modified fork of ratatui and had a fun implementation of Conways Game of Life in the background.
After leaving that website alone, I started to make more web based projects in Next.js. I realized I could properly make this website awesome and still keep the interesting style in the site while making it more performant, responsive, and accessible. This is the state that you see the website in now. Features like the Q+A are inspired directly from my friend Clover's website: ([paperclover.net](https://paperclover.net/)). Go check out her awesome site! After leaving that website alone, I started to make more web based projects in Next.js. I realized I could properly make this website awesome and still keep the interesting style in the site while making it more performant, responsive, and accessible. This is the state that you see the website in now.
I have some awesome features packed in this site now that represent all the cool things I'm interested in: I have some awesome features packed in this site now that represent all the cool things I'm interested in:
- ANSI rendering of my name in css!
- ANSI rendering of my name in CSS!
- Terminal style text, font, and colors just like BBS - Terminal style text, font, and colors just like BBS
(To be implemented) - Rust WASM implementation of Conway's Game of Life running in the background
- Rust WASM implementation of Conway's Game of Life with Rayon
- Super cool blog filled with stuff about me
- A sick Q+A inspired from ([paperclover.net](https://paperclover.net/))
- Projects page with info about projects I've made
- List of socials and contact info - List of socials and contact info
Let me know if you have any feedback about the site! Let me know if you have any feedback about the site!
## Tech Stack ## Tech Stack
- [Next.js 15](https://nextjs.org) - [Next.js 15](https://nextjs.org) with Turbo mode
- [NextAuth.js v5](https://next-auth.js.org) - [Prisma](https://prisma.io) with PostgreSQL
- [Prisma](https://prisma.io)
- [Tailwind CSS v4](https://tailwindcss.com) - [Tailwind CSS v4](https://tailwindcss.com)
- [tRPC](https://trpc.io) - [tRPC](https://trpc.io)
- [TypeScript](https://www.typescriptlang.org/) - [TypeScript](https://www.typescriptlang.org/)
- [React Query](https://tanstack.com/query) - [React Query](https://tanstack.com/query)
- [React 19](https://react.dev/)
- Rust + WebAssembly (for Conway's Game of Life)
- [Bun](https://bun.sh) (package manager)
## Development ## Development
### Prerequisites ### Prerequisites
- Bun - Bun
- Docker - Docker (or Podman)
- Rust (for building the Conway's Game of Life WASM module)
- wasm-pack (install via `curl https://drager.github.io/wasm-pack/installer/init.sh -sSf | sh` or use the install script)
### Getting Started ### Getting Started
1. Clone the repository 1. Clone the repository
2. Install dependencies:
2. Build the Rust WASM module:
```bash
bun run build:wasm
```
Or use the install script which will also install wasm-pack if needed:
```bash
./install.sh
```
3. Install dependencies:
```bash ```bash
bun install bun install
``` ```
3. Set up environment variables: 4. Set up environment variables:
```bash ```bash
cp .env.example .env.local cp .env.example .env.local
# Edit .env.local with your configuration # Edit .env.local with your configuration
``` ```
4. Set up the database: Adjust the database URL as needed for your setup.
5. Start the database:
```bash
./start-database.sh
```
This script will start a PostgreSQL database in a Docker or Podman container. Make sure Docker or Podman is installed and running.
6. Set up the database schema:
```bash ```bash
bun run db:push bun run db:push
``` ```
5. Start the development server: 7. Start the development server:
```bash ```bash
bun run dev bun run dev
``` ```
The site will be available at `http://localhost:3000`.
## Project Structure ## Project Structure
``` ```
src/ src/ - Next.js app router pages
├── app/ # Next.js App Router pages cgol/ - Rust WASM module for Conway's Game of Life
│ ├── _components/ # Reusable UI components
│ ├── admin/ # Admin dashboard
│ └── api/ # API routes
├── server/ # Server-side code
│ ├── api/ # tRPC routers
│ └── auth/ # Authentication configuration
├── styles/ # Global styles
└── trpc/ # tRPC client configuration
``` ```

96
flake.lock generated Normal file
View file

@ -0,0 +1,96 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1763283776,
"narHash": "sha256-Y7TDFPK4GlqrKrivOcsHG8xSGqQx3A6c+i7novT85Uk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "50a96edd8d0db6cc8db57dab6bb6d6ee1f3dc49a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1744536153,
"narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1763433504,
"narHash": "sha256-cVid5UNpk88sPYHkLAA5aZEHOFQXSB/2L1vl18Aq7IM=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "42ce16c6d8318a654d53f047c9400b7d902d6e61",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View file

@ -5,6 +5,7 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"build": "next build", "build": "next build",
"build:wasm": "cd cgol && wasm-pack build --release --target web",
"check": "next lint && tsc --noEmit", "check": "next lint && tsc --noEmit",
"db:generate": "prisma migrate dev", "db:generate": "prisma migrate dev",
"db:migrate": "prisma migrate deploy", "db:migrate": "prisma migrate deploy",