Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

this is the implementation of the Database (TA) class project using NodeJs and MongoDB

Notifications You must be signed in to change notification settings

arg1998/DB_TA_CLASS_PROJECT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Music Library Database

WARNING : this is a WIP and has not been deployed yet

What's this?

This repository is the implementation of the Introduction To Database Systems class project.

What is it made of?

  • NodeJs: JavaScript Runtime Environment
  • MongoDB : One of the best NoSQL (document-based) Databases
  • Mongoose: An Excellent ORM and bridge over NodeJs and MongoDB
  • ExpressJs: Fast and reliable HTTP API server

and lots of beautifully organized code ;-)

Where can i find it?

the data base is hosted on the mLab and the server is on the Heroku. also you can clone this repo and run it on your own.


API Documentation

WARNING: all POST HTTP methods must have their params ( if there is any) in the body as json with application/json header set

Users Routes

  • Get all the available users in the database
    • Url: https://SERVER_URL/user
    • Method: GET
    • params: none
  • get a user by its ID
    • Url: https://SERVER_URL/user/<user_id>
    • Method: GET
    • params:
      • user_id : ID of a particular user

    example :
    https://SERVER_URL/user/5cf2928d207f4965efebbd66

  • register a new user
    • Url: https://SERVER_URL/register/
    • Method: POST
    • body :
      • name: Name of the user
      • username : desired username
      • password: a password (be careful!!! this will save passwords in plain text 😬)
      • email: user's email address
      • date: birth date of the user
        • y: year
        • m : month of the year
        • d: day of the month

    example :
    url : https://SERVER_URL/user/5cf2928d207f4965efebbd66
    POST body:

    {
      "name" : "Farzin",
      "username" : "farzin_2020",
      "password" : "123789456",
      "email" : "farzin@site.com",
      "date" : {
        "y" : 1998,
        "m" : 5, 
        "d" : 16
      }
    }
  • Add friend to a user
    • Url: https://SERVER_URL/add_friend
    • Method: POST
    • body :
      • user_id: id of the user
      • friend_id : ID of the second user which is going to be friend with first user

    example :
    url : https://SERVER_URL/add_friend
    POST body:

    {
      "user_id" : "5cf29b9aa2a016741124405a",
      "friend_id" : "5cf2928d207f4965efebbd66"
    }

About

this is the implementation of the Database (TA) class project using NodeJs and MongoDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published