Giter Site home page Giter Site logo

fysikteknologsektionen / foton-gallery Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 5.15 MB

Photo gallery application for Foton at the Physics Divison at Chalmers University of Technology.

Home Page: https://foton.ftek.se

License: GNU General Public License v3.0

HTML 1.95% TypeScript 95.42% Shell 0.95% SCSS 1.68%
bootstrap bootstrap5 express javascript nodejs oauth2 react typescript

foton-gallery's People

Contributors

josefjor avatar

Watchers

 avatar

foton-gallery's Issues

Re-fetch data on form submission

Currently data is only loaded when pages are initially rendered. When editing album/user data, data should be re-fetched on form submission to prevent no longer valid data from being showed. Could be added by adding an additional function parameter to the LoadData callback that triggers a new fetch and integrating it with the form submission functions.

Rate limiter

There is currently no limit to how many subsequent requests can be made. This opens up to brute force attacks against the login endpoint and makes it generally easier to ddos the express server. To fix this a rate limiter should be implemented.

Improve error reporting from fetch

Currently the page will appear to load indefinitely when an invalid album is accesed. This should be replaced with a proper error message.

JWT refresh tokens

Implement JWT refresh tokens for authentication for additional security and no login time limit.

Improve backend error handling

The backend should be able to differentiate between actual errors and invalid requests/responses. Can be done by adding a new error type and checking the error type in a custom error handler.

Backend for file uploads

Implement a backend to handle file uploads (images) that can handle uploading, renaming and storing these. Also implement hooks for mongoose that deletes image files when the corresponding entries from the db is removed.

Implement react pages

React pages that needs to be implemented:

  • Login
  • Admin dashboard
    • Album overview/edit
    • User overview/edit
  • Gallery view
  • Individual album view

Gallery masonry/mosaic layout

Currently css grid is used for image layout. This works well if all images are more or less the same aspect ratios, but falls apart when high and low aspect ratios are mixed and leaves a lot of whitespace. It may be possible to automatically consume with whitespace with css grid and pack the images together. See this article for reference.

Generate test data

Create test/example data and create a script that populates a mongodb database with it.

Image upload order

Currently image uploading is done fully asyncronously which means the order in which images are uploaded is not preserved. This should be changed so that images are uploaded syncronously such that the order can be preserved.

Error boundary for suspense

Currently suspense is used to lazy load modules that a majority of users will never use. Even if it's extremely unlikely that loading these specifically will fail, it's still good practise to add an error boundary above it to prevent the entire app from crashing.

Pagination for gallery view

Implement a pagination for the gallery view. The get albums endpoint already supports a "page" query param; but it's possible this will require another endpoint that gets the total # of albums in order to render a "google"-esque pagination.

Scroll to top on pagination change

The page still doesn't reliably scroll to top when changing between pages using the pagination in the gallery view. Could probably be fixed by setting up promises for image load and then waiting on Promise.all() before scrolling.

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.