Code Monkey home page Code Monkey logo

biketag-api's Introduction

keneucker

Hi πŸ‘‹, my name is Ken

import { hello, world }
 from 'keneucker'
Hello, my name is Ken Eucker. I love to design applications, write poetry, bicycle to parks, kayak on rivers, hike to hot springs, backpack through canyons, take candid photographs, and talk about the intersection of technology and psychology. This document outlines who I am as a developer who collaborates on open source projects, where you can find me on the web, and a couple of things about me that you may find commonality with.
What I am up to
My Open-Source Projects
These are projects that I dream about being successful one day
BikeTag - The Photo Mystery Tag Game on Bicycles
PointOfVue - a web 3 social sharing network for the programmable web
BikesList -- not yet created
WpVue3 - A Vue3 frontend for WordPress Posts, Pages, and other documents using the wp-rest api
See my resume
GitHub RΓ©sumΓ© LinkedIn RΓ©sumΓ©
Languages and Tools
Platforms I have experience using
Favorite sites
How to contact me
Send me an email: [email protected]
Call me or message me elsewhere.
Wave to me.

How to find me
https://github.com/KenEucker
https://patreon.com/KenEucker
https://www.linkedin.com/in/keneucker/
https://dev.to/KenEucker

read more
I currently live in Portland, Oregon and work remotely with clients and colleagues from all over the world. If you're biking around the city I am in you just might run into me. ;)
On the internet I keep things pretty simple and use my first and last name most places, so I've got https://keneucker.com as a general landing page, but if you're looking for me elsewhere just try my name.
How to approach me
They / Them
He / Him

read more
I work well with direct communication and honesty, and also with asynchronous communication. Direct messages and emails allow me to prioritize my present moment and gives me an opportunity to respond at a time when my full attention can be given to the conversation. If you can, please let me know; what you have, what you are looking to achieve, how I can help, and any expectations you might have for my response.

I am often focused and intentional in how I go about my day so a laugh, walk around the block, or nice chat over a meal is a welcomed opportunity to get to know me better. We all have good and bad days, productive days and days where you spend the entire time blocked. I find that there are times when I am more available for random chats and distractions, and that there are times when I am best left to my own schedule with my head down on the task at hand. I rarely take myself "offline", but I will let you know quite immediately if I am too busy to connect.
How I can help
Software Engineering
Makering & Creating
Bicycle Touring
Stage & Helping Handing
First Doing Nothing

read more
I really enjoy helping people become more efficient at what they are doing and providing solutions for people when they have an idea of what they want with what they have. Software Engineering projects aside, I also like to make myself available to actively participate in my community and environment. I think it's important to have support roles in every group and am a willing volunteer for most positions both in a professional and personal capacity. I make a good second in command and an even better self starting laborer. I think collaboration and communication are the best ways to accomplish a task with others and I have found a lot of success in talking through my thought process with others. We're all in this together. In addition to my software skills, I also have a fair amount of experience helping people in other ways. I have participated in building and supporting the; transportation, setup and teardown of large scale interactive art. I have lead small group bicycle tours, individual cycling adventures, and mass city-wide cycling events. I have joined peer support roles at various events and functions, ranging from de-escalation to incident command management.
How I spend my time
πŸ’» Writing Code!
πŸš΄πŸΌβ€ Riding My Bike.
πŸš£β€ Kayaking on the Rivers & Lakes of the PNW.
🎱 Shooting Pool.
🍳 Cooking.

read more
My schedule changes a lot with the seasons, but there are several constants to how I spend my time. One of those constats is riding my bicycle. I bike commute and travel with a backback and two waterbottles in the summertime, and I bike commute in the winter with raingear and two panniers. I like to ride for fun, for errands, with groups, and totally alone. I also really love to go kayaking on rivers and lakes all over the Pacific Northwest, and have made it a constant to meditate on the river at least once a month. It is my goal to have paddled in every body of water in Oregon.

I also like to be out in the woods on trails, campsites, near mountains, and on rivers. I like to sit and stare at viewpoints high and low while having philisophical conversations about everything in life from feelings to adventures to technology and the study of all things. I like to work on crafts, tinker with electronics, and build things out of wood or metal or glass or ceramic. I like to take photographs and have been learning how to fly + shoot video with a drone.

I also spend a lot of time on my computer when I'm not out and about, creating software solutions for problems big and small or non-existant at all. I am constantly learning. I find web development to be a lot of fun and I'll create new websites regularly without much thought. My career is important to me and I spend a lot of time discovering new platforms and programming techniques in order to grow my skills and knowledge. I find my work to be rewarding, creative, and inspiring in a lot of ways.

