GithubHelp home page GithubHelp logo

soncojmk / poppin Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 311.54 MB

What'sPoppin Website

Home Page: http://www.wpoppin.com

License: Other

Python 2.35% CSS 0.67% HTML 74.38% Shell 1.30% JavaScript 3.28% Batchfile 0.05% XSLT 0.60% Makefile 0.16% M4 0.24% C 7.07% PLpgSQL 8.74% SQLPL 0.17% Java 0.53% C++ 0.03% Lex 0.01% Yacc 0.03% Perl 0.37% Perl 6 0.01% Roff 0.03%

poppin's Introduction

What'sPoppin

Getting Started

In local Decelopment change the database settings in settings.py to be

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.sqlite3",
        "NAME": "dev.db",
    }
}

Make sure you are using a virtual environment of some sort (e.g. virtualenv or pyenv).

pip install -r requirements.txt
./manage.py makemigrations (if on a windows system, it's python manage.py)
./manage.py migrate
./manage.py runserver

Repo Hierarchy:

'Post': Event app, contains the main event model and views controlling the website 'account': Account app, contains the extended User model that handles user login/signup 'restapi': REST app, app where all models are converted to rest endpoints with GET/POST/DELETE ... endpoints. All rest endpoints end up here. 'blog': Stories app, 'mysite': main django project file

most of the other apps are external apps that I needed to make changes to. They really don't matter.

API Endpoints
    My Profile Page:
        api/myrecommended --> Recommended people to follow (need to send token with request)
        api/myaccount --> The requesting users account info: email, token ... (need to send token with request)
        api/account/<user_id>/saved --> User's saved events based on their url
        api/account/<user_id>/posted --> User's posted events based on their url
        api/account/<user_id>/followers --> Get a user's followers list
        api/account/<user_id>/following --> Get a user's following list 
        api/account/<user_id>/requesting --> Get a list of users that are requesting to follow the current user (need to send token)
        api/account/<user_id>/requested --> Get a list of users the current user has requested to follow (need to send token with request)
    
    Following a user:
        api/account/<user_id>/follow  (POST) --> Follow a user (need to send token with request)
        api/account/<user_id>/follow (PUT) --> Accept a follow request (need to send token with request)
        api/account/<user_id>/follow (DELETE) --> Delete a follower or a follow request (need to send token with request)
    
    Event Card:
        api/events/<event_id>/save (POST) --> Save an event (need to send token with request)
        api/events/<event_id>/save (DELETE) --> Unsave an event (need to send token with request)
        api/events/<event_id>/people_saving (GET) --> get a list of users saving an event
        
    Personal Event:  (just like normal events) --> just check is  'is_personal' field is true to determine if it's a personal event
       
        
    Notifications:
        api/devices (POST) --> Required Parameters:
                           --> registration_id (integer), active(boolean- should be set to true), type (android, ios, or web)
                           --> (need to send token with request)                   
                        
                    --> Add a user's registration_id to our database. Link a user to a device 
                    -->  Needed in order to allow device specific notifications on events like following, commenting...
                    
   Notification Feed:
       api/notificationfeed (GET) --> (need to send authorization token with request)
                                  --> outputs the actor, recipient, verb, and action_object of the notification
                                  --> Sort of like "Joe (actor) followed (Verb) Jake (recipient) 
                                  --> or "Jake (Actor) saved (verb) Jake's (recipient) event, the roast of time (action_object)
                                  
   Comments API:
       api/events/<event_id>/post_comment/ (POST) --> This is for posting a comment to an event
                                                  --> (need to send authorization token with request)
                                                  --> parameters -> [comment]
                                           (DELETE) --> To delete a comment from an event, grab the 'pk' from the comment object and 
                                                        send it as a parameter with a DELETE request to that particular <event'surl>/post_comment
       api/events/ (GET) --> comments now included in the event object with the comment author's account nested
                                 
  Searching for other users:
      api/accounts?search=<username or first name or last name> (GET) --> This will return a list of accounts that have that keyword
      
  
  

All other API endpoints that don't have any internal/hidden endpoints and are fairly straight forward to use are in the link below --> http://wpoppin.com/api/ (the links are pretty self explanatory)

CURL Commands for testing REST API (You have to have curl installed before hand - simplest way is to use pip)

curl -X POST -H "Content-Type: application/json" -H "Authorization: Token xxxxxxxxxxxxxx" -d '{"key1":"value1", "key2":"value2"}' http://www.wpoppin.com/api/devices/

The 'POST' can change depending on the type of request you want. i.e 'PUT', 'PATCH' ...

Reference https://gist.github.com/subfuzion/08c5d85437d5d4f00e58 for more curl commands

poppin's People

Contributors

soncojmk avatar

Watchers

Alex Patin avatar  avatar

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.