Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
05a2c6d
Add Django
zairiel243 Apr 27, 2018
55232be
Add vue to the project
Apr 27, 2018
69dae9b
Add example crud login operation
Apr 27, 2018
da542ce
Change link for login
May 1, 2018
95283e2
Removed materialize
May 1, 2018
08cefe7
Add title
May 1, 2018
e27e242
Add loginform and registerform components
May 2, 2018
8218825
changed directory structure for components
May 4, 2018
d1bee2b
Installed vue-axios
May 4, 2018
c882ea0
Installed vue-axios
May 4, 2018
c6493cd
Installed js-cookies
May 4, 2018
cb7d54a
Remove test view
May 4, 2018
641f9c3
Password field contents hidden
May 4, 2018
2ee9f9b
Fix id problem
zairiel243 May 4, 2018
62ebc7f
Removed assets folder
May 4, 2018
c282d83
Changed filenames for the login and register form components
May 4, 2018
1d2e733
Create request call for login
May 7, 2018
1dcaebf
Create request class to handle api calls to backend
May 7, 2018
287eca7
Changed folder structure for stylesheets and js
May 7, 2018
3324150
Add Post Request for Backend
zairiel243 May 7, 2018
e17989c
Fixed post call error
May 7, 2018
08fdfab
Add Post Request fixing bugs
zairiel243 May 7, 2018
c6add19
Add new header
May 7, 2018
a7c62e9
Authentication for log-in
zairiel243 May 7, 2018
8ccd1b7
Remove unnecessary files
zairiel243 May 7, 2018
12f3d4c
initial commit
gavincanete May 7, 2018
ffa6695
Fix Minor Edits.
zairiel243 May 9, 2018
2ff930e
Refactor code to follow proper conventions
May 9, 2018
5a66315
Merge branch 'feature/login' of github.com:channelfix/eAuction into f…
May 9, 2018
faf2350
Fix axios call
May 9, 2018
377226e
Clean-up code for PR
zairiel243 May 9, 2018
1ea065d
Removed alert
May 9, 2018
ca7f20d
Added callback to post call
May 9, 2018
998e4b8
changing the name from lvs to livestream
gavincanete May 9, 2018
390b5ae
restart database for the livestream
gavincanete May 9, 2018
0b4cbd0
add ajax for requesting video archive and end archive
gavincanete May 9, 2018
6a7cee7
removing ajax due to internal server error
gavincanete May 9, 2018
117d133
Rearranging the format
gavincanete May 9, 2018
e3409e1
Rearranging the format
gavincanete May 9, 2018
45a1623
Changed url for index and api call for login
May 11, 2018
9361b03
Create route to home after successful login
May 11, 2018
fddfd94
Removed console log to display reponse from server
May 11, 2018
08df650
Add assets to gitignore
zairiel243 May 11, 2018
8d4ea6a
Add three app for creating model
gavincanete May 12, 2018
7838e4a
add profile in url pattern
gavincanete May 12, 2018
2aa5090
Adding Tags and User for profile
gavincanete May 12, 2018
621759d
add profile app
gavincanete May 12, 2018
b4833bd
Add Profile.vue inorder to create profile page
gavincanete May 12, 2018
b1a2671
changing the url pattern for profile page to be access
gavincanete May 12, 2018
85fa9b8
additional package for vue
gavincanete May 12, 2018
7ea52c2
restart tags db
gavincanete May 14, 2018
cc2374f
removing userdefined user models
gavincanete May 14, 2018
843596a
remove userdefined user models
gavincanete May 14, 2018
e086bf6
restart profiles db
gavincanete May 14, 2018
0d8eaec
modify user model
gavincanete May 14, 2018
0348daf
modify request_profile
gavincanete May 14, 2018
46e413d
change url
gavincanete May 14, 2018
f6c138a
restart profiles init.py
gavincanete May 14, 2018
0e1826a
removing old data
gavincanete May 14, 2018
24f72a2
Restart database
gavincanete May 15, 2018
51ecd32
Restart Database
gavincanete May 15, 2018
9ea080d
No changes
gavincanete May 15, 2018
1339309
Convert the avatar from CharField to ImageField
gavincanete May 15, 2018
f1c7f45
Converting queryset to dict
gavincanete May 15, 2018
c70c7bc
Retrieving the field and corresponding value
gavincanete May 15, 2018
7ba214b
Add Download folder for uploading images
gavincanete May 15, 2018
dba056c
Created 404 Error page if accessing a page that does not exist
May 16, 2018
443c08a
Injected csrf token
May 16, 2018
f2927a6
Add header and navigation bar
May 16, 2018
5f90cf1
Add cards
May 16, 2018
8b0e905
Restart Database
gavincanete May 16, 2018
764a991
Add MEDIA_ROOT and MEDIA_URL for setting path for uploading and acces…
gavincanete May 16, 2018
d203c94
Add MEDIA_ROOT and MEDIA_URL for setting path for uploading and acces…
gavincanete May 16, 2018
56d4835
Replace STATIC to MEDIA
gavincanete May 16, 2018
9ecdaeb
Set the value on upload_to None
gavincanete May 16, 2018
7079221
Rebuild Database for Profile
gavincanete May 16, 2018
29a4f37
Set the value on upload_to to None
gavincanete May 16, 2018
d734ccc
adding User, Profile and Tags attributes on context dict for passing …
gavincanete May 16, 2018
c7d6050
Retrieving the Avatar picture
gavincanete May 16, 2018
0e313ab
Another instance of anonymous for second User
gavincanete May 16, 2018
afadb74
Ignore it
gavincanete May 16, 2018
0a40034
Resolve conflict
gavincanete May 16, 2018
71107e0
Remove Downloads folder and content in eAuction folder
gavincanete May 16, 2018
dd4873e
No changes
gavincanete May 16, 2018
34fa6d1
Removing the conditional
gavincanete May 17, 2018
51578c5
Add function for uploading image on profile page
gavincanete May 17, 2018
8af1196
No changes
gavincanete May 17, 2018
31e8790
Created a component for app navigation (nested router)
May 18, 2018
6740f3c
Use for loop to render thumbnails
May 18, 2018
c56bafe
Created nested routing for main menu navigation
May 18, 2018
9b654e5
Change route link
May 18, 2018
7eaaef1
Add items with routing in drawer
May 18, 2018
79888bb
Merge remote-tracking branch 'origin/chore/add-gitignore-build' into …
May 18, 2018
af756b4
Merge remote-tracking branch 'origin/development' into feature/home-page
May 18, 2018
98b14e7
Add profile as a navigation option
May 18, 2018
319b3c2
Change direct axios call to using Request.js
May 18, 2018
1fdbb9d
Passed username as prop
May 18, 2018
c71da38
Redirect user to login if not logged in
May 18, 2018
b03ec45
Fixed redirect bug
May 18, 2018
49cc15e
Pass prop to profile page
gavincanete May 18, 2018
1d1199f
allow 127.0.0.1 to host, and add post request both server and profile…
gavincanete May 18, 2018
2607439
add post request
gavincanete May 18, 2018
9942cc4
Add Profile front-end
zairiel243 May 18, 2018
beebce7
Add UI for Profile
zairiel243 May 18, 2018
05e0533
Changing the path for main page
gavincanete May 19, 2018
ea67b86
removing file_name field
gavincanete May 19, 2018
acc55f3
Changing the path for main page
gavincanete May 19, 2018
c85c129
Changing the path
gavincanete May 19, 2018
83bba80
Changing the path for main page
gavincanete May 19, 2018
c1b6ba3
Changing the http request method
gavincanete May 19, 2018
1981c32
renaming the input fileSelector
gavincanete May 19, 2018
90bdb3d
Uncomment the last path
gavincanete May 19, 2018
ac761d8
Rebuild the database for Profile
gavincanete May 19, 2018
48bdf0c
Add Downloads folder
gavincanete May 19, 2018
b59b93a
Conflict resolve
gavincanete May 19, 2018
82d5978
Remove v-avatar tag
gavincanete May 19, 2018
c9b2c81
Add UI and backend
zairiel243 May 20, 2018
33b2874
Add UI and Backend Profile
zairiel243 May 20, 2018
4f07e53
Reactively change toolbar title name every after route change
May 21, 2018
31450a1
Added auction page to route
May 21, 2018
c57cc72
Reactively change toolbar navigation button
May 21, 2018
3d53409
Add ui skeleton
May 21, 2018
0478c4e
Merge branch 'feature/livestream' into feature/auction-page-livestream
zairiel243 May 21, 2018
f92bdad
Merge pull request #17 from channelfix/feature/auction-page-livestream
zairiel243 May 21, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ __pycache__/
*.py[cod]
*$py.class


