/NoSQL-Social-Network-API

A scoial network API where users can share there thoughts and feelings

Primary LanguageJavaScriptMIT LicenseMIT

NoSQL-Social-Network-API

An API for a social network web application where users can share their thoughts, react to friends’ thoughts, and create a friend list.

Contributor Covenant Last Commit to Current Repo Commits a month

Table of Contents πŸ“ƒ

  1. Description
  2. Screenshot
  3. Installation
  4. Usage
  5. Video Walk Through
  6. Technology
  7. Features
  8. Credits
  9. License
  10. Contribution Guidelines
  11. Feedback
  12. Socials

Description

I went about creating this application using Express.js for routing and as a general purpose backend framework. More importantly this is the first project that I'm using MongoDB on as non-relational database.

The main aims that I sought to accomplish by creating this application are as follows:

  • To create a basic API that can accept HTTP requests to perform CRUD operations on a social media style network.
  • An API that can GET data (user data, thought data and reaction data) from the db and present it as JSON
  • An API that uses POST, PUT (update) and DELETE HTTP methods and routes to manipulate the data on the db.
  • POST and DELETE routes can successfully create and delete reactions to thoughts, as well as add and remove friends.

User Story πŸ‘€

AS A social media startup I WANT an API for my social network that uses a NoSQL database SO THAT my website can handle large amounts of unstructured data

What did I Learn 🏫

Learned a tonne doing this project. Specifically the differences between a relational and non-relational database as well as when and where to use either one. Personally for a social media application I'd prefer to have aspects of the app to have well defined relations (joins). However for this almost blog like network, MongoDB is absolutely fine; especially considering the fact that it's way quicker to build out schemas and scale up horizontally.

Other things I learned:

  • Difference between ORM and ODM (structured vs less unstructured schemas)
  • Learned how to use faker.js to create fake data
  • Cemented knowledge of using environment variables
  • Used Day.js to format dates
  • Further practiced building REST APIs
  • Learned how to better use Mongo Atlas, Mongo Compass and broadened my knowledge of the mongo ecosystem

Screenshots

Team Profile Rendered Output Screenshot

Installation

In order to install this social-network API please follow these steps:

  1. Ensure that you have node and npm installed

  2. Ensure that you have MongoDB installed

  3. Clone this repository into your local repository.

    • git clone git@github.com:TheInfamousGrim/NoSQL-Social-Network-API.git.
  4. Install the dependencies

    • npm install
  5. Determine whether you want to host your db locally or by using a service such as MongoDB Atlas.

    • Make a copy of your variables.env.example and rename it to variables.env and adjust you variables so that they match up with the port you want the application to run on and the URI for where you with to host the db.

If you've followed these steps correctly then the application should be good to go and can be tested using software like Insomnia Core 😁

Usage

Please follow these steps to use the application

  1. Seed the db.

    • npm run seed
  2. Run the following script from your terminal

    • npm run start

Video Walk Through

Video Link

Technology

The technology used for the development of this app was:

JavaScript

NodeJS

MongoDB

Mongoose

faker.js

dotenv

day.js

Features

  • Uses express.js to create and run a server
  • Use REST API structure to manipulate data
  • Allows user to create, update, get and manipulate user data such as a friend list or users thoughts and reactions

Credits

πŸ™ Made with the help of:

License

License: MIT

MIT License

Contribution Guidelines

I'm open to have anyone jump in and contribute just message me on twitter

Please follow the contribution guidelines! Guidelines for contributing

Feedback

Ask Me Anything Gmail

TheInfamousGrim

Any feedback please email George Fincher

Socials

GitHub: TheInfamousGrim

LinkedIn

Twitter