All Projects → unicar9 → inventory-demo

unicar9 / inventory-demo

Licence: other
a simple MERN stack CRUD app example

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to inventory-demo

mean-stack
MEAN stack Mongoose, Express, Angular6, Node
Stars: ✭ 22 (+46.67%)
Mutual labels:  mongoose, expressjs
task-manager
Task Manager App
Stars: ✭ 19 (+26.67%)
Mutual labels:  mongoose, expressjs
ThinkApp
Test your knowledge with any of the available topic this fun and free Champion Quiz Master App. Save your time and effort by saving your queries & its resolutions
Stars: ✭ 15 (+0%)
Mutual labels:  mongoose, expressjs
docker-node-mongo-react-STARTER
🐋 🍃 ⚛️ Boilerplate for Node.js, MongoDB, React Applications (with Docker)
Stars: ✭ 34 (+126.67%)
Mutual labels:  mongoose, expressjs
value-app
Calculate the per-use value of purchases over time.
Stars: ✭ 14 (-6.67%)
Mutual labels:  mongoose, semantic-ui
Backend-NodeJS-Golang-Interview QA
A collection of Node JS and Golang Backend interview questions please feel free to fork and contribute to this repository
Stars: ✭ 122 (+713.33%)
Mutual labels:  mongoose, expressjs
express-typescript-mongoose-starter
A starter for Node JS, Express, Typescript, Mongoose application
Stars: ✭ 22 (+46.67%)
Mutual labels:  mongoose, expressjs
mini-express-boilerplate
A minimal Express boilerplate with passport user authentication, mongoose and some security setup configured
Stars: ✭ 15 (+0%)
Mutual labels:  mongoose, expressjs
timeoff-server
TimeOff is an application that allows companies' employees to set vacations before they begin taking their time off. Implemented in modern tech stack i.e. Node, Express, MongoDB.
Stars: ✭ 33 (+120%)
Mutual labels:  mongoose, expressjs
express-api
Building a RESTful API with Express and MongoDB
Stars: ✭ 28 (+86.67%)
Mutual labels:  mongoose, expressjs
NodeRestApi
Node.js, Express.js and MongoDB REST API App
Stars: ✭ 38 (+153.33%)
Mutual labels:  mongoose, expressjs
generator-espress
an opinionated yeoman generator that scaffolds a mvc express webapp completely in es6
Stars: ✭ 20 (+33.33%)
Mutual labels:  mongoose, expressjs
opentelemetry-ext-js
js extensions for the open-telemetry project
Stars: ✭ 122 (+713.33%)
Mutual labels:  mongoose, expressjs
NodeExpressCRUD
Node, Express, Mongoose and MongoDB CRUD Web Application
Stars: ✭ 45 (+200%)
Mutual labels:  mongoose, expressjs
WordNook
Dynamically updating blogging website to upload articles and blog posts on various topics, developed using ejs template engine and node js in the backend.
Stars: ✭ 80 (+433.33%)
Mutual labels:  mongoose, expressjs
OpenBook-E-Commerce
An e-commerce progressive web application, built with mern stack. It has features like product buy, order management by admin, payment gateway, cart, checkout and lot more.
Stars: ✭ 53 (+253.33%)
Mutual labels:  mongoose, expressjs
Online-Examination-System
Technologies : React js, Node js, Express js, Mongo Db, Ant Design, Redux js Key features: 1. User management 2. Modular code 3. Permission management 4. Persistent answers on page refresh in the test portal 5. Examination results using graphs 6. Results can directly be downloaded as excel sheet 7. Feedback system
Stars: ✭ 37 (+146.67%)
Mutual labels:  mongoose, expressjs
ng-nest-cnode
Angular 10 Front-End and Nestjs 7 framework Back-End build Fullstack CNode
Stars: ✭ 17 (+13.33%)
Mutual labels:  mongoose, expressjs
React-Native-Chat-App
A simple chatting app built with React Native, Socket.io, ExpressJS and MongoDB. The server app provides APIs for authentication, message sending and receiving. In the client app React-Native-Gifted-Chat is used for the chat interface.
Stars: ✭ 22 (+46.67%)
Mutual labels:  mongoose, expressjs
express-mvc
A light-weight mvc pattern for express framework with minimum dependencies
Stars: ✭ 23 (+53.33%)
Mutual labels:  mongoose, expressjs

inventory-demo (Created/Updated in April 2019)

Intro

After reading through the requirements, what immediately came to my mind was building a RESTful API in Node.js using express and mongoose. Since I didn't have much previous experience with server-side development specifically in JavaScript or NoSQL databases like MongoDB, it would be a rewarding learning journey for me as well. After I built up all the required API endpoints, added integration testing against a real database, also tested in Postman and it all worked, I started extending it to a MERN stack CRUD app example because I've enjoyed developing React/Redux app. I know that app development can be never-ending, but since it's a coding exercise with time constraints, I've made trade-offs along the way. Though what I present here is not a perfect and production-ready app, I do appreciate your understanding and hope you can see the abilities and potential in me that you're looking for in a team member.

Overview

  • Used MongoDB Atlas cloud service to persist all development and test data in the demo. The database has 3 models/collections, namely, Mall(Shopping Center), Asset and User. Malls and assets are in one-to-many relationship: each mall can have zero to many assets, and each asset can only belong to one mall. Below is an ERD diagram demonstrating all the properties in each model and their relationship.

    inventory-demo-erd

  • Integrated Google OAuth using Passport strategy for Google OAuth 2.0, and cookie-session for keeping track of login information. So no fuss about hashing passwords and setting up an admin user. I also tried JWT token-based authentication during the process but finally settled for OAuth due to its convenience.

Screenshots

  • Listing all assets, you can search assets by name, its associated mall name and location.

List of assets

  • Listing all malls, you can edit and delete each mall by clicking the button, and you can enter the detail page by clicking the mall card itself.

List of malls

  • When you click into the detail page of one mall, you can also check all the assets under this mall, or you can add a new asset belongs to this mall.

List of assets under one mall

Installation and Run on Local Machine

# clone it
git clone https://github.com/unicar9/inventory-demo.git
cd inventory-demo

# Install dependencies for back-end
npm install

# Run integration tests for back-end
# from the root directory 
npm run test

# Start back-end dev server and test the API on http://localhost:5000/api
# from root directory
npm run server

# Install dependencies for front-end
# go to client folder
cd client && npm install

# Start both back-end and front-end dev server and test the app on http://localhost:3000
# from root directory
cd ..
npm run dev

Please make sure your localhost port 3000, 4000, 5000 are not in use.

Back-end Usage(API Endpoints)

HTTP Requests URL Method
Initial entry point /api GET
Google authentication /auth/google GET
Logout /api/logout GET
Check current user api/current_user GET
Get all malls /api/malls GET
Create one mall /api/malls POST
Get one mall by id /api/malls/:mallId GET
Update one mall by id /api/malls/:mallId PUT
Delete one mall by id /api/malls/:mallId DELETE
Get all assets /api/assets GET
Create one asset /api/assets POST
Get one asset by id /api/assets/:assetId GET
Update one asset by id /api/assets/:assetId PUT
Delete one asset by id /api/assets/:assetId DELETE
Search assets by name, mall or location /api/assets/search POST
  • Sample Request Body for POST to /api/malls

Create one mall

{
  "name": "westfield",
  "address": "somewhere"
}
  • Sample Request Body for POST to /api/assets

Create one asset

{
  "name": "asset1", // required
  "location": "L3-10",
  "dimension": "10(w)x20(h)",
  "status": true // default to true
  "mall": "ndj2339d82dd"
}
  • Sample Request Body for POST to /api/assets/search

Search assets by name, mall name or location

{
  "q": "westfield", // any query string
  "cat": "name" // categories can be "name", "mall" or "location"
}

Dependencies(Tech-stacks)

Client-side Server-side
axios: ^0.18.0 body-parser: ^1.18.3
http-proxy-middleware: ^0.19.1 passport-google-oauth20: ^2.0.0
react: ^16.8.6 express: ^4.16.4
react-dom: ^16.8.6 cookie-session: ^1.3.3
react-redux: ^6.0.1 mongoose: ^5.4.21
react-router-dom: ^5.0.0 passport: ^0.4.0
redux: ^4.0.1
redux-form: ^8.1.0
redux-thunk: ^2.3.0

Other Acknowledgements

  • I used Semantic UI React library to build a neat and presentable layout on the front-end.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].