Skip to content

RafsanQ/awe-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Awe Chat

This project is my first attempt at using Golang and Next. It uses web-socket communication between clients and the server to instantly send messages. Has simple token based authentication and users can sign up using an email and password.

Getting Started

Server

Prerequisites

Installation

  1. If you do not have make installed, please install it. For debian based systems, you can simply run the commands below.
sudo apt update
sudo apt install make

For windows, refer to this discussion.

If you still do not wish to install it, refer to server/Makefile and simply run the respective commands listed there.

  1. If you do not have go-migrate installed, install it from here.

  2. Clone the repository and go inside the server directory.

cd server
  1. You will need to setup a PostgreSQL database. We recommend using docker as the Makefile uses docker commands below.
make postgresinit
make createdb

You can also use a standalone PostgreSQL database, however you will need to change the database connection url in the link and run the commands on your own. The Makefile's command postgresinit and createdb shows how to configure a PostgreSQL database on docker.

  1. After setting up the PostgreSQL database, you wll need to setup the database schema. For this you can use the Makefile's command.
make migrateup
  1. The application's backend server should be ready now. To run it simply use
make dev

Client

Prerequisites

  • Node.js
  • A package manager. The app was tested with pnpm

Installation

  1. Install Node.js. Download it from here. We recommend version 22.
  2. Install a package manager. Pnpm can be downloaded by running
npm install -g @pnpm/exe
  1. Install the dependencies using
pnpm install
  1. The app should be ready. Run the following command
pnpm dev

Technical Details

Technologies

The Front-End Client

Back-End Server

  • Go
  • Gin web framework.
  • Gorilla WebSocket to write and read messages from the websocket connection.
  • sqlc to generate type safe interfaces for SQL queries.

Database

The database handles user information and text messages. The diagram below illustrates the design.

alt text

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published