An API for a social network web application where users can share their thoughts, react to friendsβ thoughts, and create a friend list.
- Description
- Screenshot
- Installation
- Usage
- Video Walk Through
- Technology
- Features
- Credits
- License
- Contribution Guidelines
- Feedback
- Socials
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.
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
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
In order to install this social-network API please follow these steps:
-
Ensure that you have node and npm installed
-
For detailed instructions on installing node please follow this link for instructions
-
Ensure that you have MongoDB installed
-
Download MongoDB Compass Further note you can decide to install MongoDB Compass to better visualize your data.
-
Sign-up to MongoDB Atlas to host your DB.
-
Clone this repository into your local repository.
git clone git@github.com:TheInfamousGrim/NoSQL-Social-Network-API.git
.
-
Install the dependencies
npm install
-
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 π
Please follow these steps to use the application
-
Seed the db.
npm run seed
-
Run the following script from your terminal
npm run start
The technology used for the development of this app was:
- 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
π Made with the help of:
I'm open to have anyone jump in and contribute just message me on twitter
Please follow the contribution guidelines! Guidelines for contributing
Any feedback please email George Fincher
GitHub: TheInfamousGrim