Giter Site home page Giter Site logo

sharat87 / prestige Goto Github PK

View Code? Open in Web Editor NEW
379.0 5.0 13.0 2.46 MB

A text-based HTTP client in the browser. An interface-less Postman.

Home Page: https://prestige.dev

License: Apache License 2.0

TypeScript 58.77% JavaScript 0.52% HTML 0.56% Sass 7.28% Shell 1.44% Go 31.36% Dockerfile 0.05%
http-client rest-client api-development developer-tools no-login-web-apps self-hosted postman-alternative curl-utility testing api

prestige's Introduction

Prestige

A text-based HTTP client, by Shri. Available at prestige.dev.

Under all the abstractions, it's just stardust interacting with text.

This is a powerful, text-based, in-browser, HTTP client app geared towards web developers and API testing professionals.

Check out the User Guide to learn how Prestige can be a powerful addition to your toolset.

Discussion on Hacker News. Join us on Discord.

Prestige light mode screenshot Prestige dark model screenshot

If you face any problems or have a suggestion, please reach out on Discord, or create an issue.

Features

  • Define requests in plain text, hit Ctrl+Enter (or Cmd+Enter) to execute and view results.
  • Write plain, familiar Javascript for templating within your requests.
  • Shows all responses in a redirect chain, if request redirects.
  • Save your Prestige documents to Gist.
  • Export requests as cURL commands. Please open an issue if you'd like to see more export formats.
  • Isolated cookie management.
  • Uploading files to APIs is as simple as drag-dropping the file and calling a function.
  • Light and dark modes, for multiple themes.

Developing

Please ensure you have NodeJS (with yarn) and Go, of versions as specified in the .tool-versions file, before trying the following commands. I recommend using asdf-vm for this, which integrates with the .tool-versions file. So, if you have asdf already setup, you can just do asdf install in this repo, and you'll have the correct versions of NodeJS and Go.

