Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
nishi7409 committed Dec 27, 2020
1 parent 2c36683 commit 0cfa118
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
venv/
.env
.env
node_modules
19 changes: 19 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "coursecal",
"version": "1.0.0",
"description": "Automate the process of transferring your semester's calendar from your university's end to your personal calendar (google calendar/outlook calendar/etc)",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/nishi7409/CourseCal.git"
},
"author": "awesome people",
"license": "MIT",
"bugs": {
"url": "https://github.com/nishi7409/CourseCal/issues"
},
"homepage": "https://github.com/nishi7409/CourseCal#readme"
}
8 changes: 5 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Django==2.2.13
git+https://github.com/django-nonrel/mongodb-engine
Django==2.2.13
git+https://github.com/django-nonrel/djangotoolbox
git+https://github.com/django-nonrel/[email protected]
python-dotenv
django-mongodb-engine-py3
google-api-python-client
google-auth-httplib2
google-auth-oauthlib
ics
10 changes: 5 additions & 5 deletions web_app/app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
# Create your models here.
class University(models.Model):
name = models.CharField(max_length=200, null=False, blank=False)
address = models.CharField(max_length=500, null=False, blank=False)
phone_num = models.IntegerField(null=False, blank=False, default="-1")
domain = models.CharField(max_length=20, null=False, blank=False)

class Student(models.Model):
username = models.CharField(max_length=10, null=False, blank=False)
email = models.CharField(max_length=100, null=False, blank=False)
first_name = models.CharField(max_length=100, null=False, blank=False)
last_name = models.CharField(max_length=100, null=False, blank=False)
name = models.CharField(max_length=100, null=False, blank=False)
phone_num = models.IntegerField(null=False, blank=False)
calendar_link = models.ForeignKey("URLCalendar", on_delete=models.CASCADE)

class URLCalendar(models.Model):
calendar = models.CharField(max_length=200, null=False, blank=False)


def saveUni(self):

16 changes: 16 additions & 0 deletions web_app/app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,23 @@
from django.db.models import Q
from django import forms
import json
from ..microservices.googleCal import urlGenerator

# Create your views here.
def index(request):
return render(request, 'index.html', {})

def save_university(request):
if request.method == "POST":
newUni = University(name="Rensselaer Polytechnic Institute", domain="rpi.edu")
newUni.save()
else:
pass

def save_student(request):
if request.method == "POST":
uniqueURL = URLCalendar(calendar=urlGenerator.createURL())
newStud = Student(name="Nishant Srivastava", email="[email protected]", phone_num=5186182796, calendar_link=uniqueURL)
newStud.save()
else:
pass
9 changes: 8 additions & 1 deletion web_app/microservices/cal/script.py
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
pass
import ics

# create events
def createEvents(dict):
pass

if __name__ == '__main__':
pass
1 change: 0 additions & 1 deletion web_app/microservices/google-cal/script.py

This file was deleted.

1 change: 1 addition & 0 deletions web_app/microservices/googleCal/credentials.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"installed":{"client_id":"481612620762-0uao027rlu4ngvteuec5cqvf8k82d9cv.apps.googleusercontent.com","project_id":"coursecal-1609087487843","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"CfjIPkHmHkevkg6cxyulU-SX","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}}
14 changes: 14 additions & 0 deletions web_app/microservices/googleCal/eventEditor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import datetime
import os.path
import json

# verify google calendar link
def verify(link):
pass

# create events in the google calendar
def createEvents(link, dict={}, colors=["black", "red", "blue", "pink", "orange", "purple"]):
pass

if __name__ == '__main__':
pass
7 changes: 7 additions & 0 deletions web_app/microservices/googleCal/urlGenerator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import datetime
import os.path
import json

# verify google calendar link
def createURL():
return("https://www.google.com")
10 changes: 9 additions & 1 deletion web_app/microservices/universities/rpi/script.py
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
pass
# verify login
def login(username, password):
pass

# get events from student's calendar (from university)


def getEvents():
pass
8 changes: 7 additions & 1 deletion web_app/microservices/universities/suny-buffalo/script.py
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
pass
# verify login
def login(username, password):
pass

# get events from student's calendar (from university)
def getEvents():
pass

0 comments on commit 0cfa118

Please sign in to comment.