Skip to content

Backend repository of Communicator project (one-to-one messaging app)

License

Notifications You must be signed in to change notification settings

GeekoIsaGeek/communicator-back

Repository files navigation

Communicator - back

Backend app for REST API and WebSocket that serves a real-time one-to-one messaging application.

Table of Contents

Prerequisites

Tech Stack

  • Typescript - strongly typed programming language
  • Node.js - JS runtime enviroment
  • Express.js - Node.js web application framework
  • Mongo - cross-platform document-oriented database
  • Mongoose - schema-based ODM to model application data
  • Socket.io - event-driven library for real-time web applications

Getting Started

1. First of all you need to clone the repository from github:

https://github.com/GeekoIsaGeek/communicator-back

2. Next step requires you to run npm install in order to install all dependencies.

npm install

3. Now we need to set our env file. Go to the root of your project and execute this command.

cp .env.example .env

And now you should provide .env file all the necessary environment variables:

PORT=

DB_URI=

TOKEN_SECRET=

CLIENT_APP_URL=

Development

You can run development server by executing:

  npm run serve

Project Structure

├─── readme
├─── src
│   ├─── config
│   ├─── controllers
│   ├─── middleware
│   ├─── models
│   ├─── routes
│   ├─── socket-handlers
│   ├─── types
│   - server.ts
├─── storage
- .env
- package.json
- README.md
- tsconfig.js

API Endpoints

Every listed endpoint is protected from unauthorized access (except ones for authentication). In the context of this application, "connections" are users with whom an authorized user has ever had a chat.

GET

Authenticated user /user
Registered Users /users
Chat messages /messages requires query params: sender, receiver
Connected users /connections

POST

Login /login
Registration /register
Remove user from connections /connections/remove requires connectionId

DELETE

Remove all messages from chat /messages/remove requires query params: sender, receiver

About

Backend repository of Communicator project (one-to-one messaging app)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published