Database Schema - Shanfang/SmartNote GitHub Wiki

Table of Contents

  1. Database Structure
  2. MongoDB Installation & Start
  3. Connect to Server

Database Structure

DATABASE Address: mongodb://localhost:27017/microDev.

Listening Port: 3002.

Note Table Structure

Global Element Description Type
user_name User who owns the note String
title Title of the note String
content Content of the note String
tag Tag of the note Array
date Date when note is saved Date
sourceLink URL where the note is generated from String
id ID of the note ObjectId

MongoDB Installation & Start

  1. Install MongoDB: run commands brew update and brew install mongodb.
  2. First Time Setting Up: run mkdir -p /data/db to create a folder in the default location where the Mongo data files will be stored.
  3. Permission Setting: run sudo chown -R `id -un` /data/db to make sure that the /data/db directory has the right permissions.
  4. Start Database: run mongod in the terminal to start the Mongo daemon, this step starts the Mongo serever.
  5. Exit mongo service:
  • To exit the Mongo shell run quit().
  • To quit the Mongo daemon, press Ctrl + C.

Connect to Server

  1. Go to folder server by cd server/ and run npm install and npm run dev.
  2. Terminal shows successful connection info.

Listening port3002

Environment variablesundefined

mongodb://localhost:27017/microDev sucessfully connected

⚠️ **GitHub.com Fallback** ⚠️