Skip to content

toseef-ahmd/chat-app-backend

Repository files navigation

Chat Application

Description

Chat application developed using Nest framework and TypeScript.

In backend site, we use Mongoose, which is a Node.js-based Object Data Modeling (ODM) library for MongoDB. It is akin to an Object Relational Mapper (ORM) such as SQLAlchemy for traditional SQL databases.

Code Repository

Clone the code from This Repository using the commmand

$ git clone https://github.com/toseef-ahmd/chat-app-backend

Most of the development is in the staging branch.

Installation

After you have cloned the repository, Navigate to chat-app-backend using

$ cd chat-app-backend

Run

$ npm install

This will install the dependencies as defined in Package.json file.

Running the app

As of now, we have only created the Database schema, so you do not need to run the entire application. We have provided a dbdump.js file which you can use to populate data into MongoDB.

In order to create the database and dump data into collections, you need following tools.

  1. MongoDB Client. (Installed when you run npm install)
  2. Docker. (Here)
  3. Docker Compose file. (Provided in the code repository.)
  4. dbdump.js file. (Provided in the root directory of the code repository.)
  5. MonngoDB Compass (Here) or Studio 3T (Here)

Once you are in the root directory of the project, run

$ docker-compose up -d

This will setup a database in the docker container.

Once it is created, run

$ node dbdump.js

Open MongoDB Compass or Studio 3T (Whichever you have downloaded), and create a new connection using following parameters.

  1. Host: localhost
  2. PORT: 27017
  3. DB_NAME: chatapp
  4. username: rootuser
  5. password: rootpass

Here is the connection string that you may use in the connection manager.

$  mongodb://rootuser@localhost:27017/admin

Once you are logged in, you would be able to view the collections and data inside them.

Here is the ER diagrams of the database: alt text

License

Nest is MIT licensed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published