Skip to content

A realtime videochat app for personal trainers and clients! Built with MERN stack, Socket.IO, and PeerJS!

Notifications You must be signed in to change notification settings

ThomasFoydel/fitra

Repository files navigation

FITRA

a screenshot of a landing page for trainers


Description

A realtime videochat app for personal trainers and clients. Built with a MongoDB database, a Node/Express server, and a React user interface. The video chat functionality relies on websocket connections between users and the server which are used to open up a connection over the User Datagram Protocol directly between the users. Once a client has registered, signed in, and purchased a session, they and the trainer they've booked can access a page which is much like a websocket chatroom, except when a user enters it, the socket connection is used to request videostream connection data from other users in the room and send back one's own videostream after getting a response. This connects the trainer and client for encrypted peer-to-peer realtime communication.

Tests are written with Jest and React Testing Library. The front-end state is managed with React Context. Payment relies on a Paypal integration. Facebook and Google one-click login can be used to register/login for clients, though the Google login currently requires turning on third party cookies in browser settings.

The trainer schedule manager is based on a previous project, react-rnd-schedule, which uses a resize and drag-and-drop package called react-rnd to make a weekview schedule with resizable and dragable appointment times.

a diagram of a fullstack application

a tree of api routes


Installation

Download the repo and run

npm run install-all

Also needed is a .env file in the root directory with a MONGO_URI property set to a mongoDB connection string and SECRET property set to whatever you want your secret to be, any long random string will do

To run the project locally use the command

npm run dev

This will start the server at localhost:8000

And the user interface at localhost:3000


Usage

Trainers and clients can make accounts, edit their profiles, chat with other users over websocket connection, and view their schedule. Clients can use paypal to purchase sessions from trainers. Once a session is purchased, it shows up in the schedule of both the trainer and client. Once active, the session displays a link to a connect page which, when visited, creates an encrypted connection directly between the client and trainer via UDP protocol using PeerJS, after checking user authorization and session status

Description
Demo

Trainers and clients can make profiles

authentication flow

Clients can search for trainers by tag or name

a search bar being used to find mma trainers

Clients can purchase sessions from trainers with paypal

paypal purchase flow

Users can connect via UDP for videochat

a videochat connection being opened

Clients can leave reviews after a session is complete

a review being written

Trainers can cancel sessions

a session being cancelled

Trainers can manage their schedule, blocking out times that are unavailable

a schedule app being used

Trainers can change their half-hourly rate and tags

tag and rate settings being changed

Users can edit their profile profile info, profile picture, and cover photo

a profile picture and cover photo being updated

Users can send each other messages over websocket connection

a message being sent to another user

License

license


Questions

Any questions on this or other projects can be directed to thomasjfoydel@gmail.com


More Of My Projects

Thanks for checking this out! Find more of my work on my GitHub