GoChat is a real-time messaging application built with Go, React, PostgreSQL, and WebSockets. It allows users to register, log in, and chat with each other in a seamless and scalable environment.
The motivation for this project is to learn more about creating APIs in Go, practice cybersecurity implementations, and explore data visualization in the context of social media. I thought it would be really cool to map out peoples' connections as a web. I think the resulting map will show new mutual connections and sub-communities which is really fascinating.
- User Authentication: Secure login and registration system using session-based authentication.
- Real-Time Messaging: WebSockets enable real-time text messaging between users.
- PostgreSQL Database: Stores user data and chat history.
- Responsive UI: Built with React for a clean and intuitive messaging experience.
- Scalability: Designed to be hosted on AWS for production deployment.
- Backend: Go (
net/http
,gorilla/websocket
,gorm
) - Frontend: React (
Vite
,TypeScript
) - Database: PostgreSQL
- Authentication: Session-based auth (cookies)
- Deployment: Docker + AWS
To run GoChat locally:
- Install Go and PostgreSQL.
- Clone the repository and navigate to the backend directory.
- Set up a
.env
file with database credentials. - Run the Go server using the
go run
command.
- Navigate to the frontend directory.
- Install dependencies using
npm install
. - Start the React app using
npm run dev
.
Alternatively, you can run docker-compose up --build -d
to run all the existing containers in the background.
It is worth mentioning that there is additional setup that I will have to add here later once I have found a more universal way of sharing the configuration details.
The project is in active development, focusing on:
- Optimizing WebSocket connections for better performance.
- Improving UI/UX for a smoother chat experience.
- Enhancing authentication with better session handling.
- Session-based Authentication: Users log in via sessions, stored in secure cookies.
- WebSocket Communication: Handles live chat updates and message delivery.
- User Management: Allows account creation, login, and profile updates.
- Group Chats & Channels: Support for multi-user conversations.
- File Sharing: Send images, videos, and documents.
- Notifications: Real-time updates for new messages and friend requests.
- Cloud Deployment: AWS hosting for scalability.
Contributions are welcome! If you'd like to improve GoChat, follow these steps:
- Fork the repository.
- Create a feature branch (
feature-new-idea
). - Commit and push your changes.
- Open a pull request with a description of your update.