# Created by https://www.gitignore.io/api/node,python,django

### Django ###
Expand Down Expand Up @@ -44,5 +43,7 @@ local_settings.py
*.hot-update.json
*.hot-update.js

# assets
assets/
assets/

Downloads/

Empty file added app/tags/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions app/tags/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
5 changes: 5 additions & 0 deletions app/tags/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class TagsConfig(AppConfig):
name = 'tags'
23 changes: 23 additions & 0 deletions app/tags/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 2.0.4 on 2018-05-16 05:32

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
('profiles', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='Tags',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=50)),
('profile', models.ManyToManyField(to='profiles.Profile')),
],
),
]
Empty file added app/tags/migrations/__init__.py
Empty file.
18 changes: 18 additions & 0 deletions app/tags/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from django.db import models
from profiles.models import Profile


class Tags(models.Model):
""" Tag Table """

profile = models.ManyToManyField(Profile)

# tag name with a maximum of 50 characters.
name = models.CharField(max_length=50)

def __str__(self):
""" Return tag name """

return self.name

# Create your models here.
3 changes: 3 additions & 0 deletions app/tags/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
3 changes: 3 additions & 0 deletions app/tags/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render

# Create your views here.
9 changes: 8 additions & 1 deletion auction/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['localhost', '127.0.0.1']


