Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luzefiru/assetica
A full stack inventory management web application for the modern consumer.
https://github.com/luzefiru/assetica
express-js full-stack mongodb rest-api restful-api
Last synced: 4 days ago
JSON representation
A full stack inventory management web application for the modern consumer.
- Host: GitHub
- URL: https://github.com/luzefiru/assetica
- Owner: Luzefiru
- Created: 2023-04-30T09:37:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-05-03T11:32:20.000Z (over 1 year ago)
- Last Synced: 2024-11-09T20:12:52.584Z (2 months ago)
- Topics: express-js, full-stack, mongodb, rest-api, restful-api
- Language: EJS
- Homepage:
- Size: 10.6 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Assetica
A cloud-based inventory management web application for the modern consumer. Powered by an Express.js REST API web service hosted on [Render.com](https://render.com/) that fetches data from a NoSQL [MongoDB](https://www.mongodb.com/) database cluster and performs HTML server-side rendering with EJS.
## Database Schema
This schema was made with [QuickDBD](https://www.quickdatabasediagrams.com/) for visualizing the relationships between the Mongoose Models.
- an `Item`'s `category` array field can have **1 or many** `Category` objects.
- a single `Category` object can belong to **0 or many** `Item` objects at any time.
- `URL` Strings are [Mongoose Virtuals](https://mongoosejs.com/docs/tutorials/virtuals.html) that are based on the base route URL and the `Schema.Types.ObjectId`.```js
const ItemSchema = new Schema({
name: { type: String, required: true, trim: true },
description: { type: String, required: true, trim: true },
category: { type: Schema.Types.ObjectId, ref: 'Category', required: true },
price: { type: Number, required: true },
in_stock: { type: Number, required: true, min: 0, default: 0 },
});ItemSchema.virtual('URL').get(function () {
return `/item/${this._id}`;
});const CategorySchema = new Schema({
name: { type: String, required: true, trim: true },
description: { type: String, required: true, trim: true },
});CategorySchema.virtual('URL').get(function () {
return `/category/${this._id}`;
});
```## Mockups