Skip to content

A back-end social media API created using MongoDB, Mongoose ODM, & Express.js with JSON data storage and retrieval demonstrated using Insomnia

Notifications You must be signed in to change notification settings

ScottsC0de/social-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

social-api

A working social media api created using VSCode, MongoDB, Mongoose ODM, & Express.js with JSON data storage and retrieval demonstrated using Insomnia

github mascot with daft punk helmet on

💡 Table of Contents

Description

This project was created to utilize MongoDB and Mongoose ODM to create, read, update, & delete (manange) a social media apps database using a 'Social Media API' created from scratch. Mongoose is a JavaScript object modeler that handles JavaScript code & MongoDB/NoSQL data inside of applications. NoSQL means the data is unorganized and unrelated. It is the polar opposite of a relational database that uses SQL. Using these back-end technologies that are geared toward handling a social media apps data, we can take in an infinite amount of random users (who have thoughts, friends, and reactions) that need to be tracked & stored but in no structured way. In this case, however, we will only be using a couple of users to demonstrate how they are created, accessed & changed. Using Express.js & Insomnia, the routing and navigation of such a database is visually demonstrated. Please refer to the video link directly below

Full visual demonstration: https://youtu.be/_9QMaGcVVWM

New Tech Learned

- MongoDB
- Mongoose ODM
- Unrelational database structuring 
- Routing MongoDB with Insomnia

Installation

To use this application, you must download Node.js onto your local machine. Please visit https://nodejs.org/en/ to install

You will also need:

Usage

With node installed, you can now run node commands on JavaScript files. To use this app, first, we must initialize the database by typing mongod in our terminal. Then, open VSCode or the CLI. To use proceed using the app, you must be in its file from the CLI or an app that allows you to run CLI commands. For this app we used VSCode’s Integrated Terminal. If you are using VSCode, right click on the server.js file and click ‘Open In Integrated Terminal’. Run a node server.js command to fire up our server. You should receive a console log message saying our server is listening. This means we can now access our Mongo database

Head over to Insomnia and follow the proper routing methods in this video to create, read, update, and delete the data used in our social network app

Insomnia Methods

Create data using post()
Read data using get()
Update data using put()
Delete data using delete()

All specific routes available in code & in video demonstration

Screenshots

MVC structure/code for a social media API

Initiating MongoDB in the terminal

Testing routes in Insomnia

Links

The author is a developer with a GitHub account: https://github.com/ScottsC0de & email: Scott5902@gmail.com

YouTube video demonstration: https://youtu.be/_9QMaGcVVWM
GitHub project repo: https://github.com/ScottsC0de/social-api

About

A back-end social media API created using MongoDB, Mongoose ODM, & Express.js with JSON data storage and retrieval demonstrated using Insomnia

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published