apruner / my-fridge-server Goto Github PK
View Code? Open in Web Editor NEWMy Fridge Server
My Fridge Server
The db.go
and resolvers.go
files are getting quite large.
We should break up the gql and db packages into subpackages for each entity to keep things organized.
I need a way to ensure users that are sending requests have been authenticated (that is, the request should have some sort of valid session token associated with it or something) with firebase auth.
Ideally I probably build an endpoint/table or something to check firebase tokens against.
Later on, to track expiry dates, will definitely need a createdAt column for food_items
Self explanatory. Build out some test infrastructure for everything.
Need to build out the following in the gql
package:
graphql.Do
)These can be in subpackages (such as a models directory for models), or just .go
files. will probably start with the latter and move to the former when necessary
Self explanatory! Ideally a sign in with google/facebook via OAuth would be good!
There was an issue with the first K8s deploy where the postgres image got into a CrashLoopBackOff state because of an with the mounted volume.
The error message was something to do with "/var/lib/postgresql/data is nonempty". A temporary workaround I found was to just use the PGDATA=/tmp
environment variable in the db-service.yaml
, but this is nowhere near ideal. We want a persistent volume for data storage for sure.
I'm pretty certain that the postgres db will be totally wiped upon restarting the db service. Not an issue at all right now but when we start getting users to store data in there, that'll be a big issue.
Will need to figure out how to write/read shopping lists in some form, on db layer and gql layer
Tell people how to contribute to the project!
Need to do a rough database design diagram before I start writing table migrations and things
Need to get a deployment going! Will decide how I want to do it. This will involve looking into and setting up:
Currently, the graphql API doesn't return correct data values for mutations. For example, upon creating a new shopping list, the response data looks like this:
{
"data": {
"shoppingLists": {
"id": null
}
}
}
Either the id returned should be correct, or we should return the full shopping list that was created, with all columns. Probably the former is good enough.
Another example is with deleting. Upon deleting a shopping list, you'll get the same response data. The correct response data in the deletion case would be the full row deleted, or at the very least, the correct ID that was deleted.
See DEPLOY.md
for steps to automate here.
There are a few issues that I have in mind:
kubectl
, etc might be a lot of workIn the case where these two things are obstacles that are too large to take on, I'll just write a shell script and do it from my machine locally.
Self explanatory, external load balancers should have HTTPS protection!
Myles gave me the idea of using an ORM wrapper for postgres. I'm thinking I'll add https://pg.uptrace.dev/ to the project!
Self explanatory, need to be able to get all food items attached to a given shopping list
Need a description column for shopping lists that will be a VARCHAR(100)
Self explanatory! Get docker to run the app!
Once a rough design for the DB is done, write some migrations to create tables and stuff.
We should ideally (once we have some unit tests) have a local CI/CD pipeline that runs the unit test suite, runs migrations, and builds docker images. This would be super nice!
This is dependent on the completion of issue #3
Let's deploy! Doesn't really matter where, but I'm thinking Google Kube engine for fun! :D
We need a way to differentiate whether a food item is part of a user/household's shopping list, or currently in their fridge. Right now this is unclear, and currently the shopping_list_id argument is mandatory for creating a food item. This means that currently, users can't actually add a food_item to their fridge.
Tell people how to run the project!
To tell the user how much of a food item they have, allow them to add a custom unit for each food item.
Get Postgres running in Google Cloud! Woohoo! App Engine/Compute Engine should be able to easily communicate with Google Cloud SQL as well.
There are many mutations that at the moment, require all values in the db table to be filled for that gql type/db model. This shouldn't be the case.
For example, to update a food item, you shouldn't have to provide an argument value for every different field in that food_items model. This is currently the case.
This will be a bit more easy to map out/design than shopping lists. There will need to be the following tables in the db:
I need to create a script that pipes an echo CREATE DATABASE ...
command to the local postgres instance so users don't need to do this manually. This could be a "setup.sh" shell script that runs go get
and then does this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.