I am nomadic. I love to travel and be in a constant state of movement, at times of my life. As a self employed engineer, I work 100% remotely for all of my clients and prefer this to any other working arrangement. I have had the privilege of being able to travel and work at the same time and I feel that all people who only need a laptop and the internet to complete their work deserve the same privilege.

Support:

Sponsor me

biketag-api's People

Contributors

dependabot[bot] avatar ehoraizon avatar keneucker avatar nonara avatar septimiubloj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

biketag-api's Issues

Efficiencies can be added

As the platform scales, our data payload, AKA the "ONE BIG REQUEST", gets larger and more expensive to convert into BikeTag Tags.

We might need to add pagination.

We might need to implement the search for the Imgur API.

We might need to add more complex caching.

We might need to start using the cloud more (Netlify functions) alongside complex caching (persisted connections).

I don't know the best solution here but with the size of the games growing, the need to be more efficient is growing.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

[BUG] better error reporting and error handling for instantiated clients without credentials

Describe the bug
If you attempt to get BikeTag data from a BikeTagClient object without setting adequate credentials, the following unhelpful error is returned:
TypeError: Cannot read properties of undefined (reading 'fetch') at http://prime.localhost:8080

When what is happening is that a request is being made without credentials:

Screenshot 2024-01-09 at 10 30 41 AM

To Reproduce
Steps to reproduce the behavior:

  1. create a new BikeTagClient (const biketag = new BikeTagClient())
  2. attempt to call biketag.getGame(undefined)
  3. See error

Expected behavior
An error that indicates that adequate credentials are not present should be returned.

Create BikeTag Achievements

Is your feature request related to a problem? Please describe.
There are not yet achievements designed into the app, but code is incoming that will make creating the first achievements possible!

Describe the solution you'd like
On a BikeTag Player's profile, a visitor should be able to see the achievements that have been awarded to that player. The BikeTag API should provide these achievements.

The solution to implement, now, is to implement the Achievements document in the BikeTag-Sanity project. This document should be used just like the Settings are, in that they can be assigned to another document (Player) as a list of Achievements. The document should include the following fields following the same convention as the Setting document:

  • slug: string
  • name: string
  • description: string
  • key: string
  • value: string

BRAINSTORM LIST OF ACHIEVEMENTS TO IMPLEMENT FIRST:

  • BikeTag Player Profile
  • BikeTag Ambassador Profile
  • Won First BikeTag Round
  • Sniped By Game Leader
  • Sniped 10 Times
  • Won 50 Rounds
  • Won 100 Rounds
  • Won 500 Rounds
  • Won 1000 Rounds
  • Fastest Tag So Far (can be held by multiple people)
  • BikeTag ${Game} Leader (can be held by multiple people)
  • 3-Day Streak
  • 7-Day Streak
  • 30-Day Streak
  • BikeTag Bingo Winner
  • Gotta Catch Them All - 100 (has retagged 100% of all tags 1-100)
  • Gotta Catch Them All - 1000 (has retagged 100% of all tags 1-1000)

Additional context
Creating/Maintaining achievements should happen via a background-function that runs every 15 (to match the autoPost) that saves achievements to Players in Sanity.

Now is a good time to shore up our data on Imgur and make sure that we have access to items without requiring additional dependencies (like Sanity). Although Sanity will be the solution here, it would be good to continue to work towards feature parity with the main source of truth, Imgur.

Add exhaustive unit testing for each adapter and the main BikeTagClient methods

Testing for each of the adapters was added when created but each is entirely commented out. Of the 39 tests that run on behalf of the current jest config, only the client.test.ts file contains any real testing. All of the testing files have moved to the test folder and out of the src folder.

The test/src folder should be the unit tests that cover the ts file. There is an e2e folder in there as well, which

We're not aiming for 100% coverage. I think, for each of the adapter methods we should have tests covering the required params to complete the request and the responses provided by the method.

Reports are to be added to this ticket as testing progresses towards the BikeTag v2.0 release.

[BUG] multiple uploaded tags for a given player invalidates the tag submission

Describe the bug
Somehow, multiple images get uploaded for a single player for a certain tag number. When this happens, the API can't reconcile which images to use for the post. This causes the tag submission to be completely ignored until this issue is resolved. If another player submits a tag for the same tag number, they are chosen as the winner because they have a valid tag.

To Reproduce
Steps to reproduce the behavior:

  1. upload multiple found/mystery images for the current round (might have to be done manually)
  2. see the error produced

Expected behavior
I don't know what the API can do about this issue other than to make it opinionated about how to validate a tag with multiple uploads.

Option A: take the most recent images for both found and mystery images.
Option B: take the first images uploaded for both the found and mystery images.

