Giter Club home page Giter Club logo

imrohan / pantry Goto Github PK

View Code? Open in Web Editor NEW
116.0 3.0 9.0 12.75 MB

๐ŸŠ Free data storage as a service. Pantry allows devs to store JSON for multiple apps & users. A good resource when building personal projects, apps for hackathons, and prototypes alike.

Home Page: https://getpantry.cloud/

License: Other

HTML 35.18% TypeScript 51.73% JavaScript 7.92% SCSS 3.86% Shell 1.31%
sass json typescript nodejs javascript api storage-api hackathon hackathons pantry storage redis

pantry's Introduction

Pantry

build Maintainability Issues Open Issues Closed Coverage Status

Pantry is a free service that provides perishable data storage for small projects. Data is securely stored for as long as you and your users need it and is deleted after a period of inactivity. Simply use the restful API to post JSON objects and we'll take care of the rest.

It was built to provide a simple, re-usable storage solution for smaller sized projects. It was created by developers for developers, to be there when you need it and to help you rapidly prototype your next project.

Development

Clone the repo

git clone https://github.com/imRohan/Pantry.git && cd Pantry

Install Dependencies

yarn

Install Redis

You will need to install Redis (v^6.2.0) on your machine and have server running using it's default settings

Create & Edit a .env and config.ts

cp env.sample .env cp src/app/config.dev.ts src/app/config.ts

Build frontend assets and run server (default port 3000)

yarn run dev

Open Example HTML page

Open http://localhost:3000/ in the browser of your choice

pantry's People

Contributors

alexmulligan avatar annikacodes avatar atoo35 avatar christracy avatar dependabot[bot] avatar endercrypt avatar georges-ph avatar imrohan avatar ire4ever1190 avatar irffanasiff avatar kaffarell avatar sarvesh4396 avatar sebastiano-racca avatar somajitdey 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

pantry's Issues

Remove Socket.io Server and Live Dashboard Refresh

After adding the socket.io server and live dashboard refreshing, we're seeing a degraded response time. Seems like the infrastructure that's currently being used to host Pantry can not handle the load.

Maybe we could one day allow users to click a "Refresh" button to reload the dashboard.

Get pantry doesn't return list of baskets

Hey, this looks neat so far.

When I GET my pantry there is a JSON key for baskets: [] but it is an empty array.

I have a basket and can GET the basket using the API.

Should the basket names be displayed in the pantry's list of baskets?

Module not found when deploying in heroku

Just got issues when trying deploy on heroku, locally works.

remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        USE_YARN_CACHE=true
remote:        NODE_VERBOSE=false
remote:        NODE_ENV=development
remote:        NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote:        engines.node (package.json):  unspecified
remote:        engines.npm (package.json):   unspecified (use default)
remote:        engines.yarn (package.json):  unspecified (use default)
remote:
remote:        Resolving node version 16.x...
remote:        Downloading and installing node 16.14.2...
remote:        Using default npm version: 8.5.0
remote:        Resolving yarn version 1.22.x...
remote:        Downloading and installing yarn (1.22.18)
remote:        Installed yarn 1.22.18
remote:
remote: -----> Installing dependencies
remote:        Installing node modules (yarn.lock)
remote:        yarn install v1.22.18
remote:        [1/4] Resolving packages...
remote:        [2/4] Fetching packages...
remote:        warning [email protected]: Invalid bin field for "url-loader".
remote:        [3/4] Linking dependencies...
remote:        [4/4] Building fresh packages...
remote:        Done in 21.56s.
remote:
remote: -----> Build
remote:        Running build (yarn)
remote:        yarn run v1.22.18
remote:        $ webpack --config webpack.prod.js
remote:        Hash: f94dcac30c42fe77666f
remote:        Version: webpack 4.46.0
remote:        Time: 16114ms
remote:        Built at: 03/25/2022 7:32:34 PM
remote:         2 assets
remote:        Entrypoint app = bundle.js bundle.js.map
remote:         [2] ./src/interfaces/view.ts 371 bytes {0} [built]
remote:         [4] (webpack)/buildin/global.js 472 bytes {0} [built]
remote:        [22] ./src/app/index.ts 1020 bytes {0} [built]
remote:        [26] ./src/app/scss/main.scss 1.21 KiB {0} [built]
remote:        [27] ./node_modules/css-loader!./node_modules/sass-loader/dist/cjs.js!./src/app/scss/main.scss 1.37 KiB {0} [built]
remote:        [28] ./src/app/assets/MeditatingDoodle.svg 104 KiB {0} [built]
remote:        [29] ./src/app/assets/example.svg 1.05 MiB {0} [built]
remote:        [32] ./src/app/templates/mainContent.html 647 bytes {0} [built]
remote:        [52] ./src/app/templates/dashboard.html 636 bytes {0} [built]
remote:        [70] ./src/app/templates/sdk.html 3.23 KiB {0} [built]
remote:        [72] ./src/app/templates/home.html 1.12 KiB {0} [built]
remote:        [86] ./src/app/templates/onboarding.html 1.74 KiB {0} [built]
remote:        [88] ./src/app/templates/about.html 779 bytes {0} [built]
remote:        [92] ./src/app/templates/topbar.html 1.74 KiB {0} [built]
remote:        [96] ./src/app/templates/bottomBar.html 357 bytes {0} [built]
remote:            + 83 hidden modules
remote:
remote:        ERROR in ./src/app/components/topbar.ts
remote:        Module not found: Error: Can't resolve '../config.ts' in '/tmp/build_5925283f/src/app/components'
remote:         @ ./src/app/components/topbar.ts 5:16-39
remote:         @ ./src/app/index.ts
remote:
remote:        ERROR in ./src/app/components/dashboard.ts
remote:        Module not found: Error: Can't resolve '../config.ts' in '/tmp/build_5925283f/src/app/components'
remote:         @ ./src/app/components/dashboard.ts 14:16-39
remote:         @ ./src/app/components/mainContent.ts
remote:         @ ./src/app/index.ts
remote:
remote:        ERROR in ./src/app/components/home.ts
remote:        Module not found: Error: Can't resolve '../config.ts' in '/tmp/build_5925283f/src/app/components'
remote:         @ ./src/app/components/home.ts 14:16-39
remote:         @ ./src/app/components/mainContent.ts
remote:         @ ./src/app/index.ts
remote:
remote:        ERROR in ./src/app/components/explorer.ts
remote:        Module not found: Error: Can't resolve '../config.ts' in '/tmp/build_5925283f/src/app/components'
remote:         @ ./src/app/components/explorer.ts 14:16-39
remote:         @ ./src/app/components/dashboard.ts
remote:         @ ./src/app/components/mainContent.ts
remote:         @ ./src/app/index.ts
remote:
remote:        ERROR in ./src/app/components/explorerEmpty.ts
remote:        Module not found: Error: Can't resolve '../config.ts' in '/tmp/build_5925283f/src/app/components'
remote:         @ ./src/app/components/explorerEmpty.ts 3:16-39
remote:         @ ./src/app/components/explorer.ts
remote:         @ ./src/app/components/dashboard.ts
remote:         @ ./src/app/components/mainContent.ts
remote:         @ ./src/app/index.ts
remote:
remote:        ERROR in ./src/app/components/basket.ts
remote:        Module not found: Error: Can't resolve '../config.ts' in '/tmp/build_5925283f/src/app/components'
remote:         @ ./src/app/components/basket.ts 15:16-39
remote:         @ ./src/app/components/explorer.ts
remote:         @ ./src/app/components/dashboard.ts
remote:         @ ./src/app/components/mainContent.ts
remote:         @ ./src/app/index.ts
remote: error Command failed with exit code 2.
remote:        info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
remote:
remote: -----> Build failed
remote:
remote:        We're sorry this build is failing! You can troubleshoot common issues here:
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote:        Some possible problems:
remote:
remote:        - Node version not specified in package.json
remote:          https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:
remote:        Love,
remote:        Heroku
remote:
remote:  !     Push rejected, failed to compile Node.js app.
remote:
remote:  !     Push failed
remote: Verifying deploy...```

Add ReCaptcha for Account Creation

In order to prevent malicious account creation, we should place
the login flow behind the safety of ReCaptcha.

Users should be forced to authenticate themselves prior to creating
their Pantry account.

Slow Site and Timeout Errors

Hi,
The site is loading really slowly when I access it from the getPantry site. When I access it from my app, my serverless functions error out due to the api taking too long to respond. This delay makes the site functionality unusable.

Fix Broken JSON Styling

image

In the dashboard view, the contents of the basket are not being styled properly.
Users should see syntax-enabled formatting to make navigating their basket contents
easier.

Remove Duplicate Errors Log

On the dashboard, users are now shown 2 instances of the errors log.
The lower of the two components should be removed.

image

Order baskets by "creation date"

The order of the "array basket" is not ordered according to the "creation date" of the basket. It would be better if the newest basket was added to the bottom of the array.

Pantry Down

Not sure if this was planned but I just noticed that pantry was down, was it EOLed?

Curl post request command not working in powershell

The curl request does exist in powershell (altough it is only a redirect to Invoke-WebRequest) but the provided arguments do not exist in windows.
An alternative would be to use this command:

Invoke-WebRequest -Uri 'https://....' -Method POST -ContentType 'application/json' -Body '{ "key": "value" }'

It would also be useful to display it on the page (on the landingRight.html). I would make a pull request, but sadly I have issues running the project locally...

Upgrade to Typescript 4

Typescript 4 has been released, and with it comes a few new features.

Update node package to 4.0.0 and refactor code to use new features (Short-Circuiting Assignment Operators)

Provide Users with Public(ish) URLS to Baskets

Currently, users are able to GET/POST a particular basket via one private(ish) URLs.
The API endpoint looks like this /apiv1/pantry/PANTRY_ID/basket/BASKET_NAME.
This is problematic since users should not share this URL with untrusted parties since
it exposes both their PANTRY_ID (uuid) and a BASKET_NAME (human-readable name).

By providing users a way to create a public link directly to their basket, we should be able
to generate a "proxy path" to a particular basket without exposing private details.

POST - /apiv1/pantry/PANTRY_ID/public_basket/BASKET_NAME returns /apiv1/public/UUID

Display Basket Errors

Time to think about displaying errors to send users. A modal should pop up with
list of recorded errors + timestamps.

Allow Pantry to Run in Development Mode

We have to somehow create a "development mode" for the app. The problem I am currently facing is that I have to remove code lines to bypass the recaptcha because I do not have a valid secret key, the next problem is that I don't have a sendgrid api key, so I cannot bypass the welcome email and don't get the PantryID. It would be useful if we somehow (I really don't have any idea how)
add a development mode to bypass the recaptcha easily (without modifying code) and printing the PantryID to the console without using sendgrid.

Add Google Tag Manager

We'd like to one day be able to add Google Analytics + other plugins to Pantry.
In order to help speed up this process, lets add Google Tag Manager.

Paste this code as high in the <head> of index.html as possible:

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-MLMVWB5');</script>
<!-- End Google Tag Manager -->

Additionally, paste this code immediately after the opening <body> tag:

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MLMVWB5"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

Keep Dashboard In Sync

Currently, users have to refresh the dashboard in order to verify if new data
has been added. Due to the lack of routing client-side, refreshing the page
does not allow for just the dashboard to be refreshed.

Introduce a new method for keeping the Dashboard in sync. Perhaps fetch
data every few seconds, or provide a helpful "Refresh" button to fetch new
data.

Adding a failsafe when posting to a basket

Sometimes i would accidentally screw up my post request and the entire basket would be erased. Would it be possible to add a failsafe so it would just not accept the request or have it 'roll back'?

Clean up frontend templating

Currently, the front end (Vue) logic is tightly coupled and housed in two
main files, LandingRight and LandingLeft. There is no routing, and no child
components being used.

It would be nice to move the conditional rendering logic into child components
in order to clean up these two files.

Status Code 429

Hello, I've been using Pantry's rest api for about a month now. But these days I've been getting status code 429 when requesting a basket.. I just wanna know what the call rate limit is. Thank you.

Add Transparency

Add Transparency to Pantry by showing the users some details of how much it costs to keep Pantry going. Maybe show how many active users there are?

Increase body-parser Request Body limit

By default, body-parser limits request body transactions to have a max size of 100kb.

A basket can hold much more data than that, so it would be best if we increased the transaction limit a bit.

Private Accounts

Allow users to create private accounts, which require some form of auth
(Bearer Token Auth or other) in order to access their contents/basket contents.

GitHub Actions?

#!/usr/bin/env node

// TODO
// - Setup Travis or something to run pipelines and run tests

// Get External Deps

It looks like you already run unit tests through GitHub Actions. Is this comment obsolete, or something I could help with?
(I'm interested in contributing to your project, and this was the first thing I noticed while reading the source code.)

Performance Issues

We are using Pantry for an important school project at our university and weโ€™ve noticed some performance issues since today. Could this be correct? If there are issues, do you know how long they will take?

Allow Users to Edit Pantry Contents via Dashboard

The dashboard as it stands now is very much a read-only application.
We should allow users who do not want to use the API to be able to manipulate
their pantry contents (baskets) via the dashboard. Users should be able to add,
remove and edit existing baskets via some form of JSON editor.

Updating a basket via the dashboard should use POST vs. PUT

Discussed in #147

Originally posted by mrdummy228 March 24, 2022
Hello! Your service is most great i found out there, but there are 2 problems.
First, if you try to remove the placeholder "key": "value" pair and click save, and then open the basket again, that pair would still be here.
Second, which is related to first, you can't edit your pantry ANYHOW except by using the API itself, which causes discomfort.
Is it intended? If it is, then it's a huge mistake and should be fixed (my opinion).

Users should be able to update the contents of the basket entirely via the dashboard.

Currently, the dashboard uses a put to add/edit the contents of the basket. However, users
would probably like to have full control and overwrite the entirety of a basket's content if they wish.

Introduce Single-Point Storage Option

Some users may not need to store multiple JSON objects, but just need a
quick solution to store a single piece of data.

Perhaps instead of forcing users to create a "Pantry" and then access blocks
belonging to their account, we allow them to just create one-time-use blocks.

Data could be given a name, and could be made publically accessible?

Question: How long do baskets last until they are deleted for inactivity?

Your home page says "Data is securely stored for as long as you and your users need it and is deleted after a period of inactivity".

How long is this period of inactivity? I am planning to develop a small web app that will be used by a single person, and would like to use the pantry JSON store initially, but still don't want the data to disappear after the weekend or, say, after 2 weeks of vacation.

Also, do you send warning e-mails before deleting the data?

Thank you,
Luis.

Add a Whats New? Page

It would be nice to show users what's been newly added to Pantry via a What's New page. This could pull from the repo's release page?

Show time to deletion

The website says that the storage is deleted after inactivity, but I couldn't find anymore info on how long the period of inactivity lasts. It would also be cool to display the time to deletion on the dashboard.

Display Pantry Description on Dashboard

Each Pantry has a name & description. Currently, we are not displaying
the description anywhere on the UI.

It might be nice to display the description somewhere.

Major performance issues/slowdown?

In the last few days I've been noticing some performance issues, it takes ~20 seconds to load some basic (and rather small) data from my basket. Seems that there's a bottleneck somewhere that was recently introduced somehow

[Feature] Merge Basket with new data

Hi!

I've just discovered Pantry (I haven't had the opportunity to test it yet). I looked at the documentation and there is one thing that seems to be missing: the ability to update a sneaker with new data without returning the full data.

For example, if I have a list of members and I want to add one more, if I understand correctly I have to return the entire new list of members.

I think a way to "insert" a single piece of data like with a UPSERT would just be amazing!

Thanks a lot

Minor Front/End Changes

Few small updates to the website:

  • Add npm install pantry-node right inside the main landing page hero
  • Make the navbar more responsive. Icons are hidden on small screen sizes

I created a library to use Pantry from .Net

https://github.com/Krutonium/libPantryDotNet

The issue is that I can't seem to get any data it sends to work.

My programs output is as follows (With commentary from me)

{"Item1":"item1","Item2":"1"} //This is the json I am sending
Your pantry is called TestPantry 
Your pantry is 1% full.
You have 1 baskets.
Your Baskets:
test_basket
Deleting test_basket
test_basket was removed from your Pantry!            //This works
Creating a basket called test_basket                        //This works, but the basket is left empty but should have the json above
Your Pantry was updated with basket: test_basket! //This is direct output from your API
Updating a value in that basket                                //I changed a value, re-encoded it as JSON, and wrote it to the API
{}                                                                               //Response from API
Reading back the Basket                                         //Reading it back
{}                                                                               //Still nothing

I cannot figure out why it's not getting the JSON. Any thoughts?
This is the code that's running to generate that output and this is the code that's doing the actual requests

Post basket

Hello,

I tried to create a basket, but I only get error:
Could not create basket: Validation failed: An instance of Block has failed the validation:

  • property payload has failed the following constraints: isNotEmptyObject

Thanks

Account Webhooks

Introduce an account-wide webhook that will be used to notify users for any updates to their Pantry and it's baskets.

Add Favicon

The front-end does not have a favicon present, leading to a default icon to be displayed.

<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 width=%22256%22 height=%22256%22 viewBox=%220 0 100 100%22><rect width=%22100%22 height=%22100%22 rx=%2220%22 fill=%22%23ffe2c9%22></rect><text x=%2250%%22 y=%2250%%22 dominant-baseline=%22central%22 text-anchor=%22middle%22 font-size=%2270%22>๐Ÿฅ‘</text></svg>" />

image

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.