# Application definition

INSTALLED_APPS = [
'login',
'profiles',
'app.tags',
'livestream',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
Expand Down Expand Up @@ -61,6 +64,7 @@
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.template.context_processors.media',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
Expand Down Expand Up @@ -120,6 +124,9 @@

STATIC_URL = '/static/'

MEDIA_ROOT = 'Downloads/'
MEDIA_URL = 'Downloads/'

STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'build'),
os.path.join(BASE_DIR, 'assets'),
Expand Down
14 changes: 10 additions & 4 deletions auction/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""

from django.conf import settings
from django.conf.urls import url
from django.contrib import admin
from django.urls import path, include
from django.conf.urls import url
from django.views.generic import TemplateView
from django.conf.urls.static import static
from django.views.generic.base import TemplateView

urlpatterns = [
path('login/', include('login.urls')),
path('livestream/', include('livestream.urls')),
path('admin/', admin.site.urls),
path('login/', include('login.urls')),
path('profile/', include('profiles.urls')),
# path('', TemplateView.as_view(template_name="../templates/index.html"))
url(r'^.*$', TemplateView.as_view(template_name="../templates/index.html"))
]
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
14 changes: 14 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@
<title>eAuction</title>
</head>
<body>

<script type="text/javascript">

window.__INITIAL_STATE__ = {
'isAuthenticated' : false
}

{% if user.is_authenticated %}
window.__INITIAL_STATE__.isAuthenticated = true
{% endif %}

</script>

{% csrf_token %}
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
Expand Down
Empty file added livestream/__init__.py
Empty file.
8 changes: 8 additions & 0 deletions livestream/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.contrib import admin

from .models import Session, Archive

admin.site.register(Session)
admin.site.register(Archive)

# Register your models here.
5 changes: 5 additions & 0 deletions livestream/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class LvsConfig(AppConfig):
name = 'livestream'
28 changes: 28 additions & 0 deletions livestream/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 2.0.4 on 2018-05-09 10:12

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Archive',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('archive_id', models.CharField(max_length=1000)),
],
),
migrations.CreateModel(
name='Session',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('session_id', models.CharField(max_length=1000)),
],
),
]
Empty file.
17 changes: 17 additions & 0 deletions livestream/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from django.db import models

# Stores newly generated session id
class Session(models.Model):
session_id = models.CharField(max_length=1000)

def __str__(self):
return self.session_id

