Giter Club home page Giter Club logo

node-in-english's Introduction

Node.js web server in plain English

What do you mean plain English? It means there is no JavaScript. No typescript. No programming language whatsoever. Just plain English in a bunch of .txt files.

See the text-src directory for the source files.

The text files are "compiled" and automatically deployed to https://nie.avoguard.com/.

Why?

I wanted to see if I could build a server without writing any code, using only plain English. I wanted to understand how little or how much engineering skills you need to build a working web server.

I wanted to showcase what's possible to people who cannot / do not / do not want to write source code.

What I learned so far

No, you can't just ask "build a server". That's too vague. The instructions have to be somewhat specific and guide the model to the proper usage. That means you need to understand the underlying libraries / frameworks to some extent.

As a software engineer, the experience coding in plain text is frustrating. The amount of text required to get precise outputs is significantly higher than writing the same in source code. But that's not the intended purpose. This should not replace programming languages. It should offer a pathway towards programming languages through a natural language.

Try it out!

You can try out the latest build at https://nie.avoguard.com/

On every push to main, the .txt files are automatically built and deployed to https://nie.avoguard.com. If you can't reach the deployment, it's probably because the generated code failed to build. Just try again later.

The endpoints paths are in general unstable (see caveats), but the server should always produce a root / HTML page lists all the endpoints in HTML format, and a /list endpoint that returns a JSON object listing the endpoints (or a JSON array, depending on how it feels that build ๐Ÿ˜ฌ).

Endpoints (expected)

/ - should return a HTML page saying "Hello, AI world!", along with a list of all the endpoints /list - lists all the endpoints /quote - generates a random quote from a list of quotes that are generated at build time /ping - should return "pong"

All of them should be GET endpoints.

Can't reach these endpoints? See caveats.

Endpoints (from LLMs own initiative)

These endpoints are not explicitly defined, but do frequently appear. /about - returns a short description of the server, or a 404 error /contact - returns a contact information, or a 404 error

Sometimes DELETE and POST endpoints appear.

How does it work?

The server is built using OpenAI API, but could use any other language model. The instructions for the model are written in plain English in a bunch of .txt files in text-src.

The text files are built using a node.js build script in /index.js, which is the only piece of human-authored source code in the project.

Customization

You can customize the server by editing the .txt files in text-src.

If you add new files, make sure to add them to the array in /index.js, so they are included in the build. The order of the files in the array is the order in which they are "built".

I'll improve this in the future.

See How to build for instructions on how to build the server.

Cost?

Every build consumes about 4000 tokens of OpenAI API usage.

Caveats

Since I'm not using stable generation of the server, every build is a surprise ๐Ÿ˜ฑ.

With the same input, some builds might fail, some builds will succeed. It's a surprise every time! What a thrill! ๐ŸŽข You won't get that with the boring old programming languages ๐Ÿ˜‚

How to build

Supply your OpenAPI credentials in the OPENAI_API_KEY environmental variable or in a .env file.

Then run yarn to install build dependencies and yarn build to build the server. The build will output to the dist directory.

Contributing

If you come up with an interesting idea for a new endpoint, feel free to add a .txt file in the text-src directory and submit a PR.

If you want to improve the build script, feel free to submit a PR, too.

License

MIT

node-in-english's People

Contributors

vitprajzler avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.