GithubHelp home page GithubHelp logo

trusat / trusat-frontend Goto Github PK

View Code? Open in Web Editor NEW
31.0 7.0 9.0 13.51 MB

The React codebase for space-sustainability tool TruSat

Home Page: https://trusat.org

License: Apache License 2.0

HTML 0.46% JavaScript 79.28% CSS 20.27%
space-sustainability react satellite satellites space javascript ethereum open-data open-source iod

trusat-frontend's Introduction

TruSat banner

trusat-frontend

An open-source space sustainability tool

TruSat is a citizen-powered satellite catalog, crowdsourcing observations of satellites to form an independent record of objects orbiting Earth.

This repo contains the frontend code for TruSat’s catalog app, providing citizen-scientists with orbit predictions to help them spot satellites and capture data. Anyone can submit their own satellite observations to automatically update the catalog’s orbit predictions.

  • Visit TruSat.org to see the live app
  • View the docs to learn more about the project
  • Join the Discord to follow the development discussion

Get Started

This repo was bootstrapped with create-react-app. You can clone the repo, install all the dependencies and run the app in development mode with the following commands in your Terminal:

git clone https://github.com/TruSat/trusat-frontend.git trusat-frontend
cd trusat-frontend
yarn install && yarn start

Open http://localhost:3000 to view it in the browser. The page will automatically reload if you make changes to the code.

src directory

.
├── App.js
├── App.test.js
├── app
│   ├── app-helpers.js
│   ├── app-styles.scss
│   └── components
│       ├── BurgerMenu.js
│       ├── Button.js
│       ├── ChatIcon.js
│       ├── CookieBanner.js
│       ├── CopyText.js
│       ├── DiscourseChatIcon.js
│       ├── Footer.js
│       ├── JoinTheMission.js
│       ├── MobileHeader.js
│       ├── NavBar.js
│       ├── ObjectBadge.js
│       ├── ScrollToTop.js
│       ├── SocialIcons.js
│       ├── Spinner.js
│       ├── TablePaginator.js
│       └── TrusatGlobeCanvas.js
├── assets
│   ├── Arrow.svg
│   ├── CircleCheck.svg
│   ├── ConditionBad.svg
│   ├── ConditionExcellent.svg
│   ├── ConditionFair.svg
│   ├── ConditionGood.svg
│   ├── ConditionPoor.svg
│   ├── ConditionTerrible.svg
│   ├── DeleteStation.svg
│   ├── Globe.svg
│   ├── ProfileAvatar.svg
│   ├── QuestionMark.svg
│   ├── SatSymbol.svg
│   ├── SketchLarge.js
│   ├── SketchSmall.js
│   ├── SketchTrusatGlobe.js
│   ├── TrusatLogoBig.svg
│   ├── TrusatLogoSmallBlack.svg
│   ├── TrusatLogoSmallWhite.svg
│   ├── earth-shadows-400px.jpg
│   ├── icon-arrow-up.svg
│   ├── icon-chat.svg
│   ├── icon-eye.svg
│   ├── icon-globe.svg
│   ├── icon-light.svg
│   ├── icon-location.svg
│   ├── icon-lock.svg
│   ├── icon-lowlight.svg
│   ├── icon-question.svg
│   ├── icon-relaxing.svg
│   ├── icon-rocket.svg
│   ├── icon-satellite.svg
│   ├── icon-time.svg
│   ├── icon-trash.svg
│   ├── icon-user.svg
│   └── icon-wave.svg
├── auth
│   ├── auth-context.js
│   ├── auth-helpers.js
│   ├── auth-styles.scss
│   ├── auth.test.js
│   └── components
│       ├── LoginForm.js
│       ├── LoginOptions.js
│       ├── MetaMask.js
│       ├── SignupForm.js
│       └── SignupOptions.js
├── catalog
│   ├── catalog-styles.scss
│   └── components
│       ├── CatalogNavBar.js
│       ├── CatalogNavDropdown.js
│       ├── CatalogTable.js
│       ├── DownloadCatalogFilterTleButton.js
│       ├── FilterDescription.js
│       └── HowToParticipate.js
├── index.js
├── objects
│   ├── components
│   │   ├── DownloadObjectTleButton.js
│   │   ├── FilterDescription.js
│   │   ├── HistoryMonthTable.js
│   │   ├── HistoryYearDropdown.js
│   │   ├── HowToSeeIt.js
│   │   ├── InfluenceTable.js
│   │   ├── Info.js
│   │   ├── ObservationsFilter.js
│   │   └── UserSightingsTable.js
│   ├── objects-context.js
│   └── objects-styles.scss
├── profile
│   ├── components
│   │   ├── ObjectsCollectedTable.js
│   │   ├── ObservationsTable.js
│   │   └── ProfileHeader.js
│   ├── profile-context.js
│   ├── profile-styles.scss
│   └── styles
├── serviceWorker.js
├── styles
│   ├── base
│   │   ├── _base.scss
│   │   ├── _reset.scss
│   │   └── _typography.scss
│   ├── helpers
│   │   ├── _mixins.scss
│   │   └── _variables.scss
│   └── main.scss
├── submissions
│   ├── components
│   │   ├── MultipleObservationForm.js
│   │   └── SingleObservationForm.js
│   └── submissions-styles.scss
├── user
│   ├── components
│   │   ├── DataSettings.js
│   │   ├── DownloadObservations.js
│   │   ├── EditProfileSettingInput.js
│   │   ├── ProfileSettings.js
│   │   ├── SavedLocations.js
│   │   ├── SecuritySettings.js
│   │   ├── StepFive.js
│   │   ├── StepFour.js
│   │   ├── StepOne.js
│   │   ├── StepThree.js
│   │   └── StepTwo.js
│   └── user-styles.scss
└── views
    ├── About.js
    ├── AccountSettings.js
    ├── AddStation.js
    ├── Catalog.js
    ├── ClaimAccount.js
    ├── Join.js
    ├── LogIn.js
    ├── MetamaskImport.js
    ├── ObjectInfo.js
    ├── PrivacyPolicy.js
    ├── Profile.js
    ├── SignUp.js
    ├── Submit.js
    ├── SubscriptionConfirmed.js
    ├── Terms.js
    ├── TestPilotConfirmed.js
    ├── VerifyClaimAccount.js
    ├── Welcome.js
    └── views-styles.scss

Inspired by this post, the files in the src directory are grouped by domain. For example, within the submissions directory you will find all components (and their accompanying styles) related to the domain of observation submissions. At the time of writing this includes the MultipleObservationForm and SingleObservationForm components.

The assets directory contains all the svg files that are utilized by the front end. Other image files are hosted externally on AWS.

Tests

Run the tests with the following command:

yarn test

Contributing

We very much welcome contributions, especially those that tackle open issues! If you wish to contribute, either open an issue then make a pull request or make a pull request against a currently open issue.

Branch naming convention

Our team uses the following convention for naming branches:

  • master - The production environment
  • dev - The branch used for deploying to the development/staging server environment
  • feature/{name-of-feature} - A feature branch
  • bugfix/{name-of-bug-being-fixed} - Fixing a bug larger in scope than a hotfix
  • hotfix/{name-of-hotfix} - Hotfix changes for production issues (branches off master)
  • chore/{summary-of-chore} - Cleaning up / organizing the code
  • wip/{name-of-wip} - Branched out for some “work in progress” stuff (not ready, can be experimental and you want to keep a remote copy)

And here are some examples:

  • feature/single-iod-form
  • feature/single-iod-form-styles
  • bugfix/whitepaper-not-rendering-on-ipad
  • hotfix/typo-on-welcome-page
  • chore/removing-unused-imports
  • wip/add-3box-for-authentication

Branch creation to opening a PR

  • Referencing the branch naming convention outlined above determine the group and name for your branch then run git checkout -b {group}/{name-of-group} to create the new branch and check it out.
  • Commit early and commit often with clear and concise comments. All commits should remain focused in scope so try to avoid submitting PR's that contain unrelated commits.
  • Run git push --set-upstream origin <your-new-branch> to add your new branch to the remote repo when you feel the work completed warrants a back up.
  • When ready to open a PR, use git push to add all your latest commits to the remote copy.
  • Do not open a PR without directing it to an open issue on GitHub. If an issue does not exist, create it and add a label. Here's an example:
