Skip to content

Binh2/chat-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chat-app - My chat website for people to chat

Table of contents

Overview

Motivation

  • As a front-end dev, this project is a really good way to learn Firebase and ReactJS.
  • Another reason is that I want to make a practical project.

Screenshot

Desktop screenshot:

Links

My process

Built with

  • HTML
  • CSS
  • Typescript
  • ReactJS + NextJS
  • Firebase (version 9 - modular)

What I learned

// Firebase: Subscribe to a collection
const userCollectionRef = collection(getFirestore(), "users");
unsubscribeFunction = onSnapshot(query(userCollectionRef, where("id", "==", searchText), 
  orderBy("id"),
  limit(number_of_user)).withConverter(userTypeConverter), handleSnapshot
);

Continued development

If I were to continue working on this project, I would try to:

  • Add an ability to block people.
  • See the newest message from a friend or group.
  • Order friends and groups by the newest message's date.
  • A better way to connect to other people
  • Offline cache.

Useful resources

  • ReactJS - This helped me with basic concepts like custom hooks, context, and using hooks,...
  • NextJS - This help me with basic layout of the project; basic NextJS elements like <Image>, <Head>;...
  • Firebase - This helped me learn Firebase v9 and migrate Firebase v8 to v9 because most of the tutorial on Firebase is outdated.
  • Firebase authentication in NextJS - This helped me a lot because I was stuck and don't know how to fix an error "auth user is null when got redirect". Turn out I just need to put the initializeApp from firebaseApp at the _app.tsx file

Run my source code locally

Clone my project to your local machine

git clone https://github.com/Binh2/chat-app.git

Project setup (Download JS dependencies)

yarn install or yarn

Compiles and hot-reloads for development

yarn dev

Author

My recent works

My portfolio

A blog template

Multi-step form

Acknowledgments

About

A simple chat app written in NextJS

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •