Giter VIP home page Giter VIP logo

localthreat's Introduction

localthreat Netlify status Back-end deploy status CodeQL status

localthreat.xyz


About

localthreat is an online tool to help EVE players with threat assessment.

Contribution

I accept ISK donations as contributions to the project. If you feel like localthreat has helped you please consider contributing. Send a donation in-game of any value to Jason Chorant. This helps to keep me motivated and also with the costs of running and maintaining this service.

Development

  • ๐Ÿ‘จโ€๐Ÿ’ป The code and documentation are hosted on GitHub.
  • ๐ŸŽจ The design lives on Figma.
  • ๐Ÿ› Bug tracking, feature requests, and other feedback must be made on the repository's issues page.

Docker setup (recommended)

You'll need to be resolving any subdomain of localhost to localhost. If you're using Chrome it does that automatically. Otherwise you'll need to edit your hosts file or have something like dnsmasq resolving client-localthreat.localhost and api-localthreat.localhost.

With Docker and docker-compose installed , run:

$ docker-compose up

This will boot everything you need in one go. Pass -d to free your terminal (daemon mode). You can resume your work later with the same command.

If it's your first run though, you'll need to seed the database. Once the containers are up, run:

$ docker-compose exec -T db psql -h localhost -U postgres postgres < api/schema.sql

You can access the app at http://client-localthreat.localhost and the API at http://api-localthreat.localhost.

Manual setup

If you don't have Docker or don't want to deal with DNS you can build and run everything locally.

API

It's a simple web server written in Go that talks JSON.

You'll need Go 1.15+ installed. Hop into the api/ sub-directory and run:

$ go get

To download all the dependencies and then:

$ make

To test and build the binary.

You'll also need PostgreSQL 12+ running. Load api/schema.sql file into your database and run:

$ DATABASE_URL=postgres://postgres@localhost/postgres PORT=5000 ./api

This will start the API server. You might want to adjust the DATABASE_URL and PORT values accordingly.

Client

It's a Create React App written in TypeScript.

You'll need Node 12+ and npm installed. Hop into the client/ sub-directory and run:

$ npm install

To download all the dependencies and then:

$ REACT_APP_API_URL=http://localhost:5000 npm run-script start

To start the development server. You might want to adjust the REACT_APP_API_URL value accordingly.

Legal

The MIT License ยฉ 2017 Arthur Corenzan

EVE Online and the EVE logo are the registered trademarks of CCP hf. All rights are reserved worldwide. All other trademarks are the property of their respective owners. EVE Online, the EVE logo, EVE and all associated logos and designs are the intellectual property of CCP hf. All artwork, screenshots, characters, vehicles, storylines, world facts or other recognizable features of the intellectual property relating to these trademarks are likewise the intellectual property of CCP hf.

localthreat's People

Contributors

haggen avatar quantumferret avatar taur1ne 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

localthreat's Issues

Loading cue

When loading the content (after a paste or by ID) the site does not indicate to the user it's busy processing the request. A loading cue or animation would be great!

Also accept paste from Intel chats

Match <url=infotype://13\d\d/.+?>(.+?)</url> (not actually tested); group 1 is the character's name.

Remember to update the instructions in Welcome screen.

Compatible mode that shows a textarea to paste content

Some browsers and systems might not recognize or not support pasting on the window. For these and other cases it might be a good idea to have a "compatible mode" where we display a textarea to have content pasted in.

Loading states

What's your idea?

Display loading states to summary and table.

Why do you think it's a good idea?

Looks cool and cues the user that something is happening while we have no or too few data.

Add content limit to paste creation

Right now it's possible to post a huge payload to paste creation endpoint and no validation would take place. There should be a limit and an appropriate message on the front-end.

change port

How can I change the default port from 8080 to something else?

WOW

I am gonna check this out but.. fantabulous.. if this is still being maintained this is awesome.

Limit pasted content

Copy/paste Jita local to see what I mean.

Also let the user know the paste has be truncated to avoid confusion.

Fix footer

  • Add credit to ESI and zKillboard
  • Fix legal notice mentioning zKillboard

History panel

  • Save a history of visited reports
  • Add a side panel that shows this history
  • List date and time of the report and also stats such as number of characters

Cache previously viewed data

Given the time it takes to fetch all the information it would be helpful to add a cache layer on top of either the App's state or the API response.

I'm leaning into caching the state, so the components are free to revalidate the data.

Better help panel

Help panel needs a review, with the perspective of the user needing actual help (information is secondary).

Settings panel

Suggested settings controls:

  • Switch color scheme (#32).
  • Compatible mode (#50).
  • Toggle between extending current report or creating new report on Paste.

Requests should stop after exiting a report

What were you doing?

I loaded a report and then clicked on New Report to change the page.

What did you expect to happen?

I expected the remote requests of the report to halt after I changed the page.

What happened instead?

They continued, needlessly.

Better paste format detection

Looking into the data I noticed the API is failing at detecting a chat transcript when there's no character links and defaulting to members list format. We should be more strict when detecting the paste content format, for instance, we could follow the game's policy on character names to detect an invalid paste:

Valid player character names:

  • Must be at least 3 characters.
  • Cannot exceed 37 characters. (This limit includes one space between the characters name and family name.)
    • Name cannot exceed 24 characters. The name can include a middle name separated by a space.
    • Family name cannot exceed 12 characters.
  • May contain the characters A-Z, a-z, 0-9, hyphen-minus and single quotation. (Corporation names may also include the dot character.)
  • Space, hyphen-minus and single quotation characters are not allowed as the first or last character in a name.
  • Must be unique.

โ€” https://community.eveonline.com/support/policies/naming-policy-en/

No results displayed

Hi, first of all: great tool! worked fine until now. i can get no results - nothing is displayed. there's is also nothing shown, when i click through my history.

Regards!

Keyboard shortcuts

  • Share
  • New Report
  • History

Consider adding cues to the UI to suggest the support for keyboard shortcuts. Also list them in the Help panel (#36).

Drop unnecessary requests

You can get corporation and alliance information from the zKillboard API instead of having to make 3 extra requests to ESI (affiliation, corporation, and alliance).

Paste sharing

  1. Generate an unique ID for each paste
  2. Append it to the URL
  3. Save both ID and paste content into some back-end (Firebase?)
  4. Save a history of pastes for current user (browser storage, cookies, etc.)
  5. Load the paste content when visiting a URL with an existing ID

Help panel

See #35. Like that, but for Q&A.

  • What is localthreat?
  • How does it work?
  • Does it cost anything?
  • Does it collect my information?
  • I like it.
  • I have other questions.

Broken zKill links

Something changed recently on zKill's side of things that's unearthed a bit of an issue in the code here. The links to zKill being generated by localthreat are generating errors because they're missing trailing slashes in the URLs.

I haven't been able to test it, but tweaking the getEntityURL code in entity.js should probably help fix the problem (the code below has the slashes added in):

const getEntityURL = (type, id) => {
  switch (type) {
    case "char":
      return `https://zkillboard.com/character/${id}/`;
    case "ally":
      return `https://zkillboard.com/alliance/${id}/`;
    case "corp":
      return `https://zkillboard.com/corporation/${id}/`;
    case "ship":
      return `https://zkillboard.com/character/${id[1]}/shipTypeID/${id[0]}/`;
  }
};

Not recognizing attempts to paste

Apologies if this is a known issue or something local to me, but about a week ago I became unable to paste into the page, even though I verified the clipboard held the pilot list. No-adblocker. Incognito mode doesn't work, either. Tried Chrome and Edge.

News panel

A communication channel with the site users would be helpful. Things like known issues, change log and what not could be posted over there and help foster the community.

The panel itself can be a drawer, pretty much like the History panel but on the left site.

Stats requests failing too often in cascade

zKillboard has an aggressive throttling in place in which I can only make a single request every second. Right now I have a regular interval of 1 second, where I dispatch a request on very tick. The problem is when a request takes too long the next one might come too soon and then it gets throttled.

The pattern I've seen is that the first few dozen requests takes about 50ms. But then this time begins to increase with each request, taking up to 1โ€“1.5s. That's when the cascading failures start. Once a request takes more than the, all the following ones fail as well.

  • One option is to put 1 second between requests, instead of dispatching in a regular interval of 1 second. i.e. dispatch a request, wait for it to finish, dispatch the next one. But this would really ramp up the time it takes to fill the stats.
  • Another option is to apply a dynamic interval between them, increasing as the requests take longer and decreasing otherwise.

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.