Repo for the frontend code of the Ironhack Bootcamp M3 Project
To see the backend code, please click here
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
For a local installation, follow these steps
Always run
npm installbefore
npm run devto make sure everything is there
- 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
- 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
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:
-
- Frondent build tool using ESbuild
-
- hashing passwords
-
- HTTP client based on Promises
-
- Providing core functionality for React Router
-
- React UI component library
-
- CSS framework for custom UI building
-
- Transforming styles with JS plugins
-
- Accessing OpenAI API from Node
-
- Image upload using Cloudinary Node SDK
-
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.
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;- Authentication, Signup & Login: auth.routes.js
- User CRUD, Followers & Likes: user.routes.js
- Image uploading: upload.routes.js
- Item CRUD: item.routes.js
- Collection CRUD: collection.routes.js
- Retrieving Categories: categories.routes.js
- Bookmark CRUD: bookmarks.routes.js
- MongoDB Atlas Query API search: search.routes.js
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 |
|---|---|---|---|
|
Pat |
This project was realized by Johannes Chorzempa, Nana Chuto & Lukas Jürgens for the third module of Ironhack Bootcamp.