Additional context
Both options come with negative consequences. But, if one option is chosen then at least we will have an explanation for that. Resolving this issue also means resolving the duplicates before approving the post (so that it doesn't interfere with the repost process).

Add bicycle inside image detection for new BikeTag Post submissions.

Is your feature request related to a problem? Please describe.
Currently, Players of BikeTag can upload any image to the site.

Describe the solution you'd like
We can use ML, specifically ml5.js, to detect whether or not a bicycle is present in the image. If a bicycle is not present, the Player should see a similar popup to when an image is submitted outside of the boundary of a game: "The photo you uploaded does not appear to have a bicycle in it. Please upload a photo with a bicycle clearly visible."

Additionally, since BikeTag Posts are not "selfies", we could detect whether or not a "face" is present in the photo and reject is based on that. The API method that handles this, validateBikeTagImage, should return a boolean for valid and an error object, which is undefined if it is a valid image.

Describe alternatives you've considered
We've talked about this in the past and some solutions were discussed then. Now, after looking into it for a few minutes, I've chosen ml5.js. Other solutions are available and anything that is free will be considered.

Additional context
ML5JS - Object Detector

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

Consider renaming api interfaces to be as succinct as possible

As we approach the alpha version of this API I think it would be good to revisit the contract we are making with developers. If we remove the verb get from methods like getTag and combine the getTag and getTags functionality based on the payload passed in, we can end up with a very easy to understand set of methods that simply pertain to working with BikeTag data:

With this, we would end up with an API contract that looks like this:

const tag1 = biketag.tags(1)
const allTags = biketag.tags()
const deletedTag = biketag.delete(1)
const updatedTag = buiketag.update({ tagnumber: 1, foundImageUrl: null }) 

Which, I think, would feed into the exposed gunjs data method of the API:

const tag1 = biketag.data().get('tags').get('portland-tag-1').once()

Since the most available API will always be powered by GunDB, I think it makes sense to have the interface for the BikeTag API be as similar as it can be.

Additionally, it is unclear yet if we are going to offer the ability to create Players or Ambassadors or even Games with the API. I think that v2.0 definitely will not from the start but maybe with v2.5 that could be a goal (depending on adoption). Because of this, methods like biketag.delete can always be in the context of a Tag for a preset game.

[BUG] BikeTags wouldn't load after updating a single tag

Describe the bug
Updating a BikeTag with admin credentials and only the tagnumber property in a predetermined game makes the API unable to load the BikeTags from that game.

To Reproduce
Steps to reproduce the behavior:

  1. Call method
const tag = BikeTagClient.createTagObject({tagnumber: 26})
(new BikeTagClient(adminConfig)).updateTag(tag)
(new BikeTagClient(clientConfig)).getTags(undefined, {
              game: game.name,
              hash: game.mainhash,
              source: 'imgur',
})
  1. See error
{
    "status": 500,
    "data": null,
    "error": {
        "message": "Cannot read properties of undefined (reading 'length')",
        "stack": "TypeError: Cannot read properties of undefined (reading 'length')\n    at pe (http://prime.localhost:8080/node_modules/.vite/deps/biketag.js"
    },
    "success": false,
    "source": "imgur"
}

Expected behavior
Expected an error if the BikeTag is malformed.

Environment (please complete the following information):

  • Library version: 2.1.4
  • OS: Windows 10 Home
  • NodeJS version: v16.14.0

Add a context method

Is your feature request related to a problem? Please describe.

Add a context method that returns a BikeTagClient object with referrer methods for helpful mutations of data that are being used outside of the biketag-api.

Describe the solution you'd like

Add the following interface:

const authorization = 'someauthvalue'
const source = 'imgur'
const opts = {
  game: 'portland',
  source,  
}

const biketag = new BikeTagClient(opts)
const portland =
const {
  game,
  currentBikeTag,
  tags,
  ambassadors,
  profile,
} = biketag.context({ source, authorization })

Describe alternatives you've considered
The community of BikeTag Developers (me, also me. LoL) are already solving for these solutions by using the API and for a single page application, all of these items are needed while multiple requests to the given source might be made for the same resources.

Additional context
See the biketag-vue project's implementation for currentBikeTag and use of authorization values for getting the profile information, for example.

https://github.com/KenEucker/biketag-vue/blob/production/functions/current.ts
https://github.com/KenEucker/biketag-vue/blob/develop/functions/profile.ts

Add support for twitter and reddit

Just like we can call biketag.getTag or biketag.updateTag and have data in imgur or sanity be changed using those adapters, we should have a subset of supported functionality for the same methods on twitter and reddit. For methods not implemented, throw an error.

Resolve all dependency issues

When installing packages, these are the current warnings/errors:

npm:

npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

yarn:

warning snoowrap > [email protected]: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
warning snoowrap > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning snoowrap > request > [email protected]: this library is no longer supported
warning snoowrap > request > [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning @11ty/eleventy > browser-sync > socket.io > [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
warning @11ty/eleventy > browser-sync > socket.io > socket.io-parser > [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
warning @11ty/eleventy > browser-sync > socket.io > engine.io > [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
warning node-polyfill-webpack-plugin > url > [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning semantic-release > @semantic-release/npm > npm > libnpmdiff > pacote > @npmcli/run-script > node-gyp > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

I'm still waiting for a snoowrap update to remove the deprecated request module: not-an-aardvark/snoowrap#338 (whenever they eventually release v2.0)

I also think that eleventy could be removed once we have more solidly tested html examples. There's no need to have this as a dependency, even a dev one.

Create monorepo for biketag and include this project

I suppose using Lerna?

Does this mean that we will have to store the code elsewhere? How does this all play out with existing repositories and existing npm packages? We currently have:
https://npmjs.com/package/biketag
https://www.npmjs.com/package/biketag-app

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

The automated release is failing 🚨

🚨 The automated release from the production branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the production branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two Factor Authentication for your account, set its level to "Authorization only" in your account settings. semantic-release cannot publish with the default "
Authorization and writes" level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

[BUG] The times are not the times

Describe the bug
The times (and dates, for that matter) for the BikeTag API data are simply the times of the upload to Imgur. This does not necessarily reflect the time that the tag was acquired. While it may not be as important for some things, having accurate times are important for the following reasons:

  1. timezones are not reflected. the time that is displayed is whatever time that Imgur chooses at the time of upload. Example: Vienna's times are not reflective of the time of day that the tags were obtained.
  2. When images are deleted and reuploaded, which happens sometimes, or when entire albums are copied to new locations, which has happened a couple fo times to overcome issues created by Imgur that were not resolved: the times are then the time of upload. More than half of Seattle's current tags were all done on the same day!
  3. We cannot use any of the time data for things we might want to do in the future (like badges).

Additional context
This was a tough one for me to crack, mentally. I think the solution I prefer moving forward is this:

  1. Keep it human-readable. We can do MM-DD-YYYY HH:MM:SS if we want to, or some shortened version of that, and still be able to display it in any format for a given locale.
  2. It can be stored in the title. We have a space there.
  3. The shorter the better. As we add more text data to each tag, we increase the amount of data to receive on the "ONE BIG REQUEST".

Consider changing the source of truth

Describe the problem
The source of truth, stored in the form of Imgur albums, comes as a single download of text data from Imgur's API: https://api.imgur.com/models/album

The API first parses the entirety of this data to get all tag data, then returns that data for use in all methods, regardless of the size of the data requested. (for example, if the most recent tag is requested, it will process all tag images before it searches for the most recent tag -- because it cannot know what the most recent is without reading in all tags first)

Options for changing the source of truth include:

  1. a JSON database that holds this data and is cached somewhere.
  2. Store the hash of the most recently posted biketag in sanity.
  3. Create a database for BikeTags to enable more atomic interactions with the data.

[BUG] parenthesis inside the foundLocation and hint fields causes data to be truncated

Describe the bug
When adding locations or hints that contain the values ( or ), in any combination, have the potential to break how data is stored for these fields.

To Reproduce
Steps to reproduce the behavior:

  1. Submit a foundLocation with a ( or pair (...)
  2. Submit a hint with a ( or pair (...)
  3. Observe the data lost within the hint and foundLocation fields

Expected behavior
For these characters to not break the fields when included.

Screenshots
IMG_3918
Screenshot 2023-11-24 at 8 32 40 PM

Additional context
I think it would be possible to improve the regular expressions that the biketag-api uses to be able to support parenthesis within the hint/foundLocation. If someone wants to help with this, you can look at the regular expressions that take this information and put it into/pull it from the singular title or description fields.

export const getHintFromTextRegex = new RegExp(/(?:hint:\s*?)([^)]*)/i)

Used here:

hint = getHintFromText(mysteryImageDescription)

And here is where the found description is built (using the foundLocation field):

export const getImgurFoundDescriptionFromBikeTagData = (

And here is where the mystery description is built (using the hint field):
https://github.com/KenEucker/biketag-api/blob/0053c3aea51dee8c3d79a9e557323d595fcaa449/src/common/getters.ts#L485C14-L485C55

Implement an AWS S3 connector for this API

Is your feature request related to a problem? Please describe.
Imgur is the primary source of truth for BikeTag Images and the associated data. So that we can remove this single point of failure (which sometimes does fail) we can build an alternative. AWS S3 is a clear alternative.

Describe the solution you'd like
Add source "S3", and build out the overloaded methods for adding, editing, and deleting BikeTag posts.

Describe alternatives you've considered
Imgur is still the primary, free, source of truth.

Additional context
This work would be best completed by someone(s) with more AWS experience than I have. I am willing to participate as long as there are others involved as well.

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.