Skip to content
amoreno16003Public

About

Video App

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

Face2Face (United States)

Face2Face allows users to create and join virtual meeting rooms where they can communicate with each other using video, audio and instant messaging.

Face2Face App

Visit Face2Face app website at: Face2Face


Getting Started

1 Fork & Clone this repo to your local computer.

2 pip install packages

pip3 install python-dotenv  
pip3 install psycopg2  
pip3 install agora_token_builder


Languages & Technologies

  • Django
  • Postgres
  • Deployed to Heroku
  • Agora video streaming

WireFrame

WireFrame


User Stories

  • Face2Face allows users to create and join virtual meeting rooms where they can communicate with each other using video, audio and instant messaging. Additional future improvements include features that can give participants the ability to share their screen, share files, and use text chat within the meeting group or privately with others in the meeting.

App Pictures

  • Home Page

home page


  • Login

login


  • Create Chatroom

create chatroom


  • Video Chat Lobby

video chat lobby


  • Video Chat Stream

video chat stream


  • Profile

Profile



API's used

  • Third party API:

Agora Video Streaming

AgoraRTC video chat is a feature of the AgoraRTC platform that allows users to communicate with each other using real-time video. To use AgoraRTC video chat, users need to connect to the Agora server using the AgoraRTC APIs and establish a video call with another user. AgoraRTC video chat supports high-quality video and audio, and uses techniques such as adaptive bitrate and echo cancellation to ###### ensure a smooth and clear communication experience. AgoraRTC video chat can be used in a variety of applications, including conferencing, gaming, education, and more. It can also be customized with additional features such as screen sharing and text messaging.

Models

class Participant(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE)

class Chatroom(models.Model):
    name = models.CharField(max_length=100)
    creator = models.ForeignKey(User, on_delete=models.CASCADE)
    members = models.ManyToManyField(Participant, blank=True)
    
    def __str__(self):
        return self.name
    
class Message(models.Model):
    sender = models.ForeignKey(User, on_delete=models.CASCADE)
    chatroom = models.ForeignKey(Chatroom, on_delete=models.CASCADE)
    text = models.CharField(max_length=300)
    created_at = models.DateTimeField(auto_now_add=True)
    
    def __str__(self):
        return self.text
    
class Video_Chat(models.Model):
    participants = models.ManyToManyField(Participant)
    date = models.DateTimeField(auto_now_add=True)

note: the Video_Chat model is not currently in use.

URL Paths

urlpatterns = [
    path('', views.index, name='index'),
    path('chatroom/create/', views.CreateChatroom, name='createChatroom'),
    path('<str:chatroom>/update/', views.edit_chatroom, name='edit_chatroom'),
    path('<str:chatroom>/delete/', views.delete_chatroom, name='delete_chatroom'),
    path('<str:chatroom>/<str:member>/delete/', views.delete_member, name='delete_member'),
    path('message/<str:chatroom>/create/', views.CreateMessage, name='create_message'),
    path('getMessages/<str:chatroom>/', views.getMessages, name='getMessages'),
    path('user/<username>/', views.profile, name='profile'),
    path('accounts/login/', views.login_view, name='login'),
    path('logout/', views.logout_view, name='logout'),
    path('signup/', views.signup_view, name='signup'),
    path('group/', views.chatroom, name='chat_room'),
    path('about/', views.about, name='about'),
    path('contact/', views.contact, name='contact'),
    path('room/', views.room),
    path('lobby/', views.lobby),
    path('get_token/', views.getToken),
]

Code:

examples from main_app>views.py:

@login_required
def CreateChatroom(request):
    if request.method == 'POST': 
        chatroom = request.POST['chatroom']
        creator = request.user
        if Chatroom.objects.filter(name=chatroom).exists():
            return redirect(f'/message/{chatroom}/create')
        else:
            new_room = Chatroom.objects.create(name=chatroom, creator=creator)
            new_room.save()
            return redirect(f'/message/{chatroom}/create')
    else: 
        all_chatrooms = Chatroom.objects.all()
        return render(request, 'createChatroom.html', {'chatrooms': all_chatrooms})

