Giter Site home page Giter Site logo

shopify-img-repo's Introduction

Image Repository Application

This is an Image Repository Application ExpressJS project.

General Architecture

  1. NodeJS application powered by ExpressJS with PassportJS JWT Auth
  2. Prisma ORM for PostgreSQL.
  3. Heroku for application and database deploys.

Run locally

Duplicate .env.sample to .env and replace with your appropriate environment variables.

To deploy your database schema, run (one-time):

# Deploy schema.sql to Heroku postgres
heroku pg:psql -a YOUR_APP_NAME -f prisma/schema.sql

# Regenerate Prisma schema and client
yarn prisma introspect && npx prisma generate

# Seeding the database with sample data (not necessary)
yarn prisma db seed --preview-feature

To run the application:

# Install dependencies
yarn

# Run locally
yarn start

To run the tests:

yarn test

alt text

Using the Application (examples with Postman below)

There are 2 image endpoints available:

  • GET /images

    • Returns JSON response of all uploaded images
    • alt text
  • POST /images/create

    • Uploads an image
    • alt text
    • alt text

There are 3 authentication endpoints available:

  • POST /auth/register

    • Registers a user to use the application
    • Make a POST request with the JSON body containing user and password
  • POST /auth/login

    • Logs in a user to use the application and returns a JWT auth token
    • alt text
  • GET /auth/status

    • Checks a JWT token to see the user authorized
    • alt text

Next Steps

This project can support uploading and deleting of images as well as adding tags/metadata and search functionality. The backend schema already supports a lot of new flexible features such as tags, API endpoints simply need to be created for this. This project can also support basic role based access control so users with ADMIN permissions can perform all actions, but USERS have read-only permissions (see schema). Again, API endpints need to be created for this. Another extension to consider is automatically tagging the images by hooking in a ML Image Detection Classifier API.

shopify-img-repo's People

Contributors

thepenguinco avatar

Watchers

James Cloos avatar  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.