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.
- 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.
- Server is running on port 8000(default). All the logs are send to loki logger in level basis through Loki transport layer.
- Loki Logger is running on port 3100.
- Prometheus is running on port 9090. It pulls metrics data from server every 2 seconds.
- Grafan is running on port 3000. It keeps on pulling metrics and logs from prometheus and loki respectively.
- Frontend:
- React
- TypeScript
- Vite
- Backend:
- Node.js
- JavaScript
- Real-time Communication:
- Socket.io
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
-
Loki
docker run -d --name=loki -p 3100:3100 grafana/loki
-
Grafana
docker run -d -p 3000:3000 --name=grafana grafana/grafana-oss
-
-
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
-
-
- Open your browser and navigate to http://localhost:8000(for production) and to http://localhot:5000(for development).
- Sign up for a new account or log in with an existing one.
- Explore the discover section to add friends.
- Start chatting in real-time!
- To visualize on grafana dashboard, navigate to http://localhost:3000.
- To see prometheus metrics, navigate to http://localhost:9090/metrics and for grafana related things navigate to http://localhost:3100/metrics.
We welcome contributions to PistaGram! To contribute, please follow these steps:
- Fork the repository.
- Create a new branch (git checkout -b feature/YourFeature).
- Make your changes.
- Commit your changes (git commit -m 'Add your feature').
- Push to the branch (git push origin feature/YourFeature).
- Open a pull request.
Thank you to all the contributors who have made this project possible.