The project contains a manage.sh script that makes development a little easier.

  1. ./manage.sh serve-frontend — Start frontend Parcel server. This supports full auto-reload.
  2. ./manage.sh serve-backend — Start backend server. This doesn't auto-reload when code changes.
  3. ./manage.sh serve-docs — Start docs server. This supports auto-reload only for content pages.
  4. ./manage.sh test-* — Test frontend/backend/ui (depending on what's in place of *).
  5. ./manage.sh build-* — Build frontend/backend/docs (depending on what's in place of *).

Run the serve commands in parallel, then open http://localhost:3040.

Inspirations

More: https://github.com/marmelab/awesome-rest.

Some public APIs to play with

  1. httpbun.com — Great for meta-testing and JSON/form-data related experiments. Another project by @sharat87.
  2. A collective list of free APIs for use in software and web development.
  3. Yahoo Finance stock prices API — Great for large text responses and CSV data.
  4. GitHub GraphQL API — Great for experimenting with GraphQL, but requires a personal auth token.
  5. A Curated List of 100 Cool and Fun Public APIs to Inspire Your Next Project
  6. Postman's collection

Rough Roadmap

  • Close gaps in documentation, finish API Reference and link all mentions of API functions to this page.
  • A desktop app with NeutralinoJS or some other such technology.
  • A browser extension that, when installed, would make it so that we don't need the proxy anymore.
  • A Dockerfile for quickly running a self-hosted instance of Prestige with Docker.
  • Ability to open/edit documents from GitHub repos, Google Drive and Dropbox.
  • Rich editor features like auto-complete, JSON editing help, hotkeys to start new GET/POST/etc. request, snippets etc.

Contributing

Contributions (code, tests, docs) are welcome, but if it's even slightly non-trivial or more than a few lines of changes, I'd appreciate it if you opened an issue to discuss before working towards a PR. Among other things, this can help avoid overlaps where we're both working on the same thing, and we realize it only after you open a PR.

License

Apache-2.0. Project includes a NOTICE file.

prestige's People

Contributors

maximousblk avatar neilsc avatar sharat87 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

prestige's Issues

Error while saving a Gist

I created a private gist (through Prestige UI), the file is created correctly in github and I see its contents on Prestige. When I try to save it, the label flashes to "saving" (or something like that, it does it too quickly) and then swtches back to "unsaved".

The file in github is inmodified.

This is what I see in the browser (Firefox 104.0.2 (64-bit) on Arch Linux) console:

This page uses the non standard property “zoom”. Consider using calc() in the relevant property values, or using “transform” along with “transform-origin: 0 0”. prestige.dev
proxyUrl / Env.ts:46:9
Load sheet at gist/fasolato-omicron/3a1907f8c7aaa7035ceed4d6d45c8ba8 from gist Persistence.ts:631:9
Initializing CodeMirror for Workspace. Workspace.ts:180:10
Updating editor display Workspace.ts:268:10
Updating editor display in workspace. 1 Workspace.ts:273:10
Loading failed for the <script> with source “https://gc.zgo.at/count.js”. prestige.dev:1:1
Some cookies are misusing the recommended “SameSite“ attribute 4
Updating editor display Workspace.ts:268:10
Updating editor display in workspace. 53 Workspace.ts:273:10
Updating editor display Workspace.ts:268:10
Updating editor display in workspace. 53 Workspace.ts:273:10
set isSaved to false Workspace.ts:215:12
Save auto Persistence.ts:696:9
Updating editor display Workspace.ts:268:10
Updating editor display in workspace. 68 Workspace.ts:273:10
set isSaved to false Workspace.ts:215:12
Save auto Persistence.ts:696:9
Save manual Persistence.ts:712:9
Error saving manually Error: null
    l request.js:151
    onreadystatechange request.js:166
Persistence.ts:721:11
    T Persistence.ts:721
Error: Promised response from onMessage listener went out of scope ExtensionMessagingService.js:89:34

On the network panel this is the request:

curl 'https://prestige.dev/gist/update/3a1907f8c7aaa7035ceed4d6d45c8ba8' -X PATCH -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0' -H 'Accept: application/json, text/*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Origin: https://prestige.dev' -H 'Connection: keep-alive' -H 'Referer: https://prestige.dev/' -H 'Cookie: prestige_sid=...' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' --data-raw $'{"readmeName": "_Test Studio torta (prestige).md","files": { "main.prestige": { "content": "..." } }}'

And this is the response: 502 with headers

PATCH /gist/update/... HTTP/2
Host: prestige.dev
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0
Accept: application/json, text/*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: application/json
Content-Length: 1833
Origin: https://prestige.dev
Connection: keep-alive
Referer: https://prestige.dev/
Cookie: prestige_sid=...
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin

The file content seems to be irrelevant

Docker Integration

Hi,

I like the idea of this project, and I notice in your roadmap you have Docker as one of the upcoming features.

I've done this sort of stuff a few times so would love to take a crack at it, if that's okay? I'd submit a PR with:

  • A Dockerfile for the front end, in the front end directory
  • A Dockerfile for the back end, in the back end directory
  • A docker-compose in the root of the repository, that brings up both and somehow links them together.

Maybe with the docker-compose running the apps in dev/hot reload mode, but have the Dockerfiles build "production" images in a separate, final stage.

How does that sound?

Gist Integration

  1. Be able to open documents from my Gist.
  2. Authorize my GitHub account, to be able to do the above.
  3. Open any public Gist by providing the Gist URL.
  4. Save a document from browser storage, up into Gist, if authorized.

prestige-frontend never stops

When using the make stop command, or from the supervisor interface, the frontend server is never stopped. The corresponding Node server is still running and is usable on port 3040. No errors are reported.

Initial process tree:

/sbin/init
 \_ npm exec parcel serve src/index.html --dist-dir dist-serve --port 3040
     \_ sh -c parcel "serve" "src\index.html" ""--dist-dir" "dist-serve" "--port" "3040"
         \_ node ~/prestige/frontend/node_modules/.bin/parcel serve src/index.html --dist-dir dist-serve --port 3040
             \_ ...

Same process tree after make stop :

/sbin/init
  \_ node ~/prestige/frontend/node_modules/.bin/parcel serve src/index.html --dist-dir dist-serve --port 3040
      \_ ...

The Node server lose its parent process and stay has a detached standalone process.

To restore the initial state, it must be killed manually. If it is not done, then on subsequent restart attempts:

  • The front end startup fail on : Error: Port "3040" could not be used.
  • It is reported as stopped on the supervisor interface.
  • But, Prestige works perfectly : the old process is still serving on port 3040...

Environment

Node : 16.6.0
Python: 3.8.10
OS: Kubuntu 20.10
Prestige: d7be7e0

JWT Example

I would like to use Prestige in the following steps :

  1. Send a POST to login page with user password in headers
  2. GET a JWT Token as result of the previous body request (and store it)
  3. Use the JWT on following requests in headers with "Authorization: Bearer YYYY".

Of course, the JWT change every time you try to authenticate on step 1.

Is there a way to do that ? It should be documented for everyone as the JWT is often used.
Thanks

When system Python is upgraded, and the venv is broken, recreate the venv automatically

Running ./manage build-all gives the following error:

❯ ./manage build-all      
✨ Built in 6.42s

dist/index.html                      1.57 KB    1.56s
dist/favicon.7dcc8543.ico           15.04 KB    4.15s
dist/favicon-32x32.4aeda8d9.png        550 B    1.09s
dist/favicon-16x16.0caf70ef.png        341 B    4.19s
dist/index.1eb443b0.css            100.06 KB    1.51s
dist/index.cd578e5b.js             547.25 KB    4.19s
Traceback (most recent call last):
  File "/home/lsi/Oss/prestige/venv/bin/pip", line 5, in <module>
    from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip'

Workaround

Before launching the build, in the prestige folder, type the following command:

( source ./venv/bin/activate && python -m ensurepip )

After this, pip is installed in the virtual environment and future ./manage build-all commands will be able to succeed.

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.