This is an Image Repository Application ExpressJS project.
- NodeJS application powered by ExpressJS with PassportJS JWT Auth
- Prisma ORM for PostgreSQL.
- Heroku for application and database deploys.
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
There are 2 image endpoints available:
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
-
GET /auth/status
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.