Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fadi-george/advent-of-code-2024

bun typescript advent of code 2024
https://github.com/fadi-george/advent-of-code-2024

advent-of-code advent-of-code-2024 advent-of-code-2024-typescript aoc bun hono shadcn-ui tailwindcss tanstack-react-query tanstack-router typescript vite

Last synced: 15 days ago
JSON representation

bun typescript advent of code 2024

Awesome Lists containing this project

README

        

# Advent of Code 2024

Solutions written in Typescript.

Screenshot 2024-12-25 at 6 26 58 PM
Screenshot 2024-12-05 at 11 02 25 AM

## Setup

Install Bun: https://bun.sh/docs/installation

Create an `.env` file in the root folder. Set the value of `AOC_SESSION_COOKIE` to `'session='`.
You can grab your session cookie by looking at your headers in the network log on adventofcode.com.

Run `bun install` for each folder: `aoc`, `frontend`, and `server`.

## Running

### CLI

Can run individual files located in the `aoc` folder by passing in the `FILE`, `YEAR`, and `DAY` environment variables. E.g.

Create a `txt` file in the `aoc/2024/day` folder. If the file is named `input.txt`, then you can run the file with:

```
FILE=input YEAR=2024 DAY=1 bun aoc/index.ts
```

Bun version: 1.1.36 is recommended for debugging.

Can run the `Bun Debug AoC` launch config to run the script with debugging enabled.
This will require setting the `FILE`, `YEAR`, and `DAY` in a `.env` file in the root folder. E.g.

```
FILE=sample.txt
YEAR=2024
DAY=1
```

### Web App + Server

Run the hono backend server:

```
cd server;
npm run dev;
```

Run the frontend dev server:

```
cd frontend;
npm run dev;
```

Can navigate to different days and put in custom inputs.