# Stores newly generated arhive id
class Archive(models.Model):
archive_id = models.CharField(max_length=1000)

def __str__(self):
return self.archive_id

# Create your models here.
83 changes: 83 additions & 0 deletions livestream/static/auctioneer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@

// Display the session id and token of the auctioneer
console.log('Session ID: ' + sessionId);
console.log('Token: ' + token);

var session, publisher;
var hasPublish = false;
var xhttp;

if(OT.checkSystemRequirements() == 1){ // Check if this browser supports WebRTC.
console.log('This browser supports WebRTC.');
session = OT.initSession(apiKey, sessionId);

session.connect(token, function(error) { // Check if the client has successfully connected to the session.
if(error)
console.log('Cannot connect to the session.');
else{
console.log('Connected to the session.');

// Create a publisher for exposing the video to other client who is also connected to the same session.
publisher = OT.initPublisher('publisher', {insertMode: "append"});

var btnStart = document.getElementById("1");
var btnStop = document.getElementById("2");

dispatchStartVideo(btnStart);
dispatchEndVideo(btnStop);
}
});
}
else
console.log('This browser does not support WebRTC.');


function dispatchStartVideo(btnStart) {

// Dispatch for start auction
btnStart.addEventListener("click", function() {

if(!hasPublish){
session.publish(publisher);
alert('Starting to publish.');
hasPublish = true;

xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if(this.readyState == 4 && this.status == 200)
console.log(this.responseText); // Display start recording in console.
}

xhttp.open("GET", "/livestream/start_archive/", true); // Request for start archive.
xhttp.send();
}
else
alert('On going streaming.');
});
}

function dispatchEndVideo(btnStop) {

// Dispatch for end auction
btnStop.addEventListener("click", function() {

if(hasPublish){

xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if(this.readyState == 4 && this.status == 200)
console.log(this.responseText); // Display end recording in console.
}

xhttp.open("GET", "/livestream/end_archive/", true); // Request for end archive.
xhttp.send();

publisher.destroy();
alert('End the publish.');
hasPublish = false;
publisher = OT.initPublisher('publisher', {insertMode: "append"});
}
else
alert('No publish has occured.');
});
}
44 changes: 44 additions & 0 deletions livestream/static/bidder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

console.log('Session ID: ' + sessionId);
console.log('Token: ' + token);


var session;
var xhttprequest;

var errorMessage = document.querySelector('h1'); // create a message when the stream is destroyed.
var successMessage = document.querySelector('h2'); // create a message when the stream is created.


if(OT.checkSystemRequirements() == 1){ // Check if this browser supports WebRTC.
console.log('This browser supports WebRTC.');
session = OT.initSession(apiKey, sessionId);

session.connect(token, function(error) { // Check if this client is connected to the session.
if(error)
console.log('Cannot connect to the session.'); // Display Message: client has successfully connected to the session.
else
console.log('Connected to the session'); // Display Message: client has failed connect to the session.
});

session.on("streamCreated", function(event) { // Check if the stream has created in a certain session.

// Accept the exposed video who is connected to the same session.
session.subscribe(event.stream, 'subscriber', {inserMode:'append', width:'50%', height:'50%'});
console.log('Successfully subscribe');
successMessage.textContent = 'Live';
errorMessage.textContent = '';

});


session.on("streamDestroyed", function(event) {

console.log('Failed to subscribe');
successMessage.textContent = '';
errorMessage.textContent = 'No Auction event is available';

});
}
else // Failed to launch the livestream.
console.log('This browser does not support WebRTC.');
3 changes: 3 additions & 0 deletions livestream/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
17 changes: 17 additions & 0 deletions livestream/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from django.urls import path
from . import views
from livestream.views import AuctioneerView, BidderView

app_name = 'livestream'
urlpatterns = [
# Location for main page
path('', views.index, name='home'),
# Location for auctioneer page.
path('auctioneer/', AuctioneerView.as_view(), name='auctioneer'),
# Location for bidder page.
path('bidder/', BidderView.as_view(), name='bidder'),
# Location for start recording the video.
path('start_archive/', views.start_archive, name='start_archive'),
# Location for end recording the video.
path('end_archive/', views.end_archive, name='end_archive'),
]
Loading