Coder Social home page Coder Social logo

mcctezu_backend's Introduction

MCC TEZU BACKEND

An API for handling GET/POST requests for the MCC TEZU Website

Technologies used

  • Python
  • MongoDB
  • FLASK

Live Server Status

http://mozcctuapi.herokuapp.com/status

Github Steps

Follow the steps for working on this repository strictly :

  1. Fork the repository to your Github account
  2. Copy the link (ends with a .git) of your forked repository
  3. In a folder of your choice in your local machine, run git clone thelinkyoujustcopied.git
  4. cd mcctezu_backend
  5. git remote add upstream https://github.com/adiXcodr/mcctezu_backend.git
  6. When ever you want to push your change, do git add . and git commit -m "did a change" and then do git pull upstream master. Then finally, do git push origin master.
  7. After pushing, go to your forked repository on Github and create a pull request.

Steps to run the application

  1. cd mcctezu_backend

  2. pip install -r requirements.txt (only for the first time) then python app.py

  3. To manipulate/view tables(collections) do python handle_tables.py

  4. Add or Edit the routes and functions in the file run_model.py

Testing the API

  1. Locally, eg: http://localhost:9999/run-model/add_members
  2. With LIVE Heroku Server, eg: https://mcctezu-backend.herokuapp.com/run-model/add_members
  3. Test the API with POSTMAN.

Example for FETCH NOTIFICATIONS :

  • Set the URL TO https://mcctezu-backend.herokuapp.com/run-model/get_members to get all the members.
  • Set the URL TO https://mcctezu-backend.herokuapp.com/run-model/get_members/<_id> to get a member for an ID.

Example Input for add_members and edit members (ALL FIELDS MUST BE SENT):

    { 
        "_id": 1, 
        "name": "Adittya Dey", 
        "dept": "CSE", 
        "linkedin": "somelink", 
        "phone": "somenumber", 
        "email": "someemail", 
        "image": "somelink",
        "interest": "Full Stack"
    }

Example Input for delete members (Send ID):

    { 
        "_id": 1
    }

Example for GET EVENTS :

  • Set the URL TO https://mcctezu-backend.herokuapp.com/run-model/get_events OR https://mcctezu-backend.herokuapp.com/run-model/get_events/ to get all the records.
  • Set the URL TO https://mcctezu-backend.herokuapp.com/run-model/get_events/<event_name> to get record for specified event only.

Example input for ADD EVENTS :

  • Set the URL TO https://mcctezu-backend.herokuapp.com/run-model/add_events INPUT:
    {
        "evt_name":"Codeathon",
        "evt_org":"MCC_TEZU",
        "evt_date":"04/09/2020",
        "evt_time":"3:00pm",
        "evt_venue":"Dean's Building",
        "evt_image":"none"
    }

Example input for UPDATE EVENTS :

  • Set the URL TO https://mcctezu-backend.herokuapp.com/run-model/update_events INPUT:
    {
        "field": {
            "evt_name": "Code Hack"
        },
        "field_update": {
            "evt_org": "MCC_TEZU"
        }
    }

In field attribute give the column name to identify the record to update. In field_update specify the column to be updated and give the new value to it.

Example input for DELETE EVENTS :

  • Set the URL TO https://mcctezu-backend.herokuapp.com/run-model/delete_events INPUT:
    {
    "evt_name":"Codathon"
    }

Specify the column to identify and delete the record.


Example input for ADD NOTIFICATIONS :

  • Set the URL TO https://mcctezu-backend.herokuapp.com/run-model/notifications/add INPUT:
    {
        "_id":3,
        "date":"27/04/2020",
        "title":"Events",
        "notification":"sample text"
    }

Example for FETCH NOTIFICATIONS :

  • Set the URL TO https://mcctezu-backend.herokuapp.com/run-model/notifications/fetch OR https://mcctezu-backend.herokuapp.com/run-model/notifications/fetch/ to get all the records.
  • Set the URL TO https://mcctezu-backend.herokuapp.com/run-model/notifications/fetch/<_id> to get record for specified notification by id.

Example input for UPDATE NOTIFICATIONS :

  • Set the URL TO https://mcctezu-backend.herokuapp.com/run-model/notifications/update to Update Single Record

INPUT:

    {
        
        "_id": 3,
       "title": "NEW TITLE"
        
    }

In field attribute give the column name to identify the record to update. In update specify the column to be updated and give the new value to it.

Example input for DELETE NOTIFICATIONS :

  • Set the URL TO https://mcctezu-backend.herokuapp.com/run-model/notifications/delete_one to Delete Single Record OR Set the URL TO https://mcctezu-backend.herokuapp.com/run-model/notifications/delete_many to Delete More Than One Records INPUT:
    {

        "_id": 3
    
    }

Author

mcctezu_backend's People

Contributors

adixcodr avatar rittikdasgupta avatar aavishkarmishra avatar

Watchers

James Cloos avatar

Forkers

souravg1403

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.