Skip to content

SanjayTml/Hakura

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hakura - Random chatroom

Hakura is a random chatroom where anyone can sign in using google account and chat to strangers.

This project was bootstrapped with Create React App.

Use node to build and run the project.

Firebase

For the backend, Google's Firebase service is used.

Firestore database is used to store the messages.

The following rules are implemented to restrict reading access to chat rooms to only signed in users. Permission to send message is retricted to signed in users using only their user id and when they are not in the banned list.

match /{document=**} {
        allow read, write: if false;
    }
    
    match /messages/{docId} {
    	allow read: if request.auth.uid != null;
        allow create: if canCreateMessage();
    }
    
    function canCreateMessage() {
        let isSignedIn = request.auth.uid != null;
        let isOwner = request.auth.uid == request.resource.data.uid;
      
        let isNotBanned = exists(
      	    /databases/$(database)/documents/banned/$(request.auth.uid)
        ) == false;
      
        return isSignedIn && isOwner && isNotBanned;
    }

About

Hakura is an online chatroom sample

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published