https://github.com/initialed85/dinosaur
A training tool that gets you to write code like a dinosaur.
https://github.com/initialed85/dinosaur
coding-challenge go gotty polyglot-programming react typescript
Last synced: about 1 month ago
JSON representation
A training tool that gets you to write code like a dinosaur.
- Host: GitHub
- URL: https://github.com/initialed85/dinosaur
- Owner: initialed85
- Created: 2022-08-31T04:15:17.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-06-16T07:03:27.000Z (almost 2 years ago)
- Last Synced: 2025-12-18T17:35:51.798Z (4 months ago)
- Topics: coding-challenge, go, gotty, polyglot-programming, react, typescript
- Language: Go
- Homepage: https://dinosaur.initialed85.cc/
- Size: 425 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dinosaur
# status: working but parked, [use it in your browser](https://dinosaur.initialed85.cc/)
A training tool that gets you to write code like a dinosaur.
## Concept
- User picks a language
- User is presented w/ 2 panes; editor and live feed to their code being executed
- User makes changes to code to achieve some goal
## Ideas
I don't really know what the goals will be yet, but I'm thinking about about multiplayer challenges- something like:
- Two players need to exchange some messages with each other
- Two players need to complete a set of calculations (over a series of messages) and each player can only see the odd or even half of the
steps
- Two or more players need to develop a decentralised chat system (discovery etc) without knowing who's out there
- Same as above, but now there are adversaries (also players) actively trying to hinder the other players
Ultra hard mode would be players on the same team need to discover and communicate with each other using only the code in front of them; in
the case where there are adversaries there'd be a whole element of validating that the person you're talking to is a teammate, not an
adversary.
## Architecture
- Backend
- [Go](https://go.dev/) w/ built-in HTTP server and subprocess orchestration libs
- [entr](https://github.com/eradman/entr)
- [sorenisanerd's](https://github.com/sorenisanerd) fork of [gotty](https://github.com/sorenisanerd/gotty)
- Frontend
- [Create React App](https://create-react-app.dev/)
- [Microsoft Monaco Editor](https://github.com/microsoft/monaco-editor)
## Flows
- `Frontend` makes a GET request to the backend to be allocated a session
- `Frontend` mounts `Shell` component that gives the live feed of the `gotty` session (just as an iframe)
- `User` makes edits in `Editor` component
- `Editor` component text POST'd to `Backend`
- `entr` in `Backend` re-runs code process
- `Shell` component in frontend continues to display live feed
## TODO
- Ability to group sessions together / isolate them from other groups
- Record all the packets and interactions for a group with timestamps
## How to run it
### Prerequisites
- [Go](https://go.dev/)
- [Docker](https://www.docker.com/)
- [Docker Compose](https://docs.docker.com/compose/)
### Steps
**Build and run in the foreground**
```shell
make # will block and teardown on Ctrl + C
```
**Build and run in the background**
```shell
make up
make logs # optional
make down # teardown
```
## How to use it
Once you've got the services up and running, navigate to [http://localhost/](http://localhost/) to see the frontend and select a language to
play with.
You can also navigate directly to a particular language, e.g. [http://localhost/?language=rust](http://localhost/?language=rust).
You can also share a session by navigating to it's URL in another browser window;
e.g [http://localhost/?language=rust&session_uuid=(some_uuid)]()