@login_required
def edit_chatroom(request, chatroom):
    chatroom = Chatroom.objects.get(name=chatroom)
    user = request.user
    members = list(chatroom.members.all())
    all_members = []
    for member in members:
        one_member = User.objects.get(id=member.user_id)
        all_members.append(one_member)
    if user == chatroom.creator and request.method == 'GET':
        return render(request, "edit_chatroom.html", {'chatroom': chatroom, 'members': all_members})
    elif user == chatroom.creator and request.method == 'POST':
        name = request.POST['name']
        chatroom.name = name
        chatroom.save()
        return redirect(f'/message/{name}/create/')
    else: 
        return redirect(f'/message/{chatroom.name}/create')

@login_required
def CreateMessage(request, chatroom):
    user = request.user
    chatroom = list(Chatroom.objects.filter(name=chatroom))[0]
    members = chatroom.members.all()
    # create new message
    if request.method == 'POST': 
        text = request.POST['text']
        new_message = Message.objects.create(sender=user, chatroom=chatroom, text=text)
        new_message.save()
        # check if user_id is already associated with participant instance
        participant_exists = Participant.objects.filter(user_id=user.id)
        # check to see if participant exists and needs to be added to chatroom instance
        if participant_exists and new_message.sender != chatroom.creator and participant_exists != members:
            new_member = Participant.objects.get(user_id=user.id)
            chatroom.members.add(new_member)
            chatroom.save()
            return render(request, 'main_app/message_form.html', {'user': user, 'chatroom': chatroom})
        # check to see if participant needs to be created and added to chatroom instance
        elif new_message.sender != chatroom.creator and new_message.sender != chatroom.members:
            new_member = Participant.objects.create(user=user)
            new_member.save()
            chatroom.members.add(new_member)
            chatroom.save()
            return render(request, 'main_app/message_form.html', {'user': user, 'chatroom': chatroom})
        else:
            return render(request, 'main_app/message_form.html', {'user': user, 'chatroom': chatroom})
    else: 
        return render(request, 'main_app/message_form.html', {'user': user, 'chatroom': chatroom})

Face2Face App

Visit Face2Face app website at: Face2Face


Getting Started

<<<<<<< HEAD

1 Fork & Clone this repo to your local computer.

2 pip install packages

pip3 install python-dotenv  
pip3 install psycopg2  
pip3 install agora_token_builder


Languages & Technologies

  • Django
  • Postgres
  • Deployed to Heroku
  • Agora video streaming

WireFrame

WireFrame


User Stories

  • Face2Face allows users to create and join virtual meeting rooms where they can communicate with each other using video, audio and instant messaging. Additional future improvements include features that can give participants the ability to share their screen, share files, and use text chat within the meeting group or privately with others in the meeting.

App Pictures

  • Home Page

home page


  • Login

login


  • Create Chatroom

create chatroom


  • Video Chat Lobby

video chat lobby


  • Video Chat Stream

video chat stream


  • Profile

Profile



API's used

  • Third party API:

Agora Video Streaming

Models

URL Paths

|url|view| |'' | views.index| |'chatroom/create/'| views.CreateChatroom| |'str:chatroom/update/'| views.edit_chatroom| |'str:chatroom/delete/'| views.delete_chatroom| |'str:chatroom/str:member/delete/'| views.delete_member| |'message/str:chatroom/create/'| views.CreateMessage| |'getMessages/str:chatroom/'| views.getMessages| |'user//'| views.profile| |'accounts/login/'| views.login_view| |'logout/'| views.logout_view| |'signup/'| views.signup_view| |'group/'| views.chatroom| |'about/'| views.about| |'contact/'| views.contact| |'room/'| views.room| |'lobby/'| views.lobby| |'get_token/'| views.getToken|

Code:

0f07f7d (chore: add readme)

Developers

Aiden Jang

Github

Keara Harrington

Github

Calvin Moldenhauer

Github

Alejandro Moreno

Github

Face2Face Future Improvements:

<<<<<<< HEAD
- [ ] make chatrooms private
- [ ] view all live video chats
- [ ] save video chat history to database

=======

  • Mark journeys as complete/expired after the date passes
>>>>>>> 0f07f7d (chore: add readme)

About

Video App

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages