Giter Site home page Giter Site logo

saakshaat / dequarantine Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 2.0 91.14 MB

A Hack Quarantine (https://discourse.hackquarantine.com/) project for helping people enjoy quarantine through online social events.

License: Creative Commons Zero v1.0 Universal

JavaScript 55.65% HTML 3.87% CSS 1.56% Kotlin 0.12% Swift 0.41% Objective-C 0.04% Dart 38.35%

dequarantine's Introduction

Hello World!

dequarantine's People

Contributors

adilkhan510 avatar cocolin041 avatar germain-l avatar littlezigy avatar mentors4edu avatar saakshaat avatar sahil211999 avatar srinithi95 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dequarantine's Issues

Google Calendar Integration for adding Events to User's GCal

Background

We have a feature in the backend for marking an event attended, when the user sends a GET request to /baseapi/events/markAttended/:eventId. This simply adds the user's userName to the event object's participating field and adds the eventId of the event to the user object's attending field.

When a user marks an event attending, we also need to add this event to the user's GCal.

Implementation

Look into Firebase's GCal integration and try to figure out how we can send the event object to the user's Google Calendar.

These changes will have to be made within the markAttended() function. Perhaps create a helper function and pass the event object to the helper function for interfacing the GCal API.

Google Signin using Firebase

I could not figure out how to implement Google Signin in our backend API.

User signup and login happens here and this is where the Google Sign In happens.

So far, this is what I've implemented
exports.googleSignin = (req, res) => { firebase .auth().signInWithPopup(provider) .then((result) => { // This gives you a Google Access Token. You can use it to access the Google API. var token = result.credential.accessToken; // The signed-in user info. var user = result.user; // console.log(user); //TODO: maybe try using login() and pass the user object? return res.status(201).json({ token }); }) .catch(console.error("Well, F")) };

But throws an unexpected error when I send a POST request using POSTMAN to test the API.

I found this in the official documentation but couldn't find anything useful.

Can someone help me implement this?

Getting all Participants

We have deployed a function for marking an event attending in the Events file.

It updates the array fields in the users and events firestore collections:

users

It pushes the eventId into the attending array of the users object

events

It pushes the userName of the attending user into the participants array field in the events object
We need to implement a getParticipants() function in the user file.

Implementation

This function should return all the user objects that have the same userName as the participants array of that events object.

Needless to say, user authentication is required.

Figure out how to do start/end date/time and what formats

We need to figure out what time format to use,

I was thinking about converting every times entered into UTC time and store that in the backend, then the frontend would receive that and convert it in local timezone

In flutter i have a DateTime object available that's pretty simple to use, and the capability of doing what i described above

I don't know about react but i'm assuming this is doable as well.

What do we think?

No Cap Implemented on Event markAttended

The markAttended() updates the relevant states in both the events and users collections and also increments the number of attending users.

But it does not check if the number of attending people is already at cap.

We need to implement a check for the event cap and number of attendees and return an exception/relevant response so that the Frontend can prevent more people from attending the event.

Dark/Light mode

Responsive theme to device theme (mobile) or toggle theme on web

Get One Event

There should be backend function for getting the details of a single event, given the eventId.

Get all Attending Events

We have deployed a function for marking an event attending in the Events file.

It updates the array fields in the users and events firestore collections:

  • users: it pushes the eventId into the attending array of the users object
  • events: it pushes the userName of the attending user into the participants array field in the events object

We need to implement a getAttending() function in the user file.

This function should return all the events objects which are in that user's attending array.

Needless to say, user authentication is required.

Add More Sections

@Germain-L 's Flutter test app is the basic idea of how we're planning on developing the frontend.

So far, we have a basic application where the main window/page has a gridview of cards with the event details. We want to organize our application so that the user can filter the events and only see cards for a certain criteria.

We need to add more sections or tabs. When the user swipes to or selects a particular section, they should only see event cards for that.

The backend team will create filters in the API so that the frontend team needs to simply interface it as usual when the user turns to that section.

Sections

Consider adding the following sections (or tabs):

  • Attending

    Any event that the user considers attending, they mark it as attending. These events end up in the attending section for that particular user account.

    The backend team could also consider adding push notifications for whenever an 'attending' event is due. @sahil211999 we can think about how we want to implement this.

  • Attended Events

    All the past events that a user has attended.

  • Weekly Schedule

    This is the main window/page where the user can see all the events (basis their preference) occurring throughout the week.

  • Categories

    This section has cards/sub-sections for all the different categories of events. Once the user selects a particular category, they only see cards tagged with that category.

    Categories could be anything from Online Meetup to Watchparties to Online Classes.

  • User Account

    One of the most important sections.

    This is where the user can access all their account information. Any basic app template would work here.

Sign up invalid email, returned error could use a change

When user signs up with email and the emails sent to \signup aren't valid, the response is:

  • {"email": "Must be valid"}

I use the value as error to display in the app, could it be possible to change it to:

  • {"email": "Email must be valid"}

this would follow the same idea that when passwords don't match it returns:

  • {"confirmPassword": "Passwords must match"}

which i use the value of when display the error

Getting all Events within a certain category

We need all the events that fall within a certain category.

It shouldn't be that difficult; a simple traversal through the Firestore events collection and returning all the events where the category field matches the given category.

Separate Event Creation from main user UI

Putting the Host features on a separate web interface might help ensure the quality of events.

Also hosts are mostly on computers with fixed cameras, not going to be holding phones.

Events API

In order to get the events from whatever resources, we need to use an API.
Research if there are any existing APIs for getting events from Facebook (or other sources). See if Facebook has any such APIs.

If they do not, we might have to build one from scratch.

Document all your research as comments in this issue.

Time Left/Elapsed for an event

Our events objects have a time associated with them which represents the time (and date of the event). We need to implement a backend feature that can calculate the amount of time left/elapsed for a certain event.

Implementation

There are 2 ways we can implement this; one's simpler and the one's more functional:

Compare current time and given time on every GET request

We could modify the functions, handling GET requests, to calculate the difference between the event's time and current system's time. The functions would simply return the difference.

Here are some issues with this approach:

  • If the user does not refresh the page, no requests are sent to the API and hence the time left is not refreshed either. This is bad because our platform cannot reflect real time differences.

  • This difference might be shaky basis timezones. If the event organizer created the event in a different timezone and the user sent the request in a different timezone, the difference would be inconsistent.

Real Time Synchronus Time Updating

We could figure out a way to design a clock (or a function serving the same purpose) in the backend which could constantly keep a track of the time left for any event. This would also settle any timezone issues that might surface from the first approach.

Automatically fill backup rooms?

I see a maximum "number of attendees" on the event creation form... Would it be possible to allow the organizer to provide multiple Zoom conference links, then if the room max is met for the first meeting, the link in the app with automatically change to the second/third/fourth meeting?

Add a live event feature

Have a tab displaying currently live events and available to join, this would be a great feature for someone bored.

Could be done by displaying current events, with start and elapsed time

Firebase Database Modelling

We need to think about how we want to model our database on Firebase.

The frontend team needs to list what components they want the application to have in terms of the data they pull from the Firebase DB or interface from the APIs.

The backend team needs to decide how to model those requirements, given the cost and constraints of the read and write operations in Google Firebase.

List down your inputs in the comments.

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.