Giter Site home page Giter Site logo

adobe-th's Introduction

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, set up .env file:

  • NEXT_PUBLIC_API_URL=
  • NEXT_PUBLIC_API_KEY=
  • NEXT_PUBLIC_AUTH_DOMAIN=
  • NEXT_PUBLIC_PROJECT_ID=
  • NEXT_PUBLIC_STORAGE_BUCKET=
  • NEXT_PUBLIC_MESSAGING_ID=
  • NEXT_PUBLIC_APP_ID=

Next, install dep:

npm install
# or
yarn insall

Then, run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the homepage.

Features

  • Like & Dislike Images - Connected to FirestoreDB (NoSQL DB)

    • Rest API routes /api/images GET - Fetches all the photos in the db collections "Images" /api/images/[id] PUT - Add/Remove likes from photo with id
  • Data Cache

    • Get request is cached, for every request to fetch images from the DB it only accesses the DB only once until the cache is revalidated (i.e. when a user adds/dislikes image) - Read about NextJs Data Cache/Deduping here.
  • Use of server actions

    • Enhanced security and UX with all database communication done on the server and minimized the requests made from the client.
  • Authentication (only supports the core feature of logging in and out)

    • Login with Google
  • Modal Photo Preview

  • Responsive UI & Mobile Friendly

  • Built with scalability in mind, each component, type declaration, and function is designed with the intent to add more features and utility to them.

  • Typescript (Strongly Typed)

    • Please ignore the one place I had used "any", I was running out of time.
useEffect(() => {
    getCurrentUser().then(
      (res: any) => {
        res && setUserId(res?.uid)
      }
    )
  }, []) 

If only I had more time...

  • Unit Testing (unfortunately Next does not come with building support for jest/cypress similar to "create-react-app", so I didn't want to spend the limited time I had doing the setup)
  • Host on Vercel - Some build errors happen only on prod, unfortunately, I noticed only after the time clock had run out.
  • Auth - Users should be stored on DB, and a more thorough feature to limit the likes/dislikes of users to once.
  • Add Navigation on Modal View & Likes/Dislikes from the Modal.
  • Loading UI when images and async functions are running

Docker

docker pull mahmudahmed/adobe-th

To run:

docker run -p 3000:3000 -e NEXT_PUBLIC_API_KEY=[API_KEY] mahmudahmed/adobe-th

adobe-th's People

Contributors

mahmudahmed avatar

Watchers

 avatar

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.