Skip to content

Full stack web application for making friends and chatting online with them in real time using sockets

Notifications You must be signed in to change notification settings

Access-Denied-001/PistaGram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

PistaGram is a real-time communication web application that allows users to add friends, chat in real-time, and manage their connections effortlessly. The application is responsive and provides a seamless user experience across different devices. Built with Node.js and JavaScript for the backend and React and TypeScript using Vite for the frontend, PistaGram leverages socket technology to enable real-time interactions.

Features

  • Real-time Communication: Chat with friends and teams in real-time using sockets.
  • User Authentication: Secure signup and login functionalities.
  • Friend Management: Discover and add friends from the discover section.
  • Responsive Design: Enjoy a seamless experience across various devices.

Architecture

  1. Server is running on port 8000(default). All the logs are send to loki logger in level basis through Loki transport layer.
  2. Loki Logger is running on port 3100.
  3. Prometheus is running on port 9090. It pulls metrics data from server every 2 seconds.
  4. Grafan is running on port 3000. It keeps on pulling metrics and logs from prometheus and loki respectively. image

Tech Stack

  • Frontend:
    • React
    • TypeScript
    • Vite
  • Backend:
    • Node.js
    • JavaScript
  • Real-time Communication:
    • Socket.io

Installation

To run PistaGram locally, follow these steps:

  • Prerequisites: Ensure you have the following installed:

    • Node.js (v20.x or higher)
    • npm (v10.x or higher)
    • docker (v26.x or higher)
  • Steps:

    • Clone the repository

      git clone https://github.com/Access-Denied-001/PistaGram.git
      cd PistaGram
      
    • Environment Variables

      PORT=8000 (default)
      ENVIRONMENT=developement or production
      MONGO_DB_USERNAME=<MONGODB_USERNAME>
      MONGO_DB_PASSWORD=<MONOGODB_PASSWORD>
      MONGO_DB_URI=<MONGODB_URI>
      JWT_SECRET_KEY=<JWT_SECRET>
      IP=<PRIVATE_IP_ADDRESS>
      
    • Docker Containers Initialization

      • Prometheus

        cd Prometheus
        

        Open the prometheuse-config.yml and change the targets according to your ip. For example, <YOUR_PRIVATE_IP>:8000

        docker compose up
        

        Output image

      • Loki

        docker run -d --name=loki -p 3100:3100 grafana/loki
        

        Output image

      • Grafana

        docker run -d -p 3000:3000 --name=grafana grafana/grafana-oss
        

        Output image

    • Run the Application

      • Development

        Backend-

        npm install
        cd Backend
        npm run dev
        

        Frontend-

        cd Frontend
        npm install
        npm run dev
        
      • Production

        npm run build
        npm run prod
        

Usage

Contributing

We welcome contributions to PistaGram! To contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/YourFeature).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add your feature').
  5. Push to the branch (git push origin feature/YourFeature).
  6. Open a pull request.

Acknowledgements

Thank you to all the contributors who have made this project possible.