···44challenges and face your friends on various metrics (code length, runtime and
55more!).
6677-The goal is just to have a neat place to challenge you are your friends on dumb
88-on some golf code or stupid optimization problems. You could do a challenge
99-where you have to have as little as possible python code, or the fastest C as
1010-an optimization problem, or even the shortest assembly generated code (with gcc,
1111-no LLVM compilers).
77+The goal is just to have a neat place to challenge for you and your friends to
88+compete on dumb golf code challenges or stupid optimization problems. You could
99+do a challenge where you have to solve it with the shortest possible python
1010+code, or the fastest C as an optimization problem, or even the shortest assembly
1111+generated code (with gcc, no LLVM compilers).
1212+1313+The app is deployed at [uiua.online](https://uiua.online) (this is a temporary domain name I bought for 0.80$).
121413151416## data ownership
15171616-All your data is yours. You'll connect to the application using your
1717-[internet handle](https://internethandle.org/) (aka. atproto identity, also
1818-known as bluesky account).
1818+All your data is yours. You'll connect to the application using your [internet
1919+handle](https://internethandle.org/) (aka. atproto identity, also known as
2020+bluesky account).
19212022All the data you'll produce will be stored on your
2123[PDS](https://atproto.com/guides/data-repos) (Personal Data Server). When you
2222-create a challenge, create tests cases, solutions, etc. everything is stored
2323-on your PDS by default (you can store it privately on the platform, but this
2424-is opt-in by design). The problems you'll write solutions for will be stored
2525-on your PDS by default as well.
2424+create a challenge, create tests cases, solutions, etc. everything is stored on
2525+your PDS by default (you can store it privately on the platform, but this is
2626+opt-in by design). The problems you'll write solutions for will be stored on
2727+your PDS by default as well.
26282729The goal is to allow users to own their data, be able to change platforms as
2828-they see fit, even after the project dies. As long as their account exists
2929-on *THEIR* PDS, they can access their data and continue using it. For the
3030-moment, we wont permit the creation of new accounts on this app, users will have
3131-to create it on any other platform on the atmosphere (as it requires more
3030+they see fit, even after the project dies. As long as their account exists on
3131+*THEIR* PDS, they can access their data and continue using it. For the moment,
3232+we wont permit the creation of new accounts on this app, users will have to
3333+create it on any other platform on the atmosphere (as it requires more
3234unesserary deployment complexity). I want to have the platform as open as
3333-possible. The user with just have to log in with their handle/did, complete
3434-the OAuth flow with their PDS, and then they can start using the platform
3535-without having to create an account on this platform.
3535+possible. The user with just have to log in with their handle/did, complete the
3636+OAuth flow with their PDS, and then they can start using the platform without
3737+having to create an account on this platform.
3838+3939+To learn more, I invite you to check out atproto documentation, or explore the
4040+atproto collections linked to my account
4141+[drawbu.dev](https://pdsls.dev/at://did:plc:pj5vgcebbi6shqj6zapminia).
364237433844## data / lexicon
···98104## stack + deployment strategy
99105100106The app was planned to be a Golang + SvelteKit app deployed on Cloudflare
101101-workers, but because of too many issues with the Go app compiled to WASM
102102-on the workers runtime, I decided to switch to a full-stack app using
103103-[Tanstack Start](https://tanstack.com/start/latest) + [Solid](https://www.solidjs.com/).
107107+workers, but because of too many issues with the Go app compiled to WASM on the
108108+workers runtime, I decided to switch to a full-stack app using [Tanstack
109109+Start](https://tanstack.com/start/latest) + [Solid](https://www.solidjs.com/).
104110105111The app is going to be deployed automatically on Cloudflare workers by a
106112Continuous Integration & Deployment [pipeline](./.github/workflows/frontend.yml)
107107-using GitHub Actions, with decentralized data ownership using [ATProto](https://atproto.com/)
108108-and a [Cloudflare D1](https://developers.cloudflare.com/d1/) database for
109109-storing data alongside that won't be stored on the atmosphere. The deployment
110110-and database both will be deployed on serverless technologies because of its
111111-deployment as code strategy and near-zero cost for early projects such as this
112112-one.
113113-114114-For the text editor, I'll probably go with a [Monaco Editor](https://microsoft.github.io/monaco-editor/).
115115-running on the client-side (maybe integrating local WASM lsps later), and will
116116-use an external service dedicated to executing the code in a containerized,
117117-reproducible environment. Some examples may include [sprites.dev](https://sprites.dev/)
118118-and [judge0](https://judge0.com) or even a custom solution with Docker.
119119-113113+using GitHub Actions, with decentralized data ownership using
114114+[ATProto](https://atproto.com/) and a [Cloudflare
115115+D1](https://developers.cloudflare.com/d1/) database for storing data alongside
116116+that won't be stored on the atmosphere. The deployment and database both will be
117117+deployed on serverless technologies because of its deployment as code strategy
118118+and near-zero cost for early projects such as this one.
120119121121-## development environment
120120+I setuped a reproducible development environment using a
121121+[Nix](https://nixos.org/) flake. The whole project uses the
122122+[pnpm](https://pnpm.io/) package manager, and uses
123123+[Typescript](https://www.typescriptlang.org/) everywhere. It uses [Tanstack
124124+Start](https://tanstack.com/start/latest/), [Solid](https://www.solidjs.com/),
125125+[Tailwind](https://tailwindcss.com/). I will use
126126+[Prisma](https://www.prisma.io/) as a database ORM, alongside [Tanstack
127127+Query](https://tanstack.com/query/latest/), and the
128128+[@atcute](https://github.com/mary-ext/atcute) atproto tools ecosystem (OAuth,
129129+Lexicons, etc.).
122130123123-I setuped a reproducible development environment using a [Nix](https://nixos.org/)
124124-flake. The whole project uses the [pnpm](https://pnpm.io/) package manager,
125125-and uses [Typescript](https://www.typescriptlang.org/) everywhere. It uses
126126-[Tanstack Start](https://tanstack.com/start/latest/), [Solid](https://www.solidjs.com/),
127127-[Tailwind](https://tailwindcss.com/). I will use [Prisma](https://www.prisma.io/)
128128-as a database ORM, alongside [Tanstack Query](https://tanstack.com/query/latest/),
129129-and the [@atcute](https://github.com/mary-ext/atcute) atproto tools ecosystem
130130-(OAuth, Lexicons, etc.).
131131+For the text editor, I'll probably go with a [Monaco
132132+Editor](https://microsoft.github.io/monaco-editor/). running on the client-side
133133+(maybe integrating local WASM lsps later), and will use an external service
134134+dedicated to executing the code in a containerized, reproducible environment.
135135+Some examples may include [sprites.dev](https://sprites.dev/) and
136136+[judge0](https://judge0.com) or even a custom solution with Docker.
131137132138133139## acknowledgements
···142148- [tangled](https://tangled.org/)
143149- [margin](https://margin.at/)
144150145145-To be fair, this project is both because I wanted a platform like that where I
146146-could easily create dump contests with my friends, but I also really wanted to
147147-hack on the atmosphere :)
151151+Inspiration:
152152+- [npmx.dev](https://repo.npmx.dev/)
153153+- [pdsls.dev](https://pdsls.dev/)
154154+155155+To be fair, I chose this project both because I wanted a platform like that
156156+where I could easily create dump contests with my friends, but I also really
157157+wanted to hack on the atmosphere :)
-134
app/README.md
···11-Welcome to your new TanStack app!
22-33-# Getting Started
44-55-To run this application:
66-77-```bash
88-pnpm install
99-pnpm dev
1010-```
1111-1212-# Building For Production
1313-1414-To build this application for production:
1515-1616-```bash
1717-pnpm build
1818-```
1919-2020-## Styling
2121-2222-This project uses [Tailwind CSS](https://tailwindcss.com/) for styling.
2323-2424-## Routing
2525-2626-This project uses [TanStack Router](https://tanstack.com/router). The initial setup is a file based router. Which means that the routes are managed as files in `src/routes`.
2727-2828-### Adding A Route
2929-3030-To add a new route to your application just add another a new file in the `./src/routes` directory.
3131-3232-TanStack will automatically generate the content of the route file for you.
3333-3434-Now that you have two routes you can use a `Link` component to navigate between them.
3535-3636-### Adding Links
3737-3838-To use SPA (Single Page Application) navigation you will need to import the `Link` component from `@tanstack/solid-router`.
3939-4040-```tsx
4141-import { Link } from '@tanstack/solid-router';
4242-```
4343-4444-Then anywhere in your JSX you can use it like so:
4545-4646-```tsx
4747-<Link to="/about">About</Link>
4848-```
4949-5050-This will create a link that will navigate to the `/about` route.
5151-5252-More information on the `Link` component can be found in the [Link documentation](https://tanstack.com/router/v1/docs/framework/solid/api/router/linkComponent).
5353-5454-### Using A Layout
5555-5656-In the File Based Routing setup the layout is located in `src/routes/__root.tsx`. Anything you add to the root route will appear in all the routes. The route content will appear in the JSX where you use the `<Outlet />` component.
5757-5858-Here is an example layout that includes a header:
5959-6060-```tsx
6161-import { Outlet, createRootRoute } from '@tanstack/solid-router';
6262-import { Link } from '@tanstack/solid-router';
6363-import { TanStackRouterDevtools } from '@tanstack/solid-router-devtools';
6464-6565-export const Route = createRootRoute({
6666- component: () => (
6767- <>
6868- <header>
6969- <nav>
7070- <Link to="/">Home</Link>
7171- <Link to="/about">About</Link>
7272- </nav>
7373- </header>
7474- <Outlet />
7575- <TanStackRouterDevtools />
7676- </>
7777- ),
7878-});
7979-```
8080-8181-The `<TanStackRouterDevtools />` component is not required so you can remove it if you don't want it in your layout.
8282-8383-More information on layouts can be found in the [Layouts documentation](https://tanstack.com/router/latest/docs/framework/solid/guide/routing-concepts#layouts).
8484-8585-## Data Fetching
8686-8787-There are multiple ways to fetch data in your application. You can use TanStack Query to fetch data from a server. But you can also use the `loader` functionality built into TanStack Router to load the data for a route before it's rendered.
8888-8989-For example:
9090-9191-```tsx
9292-const peopleRoute = createRoute({
9393- getParentRoute: () => rootRoute,
9494- path: '/people',
9595- loader: async () => {
9696- const response = await fetch('https://swapi.dev/api/people');
9797- return response.json() as Promise<{
9898- results: {
9999- name: string;
100100- }[];
101101- }>;
102102- },
103103- component: () => {
104104- const data = peopleRoute.useLoaderData();
105105- return (
106106- <ul>
107107- {data.results.map((person) => (
108108- <li key={person.name}>{person.name}</li>
109109- ))}
110110- </ul>
111111- );
112112- },
113113-});
114114-```
115115-116116-Loaders simplify your data fetching logic dramatically. Check out more information in the [Loader documentation](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#loader-parameters).
117117-118118-# Demo files
119119-120120-Files prefixed with `demo` can be safely deleted. They are there to provide a starting point for you to play around with the features you've installed.
121121-122122-## Linting & Formatting
123123-124124-This project uses [eslint](https://eslint.org/) and [prettier](https://prettier.io/) for linting and formatting. Eslint is configured using [tanstack/eslint-config](https://tanstack.com/config/latest/docs/eslint). The following scripts are available:
125125-126126-```bash
127127-pnpm lint
128128-pnpm format
129129-pnpm check
130130-```
131131-132132-# Learn More
133133-134134-You can learn more about all of the offerings from TanStack in the [TanStack documentation](https://tanstack.com).