Skip to content

About

Repo for the Ironhack M3 Project brought to you by The Three Amigos

Resources

Stars

2 stars

Watchers

3 watching

Forks

Repository files navigation


a stand-in image for the useum app

/USEUM - showcase yourself!

Repo for the frontend code of the Ironhack Bootcamp M3 Project

To see the backend code, please click here


Think of all the /uses pages that are sitting around the web, waiting to be viewed and compared by web devs all over the world.

Now imagine these /uses encompassing ANYTHING you could imagine - not just software and keyboards, but hiking gear and beer glasses, trading cards and Harry Potter memorabilia.

And NOW imagine a social media platform where you can share all of your collections with others.

Welcome to the /USEUM - please enter here



Installation

For a local installation, follow these steps

Always run

npm install

before

npm run dev

to make sure everything is there


Project Description


Basic Functionalities (Minimum Viable Product)


  • User creation & authentication, login via email & username, account deletion
  • Creation / deletion of collections and items (for properties refer to Models)
  • Browsing other users collections and items, adding them to own collections
  • Image Upload for Users, Collections & Items

Advanced Functionalities


  • Bookmarking & "Like"-ing of collections and items
  • "Follow"-ing other users
  • "Popular Collections / Trending Items" - algorithm based on likes for items & collections
  • "Recommended Collections / Items" - algorithm based on congruency of collections / items with users' interests
  • AI-generated item & collection descriptions using OpenAI
  • Comment section on Collections & Items
  • Event Log for every user

Technologies

As a MERN stack app, the frontend is written in React with the backend in Node.js and Express connecting to a MongoDB database

Most important technologies include:

Project Structure

Overall, the project is split into two repositories - one for handling the frontend, one for the backend. For deployment, we hosted this frontend repo on Netlify, while the backend code is handled by Cylic.


Models


User
const { Schema, model } = require("mongoose");
const Category = require("./Category.model");
const Collection = require("./Collection.model");
const Item = require("./Item.model");
const Comment = require("./Comment.model");

const userSchema = new Schema(
  {
    email: {
      type: String,
      required: [true, "Email is required."],
      unique: true,
      lowercase: true,
      trim: true,
    },
    password: {
      type: String,
      required: [true, "Password is required."],
    },
    username: {
      type: String,
      required: [true, "Username is required."],
      unique: true,
      trim: true,
    },

    userbio: {
      type: String,
      maxlength: 2000,
    },

    pronouns: {
      type: String,
    },

    imageUrl: {
      type: String,
      default: "/images/default/default-profile.png",
    },

    headerImageUrl: {
      type: String,
      default: "/images/default/default-header.svg",
    },

    collections: [
      {
        type: Schema.Types.ObjectId,
        ref: "Collection",
      },
    ],
    items: [
      {
        type: Schema.Types.ObjectId,
        ref: "Item",
      },
    ],
    bookmarks: [
      {
        type: Schema.Types.ObjectId,
        ref: "Item",
      },
      {
        type: Schema.Types.ObjectId,
        ref: "Collection",
      },
    ],
    likes: [
      {
        type: Schema.Types.ObjectId,
        ref: "Item",
      },
      {
        type: Schema.Types.ObjectId,
        ref: "Collection",
      },
    ],
    categories: [
      {
        type: Schema.Types.ObjectId,
        ref: "Category",
      },
    ],
    followers: [
      {
        type: Schema.Types.ObjectId,
        ref: "User",
      },
    ],
    following: [
      {
        type: Schema.Types.ObjectId,
        ref: "User",
      },
    ],
    comments: [
      {
        type: Schema.Types.ObjectId,
        ref: "Comment",
      },
    ],
  },
  {
    // this second object adds extra properties: `createdAt` and `updatedAt`
    timestamps: true,
  }
);

const User = model("User", userSchema);

module.exports = User;
Category
const mongoose = require("mongoose");

const categorySchema = new mongoose.Schema({
  category: {
    type: String,
  },
});

const Category = mongoose.model("Category", categorySchema);

module.exports = Category;
Comment
const { Schema, model } = require("mongoose");

const CommentSchema = new Schema(
  {
    title: {
      type: String,
      // required: [true, 'Title is required.'],
      unique: false,
    },
    body: {
      type: String,
    },
    user: {
      type: Schema.Types.ObjectId,
      ref: "User",
    },
    item: {
      type: Schema.Types.ObjectId,
      ref: "Item",
    },
  },
  {
    timestamps: true,
  }
);

const Comment = model("Comment", CommentSchema);

module.exports = Comment;
Collection
const { Schema, model } = require("mongoose");

const User = require("./User.model");
const Item = require("./Item.model");
const Comment = require("./Comment.model");
const Category = require("./Category.model");

const collectionSchema = new Schema(
  {
    name: {
      type: String,
      required: [true, "Name is required."],
      unique: true,
    },
    description: {
      type: String,
    },

    imageUrl: {
      type: String,
      default: "/images/default/default-collection.svg",
    },
    createdBy: {
      type: Schema.Types.ObjectId,
      ref: "User",
    },

    items: [
      {
        type: Schema.Types.ObjectId,
        ref: "Item",
      },
    ],
    comments: [
      {
        type: Schema.Types.ObjectId,
        ref: "Comment",
      },
    ],
    likes: [
      {
        type: Schema.Types.ObjectId,
        ref: "User",
      },
    ],
    categories: [
      {
        type: Schema.Types.ObjectId,
        ref: "Category",
      },
    ],
  },
  {
    // this second object adds extra properties: `createdAt` and `updatedAt`
    timestamps: true,
  }
);

const Collection = model("Collection", collectionSchema);

module.exports = Collection;
Item
const { Schema, model } = require("mongoose");

const Collection = require("./Collection.model");
const Comment = require("./Comment.model");
const User = require("./User.model");
const Category = require("./Category.model");

const itemSchema = new Schema(
  {
    name: {
      type: String,
      required: [true, "Name is required."],
      unique: true,
    },
    description: {
      type: String,
    },
    imageUrl: {
      type: String,
      default: "/images/default/default-item.svg",
    },
    categories: [
      {
        type: Schema.Types.ObjectId,
        ref: "Category",
      },
    ],
    collections: [
      {
        type: Schema.Types.ObjectId,
        ref: "Collection",
      },
    ],
    users: [
      {
        type: Schema.Types.ObjectId,
        ref: "User",
      },
    ],
    likes: [
      {
        type: Schema.Types.ObjectId,
        ref: "User",
      },
    ],
    comments: [
      {
        type: Schema.Types.ObjectId,
        ref: "Comment",
      },
    ],

    createdBy: {
      type: Schema.Types.ObjectId,
      ref: "User",
    },
  },
  {
    timestamps: true,
  }
);

const Item = model("Item", itemSchema);

module.exports = Item;

Routes






Shoutouts


We'd like to shout out to and thank everyone who made this project possible, from supporting in the deployment of this app to populating the deployed version with real life data


Thank you all!

Ironhack Transatlantic AI-Powered Feline

Diogo, Jaime & Dani - the OTHER Three Amigos

Pat

Chatty

Chicken the Cat


Contributors



This project was realized by Johannes Chorzempa, Nana Chuto & Lukas Jürgens for the third module of Ironhack Bootcamp.

About

Repo for the Ironhack M3 Project brought to you by The Three Amigos

Resources

Stars

2 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages