what.lol Documentation and Blog
website·Indexed 31 days ago
https://what.lolA collection of project documentation and personal blog posts. Includes technical documentation for whatecom (React frontend components), qli (a Go-based quiz application), and dashboard-tifco, alongside career reflections and professional principles.
What's inside what.lol
- StoryTEL is a terminal-based interactive storytelling application built with Go. It implements a 'Choose Your Own Adventure' format using a Terminal User Interface (TUI). The application uses Bubble Tea for the UI framework and Lip Gloss for styling. It features a keyboard-driven interface (supporting arrow keys and vim-style j/k bindings) and automatically detects story files from a dedicated stories directory.
Implement a URL shortener using http.Handler in Go
The objective is to create an
http.Handlerthat inspects the path of incoming web requests and redirects the user to a target URL based on a predefined mapping (e.g., redirecting/dogstohttps://www.somesite.com/a-story-about-dogs).Implementation steps:
- Implement the stubbed methods in
handler.go. - Start by implementing the
MapHandlerfunction before moving to YAML parsing. - Use the
main/main.gofile to test the implementation.
- Implement the stubbed methods in
Navigate the application routing and logic in the app directory
The
appdirectory contains the following functional areas:dashboard: The primary application area. All pages except landing and login are nested here.(overview): A group route for the root/dashboardpage.customers: The customers table page.invoices: Routes for viewing, creating, and editing invoices.
lib: Utility functions, type definitions, and test data. Query logic is primarily located inactions.ts.login: Logic for the login page.seed: A dedicated route used to populate the database with initial placeholder data.ui: UI primitives, styling, fonts, and domain-specific components (e.g.,customers,dashboard, andinvoicescomponents including the pagination component).
GGOB Technology Stack Overview
GGOB is built using the following technologies:
- Next.js: React framework for server-rendered apps
- React: Component-based UI library
- Prisma: Database toolkit and ORM
- Tailwind CSS: Utility-first CSS framework
- Node.js: JavaScript runtime
- Vercel: Deployment platform
- ESLint: Code linting utility
Understand the project directory structure
The project follows a Next.js App Router architecture where the
appdirectory serves as the primary source for application logic, routing, and server components. Routing is determined by folder names and layouts.Key directories include:
~: Project configuration files and authentication logic.app: Main application code (equivalent tosrc).public: Static assets such as images.readme: Documentation screenshots.
Quiz application architecture overview
The quiz application is a single-file Go program that implements a command-line quiz game. It features CSV-based question loading, a configurable time limit, and optional question shuffling. The application uses a concurrent model to handle user input and timer expiration simultaneously without blocking.Run tests for qli development
Developers can verify the application's functionality by running the built-in Go test suite.go testInstall and run StoryTEL
StoryTEL is a terminal-based interactive story application. To use it, build the binary from the source and execute it from the terminal.# Build the application go build -o storytel ./cmd/storytel # Run the application ./storytelInstall and run TifCo dashboard locally
To set up the TifCo dashboard on your local machine, clone the repository, install the required dependencies using pnpm, and then either start the development server or create a production build to run locally.# 1. Clone the repository git clone https://github.com/Nostromos/TifCo.git # 2. Install dependencies pnpm install # 3. Run the development build pnpm dev # OR: Get a production build and run it locally pnpm build && pnpm startBuild and deploy GGOB for production
Prepare the GGOB project for production by running the build script, then start the production server.npm run build npm startEnhance Go Quiz CLI with string cleanup and shuffling
Improve the quiz experience by implementing the following bonus features:
- Input Normalization: Use the
stringspackage to trim whitespace and normalize capitalization of user answers to prevent false negatives. - Randomization: Add a CLI flag to shuffle the order of questions each time the quiz is run.
- Input Normalization: Use the
Implement a CSV-based Quiz CLI in Go (Part 1)
Create a CLI program that reads a quiz from a CSV file and tracks the user's score. The program must support a user-provided CSV path via a flag, defaulting toproblems.csv. The CSV format consists of two columns: the question and the answer. The program should iterate through all questions (up to 100), accept single-word/number answers, and output the total number of correct answers versus the total number of questions at the end. Use the standard Goencoding/csvpackage to handle potential commas within questions.5+5,10 7+3,10 "what 2+2, sir?",4