The "How To" page content is out of date when compared to the latest communication content found in the TruSat discuss forum
  • When ready click the green "New pull request" button on the "Pull requests" page for the repo on GitHub, making sure you are requesting to merge your branch into the master branch.
  • Assign at least one reviewer to your PR.
  • Add detailed comments to outline what your PR achieves and make sure to reference the issue that will be closed by this PR by utilizing the issue number. Bulleted lists are preferred. For example:
- Updates the “how to” view with the latest comms content
- New styles added including a change of font to the headers which matches the latest changes to the "About" page.
- This closes #32.
  • Do not open the PR if there are merge conflicts found. Instead - push a fix to your branch that clears the conflicts.
  • If no merge conflicts are found, open the PR.

License

TruSat is open source software licensed as Apache License 2.0.

trusat-frontend's People

Contributors

dependabot[bot] avatar johngribbin avatar kmoneal avatar maccomaccomaccomacco avatar mainnebula avatar mikeville avatar neocybereth 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

trusat-frontend's Issues

Error handling for claim account

When hitting /claimAccount, the frontend needs to check for a result = False to tell that the user does not have an account created.

Login with MetaMask on Firefox failing

When logging in on Firefox using MetaMask, the JWT will be returned to the user and used for the initial /profile request but is set to None after that initial call. This happens after you log out and try logging back in

Incorporate obj_merged_description from

Added object_merged_description to JSON object below. Please update front-end to use this in place of obj_purpose/obj_purpose_detailed/obj_comments where a long description is used. object_merged_description incorporates these fields into it.

      Json_Object(
          'object_norad_number', object_number,
          'object_name', obj_name,
          'object_origin', obj_country_owner,
          'object_type', obj_purpose,
          'object_primary_purpose', obj_purpose_detailed,
          'object_secondary_purpose', obj_comments,
          **'object_merged_description', obj_merged_description,**
          'object_observation_quality', %(QUALITY)s,
          'object_launch_date', obj_launch_date,
          'time_last_tracked', date_format(obs_time, '%M %d, %Y'),
          'address_last_tracked', obs_eth_addr,
          'username_last_tracked',obs_user_name)

No Q/A in FAQ r.e. email/password/secret flow

We link to the FAQ in the email sent to users like so:

This email is the only time we can send you this code. TruSat cannot
restore your account or reset your password for you. Please save this
email forever and make a note of the password you used.

Why do we do it this way? Read more

we need a question and an answer in FAQ to address this

No footer on front end

Should contain:

  • Links/icons to social media sites, maybe ConsenSys Space website
  • Link to privacy policy
  • Link to terms of use

Globe image on home page loading late

  • One solution is using an svg format instead of the current png.
  • Having at least a high-res and low-res version will help a lot, as the srcset prop on image tags will determine which image to load depending on the screen type. I.e. low-res will be used for cellphones and high-res will be used for retina displays.
  • Rendering a placeholder container will also stop the jumpy render of the text either side of the image

No route for FAQ

There will be a new separate route in the app for FAQ to pair with the About route.

Footer overlapping elements on page(s)

For (at least) the profile page, the footer overlaps the observations section. This is preventing clicking next and back unless you find the few pixels that aren't covered.

App doesn't check for expired JWTs

The app currently does not check is the users JWT has expired upon revisit to the page, or when an API call is made that requires them to verify their identity.

Fix styling of footer

  • Doesn't work well being fixed as it can overlap with table content
  • Should instead be render at the bottom of the views
  • This may include tweaking the height styles of some views like /claim that do not have a lot of content as the footer will render half way up the page under the form (currently not a problem due to it having a fixed position)

Fix signup flow to handle the case of when a user has already created an account

When the /getNonce endpoint is hit during the signup flow by a user that already has an account it now sends back a 204 success message - with no content. This should render a message to tell the user something like-

“We already have an account on file for your email address. If you already created an an account with us, please check your email for the secret we sent you upon sign up. If you have not already signed up with us or you forgot your password then please use this link to reclaim your account.” 

One browser cannot access my local front end

I'm not quite sure how I broke this. I think I might have logged in when my API server was down. Doing that probably should have failed the login(?), but the login "succeeded" and now I cannot load the webapp at all with this browser.

Error message below. Would be happy to help debug if/when this is sufficiently high priority.

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.