Skip to content

Fullstack Social Media Platform with secure authentication, real-time messaging, posts with likes/comments/shares, profile customization, and privacy features. Built with Go, React, WebSocket, PostgreSQL, and Docker.

Notifications You must be signed in to change notification settings

MaqsattoTeam/SocialApp

Repository files navigation

🌐 Social Media Platform

A full-stack social media application with real-time messaging, post sharing, and user authentication built with React and Golang.

🌍 Live Website: https://maqsatto.tech/

React Go PostgreSQL


📋 Table of Contents


🎯 Overview

Social Media Platform is a modern, full-featured social networking application that enables users to connect, share, and communicate in real-time. Built with cutting-edge technologies, it provides a seamless experience for creating posts, engaging with content, and messaging friends.

Key Highlights

  • 🚀 Real-time messaging with WebSocket
  • 🔐 Secure authentication with Google OAuth and JWT
  • 📱 Responsive design for all devices
  • ☁️ Cloud-based image storage
  • 🐳 Docker support for easy deployment

✨ Features

📱 Posts & Interactions

  • View, create, like, comment on, and share posts
  • Interactive feed with real-time updates

👤 User Profiles

  • Customize your profile with photo uploads
  • Update account settings and change password

💬 Real-Time Messaging

  • Search for friends and start conversations
  • Instant messaging powered by WebSocket

🔐 Authentication

  • Manual sign up/sign in
  • Google OAuth integration
  • reCAPTCHA protection
  • Password recovery via email verification

📧 Contact Form

  • Submit questions or feedback directly through the platform

🎬 Demo

Video Demos


📸 Screenshots

Home Page

Home Page

About Page

About Feed

Contact Page

Contact Profile

Login & Authentication

Login Page

reCAPTCHA Protection

Recaptcha

Main Feed

Main Feed

User Profile

User Profile

Real-Time Chat

Real-time Chat

Settings

Settings Page Settings Page


🛠️ Tech Stack

Frontend

Technology Purpose
React UI Library
Tailwind CSS Styling Framework
Shadcn UI Component Library
Vite Build Tool

Backend

Technology Purpose
Golang Server Language
Gin Web Framework
WebSocket Real-time Communication
JWT Authentication

Database & Infrastructure

Technology Purpose
PostgreSQL Primary Database
Docker Containerization
Nginx Reverse Proxy

Third-Party Services

Service Purpose
Cloudinary Image Hosting
Mailtrap Email Testing
Gomail Email Delivery
Google OAuth Social Authentication
reCAPTCHA Bot Protection

🏗️ Architecture

SocialApp/
├── client/                 # React frontend
│   ├── src/
│   │   ├── components/    # React components
│   │   ├── pages/         # Page components
│   │   ├── services/      # API services
│   │   └── utils/         # Utility functions
│   ├── .env               # Frontend environment variables
│   └── package.json
│
├── server/                # Golang backend
│   ├── cmd/              # Application entry point
│   ├── internal/         # Internal packages
│   │   ├── handlers/    # HTTP handlers
│   │   ├── models/      # Data models
│   │   ├── services/    # Business logic
│   │   └── middleware/  # Middleware functions
│   ├── .env             # Backend environment variables
│   └── go.mod
│
├── docker-compose.yml    # Docker configuration
└── README.md            # This file

🚀 Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v16.x or higher) - Download
  • npm or yarn - Comes with Node.js
  • Go (v1.19 or higher) - Download
  • PostgreSQL (v13 or higher) - Download
  • Docker Desktop (optional) - Download

Installation

  1. Clone the repository
mkdir folder_name
cd folder_name
git clone https://github.com/MaqsattoTeam/SocialApp
cd SocialApp
  1. Install dependencies

Frontend:

cd client
npm install

Backend:

cd server
go mod download

Configuration

1. Frontend Environment Variables

Create a .env file in the client directory:

VITE_API_URL=http://localhost:8080
VITE_GOOGLE_CLIENT_ID=your_google_client_id
VITE_RECAPTCHA_SITE_KEY=your_recaptcha_site_key

2. Backend Environment Variables

Create a .env file in the server directory:

JWT_SECRET=your_jwt_secret_key
PORT=8080
DSN=your_postgresql_connection_string
CLOUDINARY_URL=your_cloudinary_url
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_REDIRECT_URL=your_google_redirect_url
RECAPTCHA_SECRET_KEY=your_recaptcha_secret_key
MAILTRAP_TOKEN=your_mailtrap_token
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=[email protected]
SMTP_PASSWORD=your_16_character_app_password

3. Database Setup

Create a PostgreSQL database:

CREATE DATABASE socialapp;

The application will automatically run migrations on startup.

Running the Application

Option 1: Manual Setup (Development)

Terminal 1 - Start Frontend:

cd client
npm run dev

Frontend will run on: http://localhost:5173

Terminal 2 - Start Backend:

cd server
air  # Hot reload (recommended)

Or without hot reload:

cd server/cmd
go run main.go

Backend will run on: http://localhost:8080

Option 2: Docker Setup 🐳

If you have Docker Desktop installed:

docker compose pull
docker compose up

This will start:

To stop:

docker compose down

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/AmazingFeature
  3. Commit your changes
    git commit -m 'Add some AmazingFeature'
  4. Push to the branch
    git push origin feature/AmazingFeature
  5. Open a Pull Request

📞 Contact

MaqsattoTeam

For questions or feedback, use the contact form within the application or reach out to the team.


⚠️ Important Notes

Security

  • Never commit .env files to version control
  • Use strong, unique values for JWT_SECRET
  • Enable 2FA for production Google OAuth

Email Setup

  • For Gmail SMTP, generate an App Password
  • Use Mailtrap for development/testing
  • Switch to production SMTP for deployment

Database

  • Ensure PostgreSQL is running before starting the backend
  • Database migrations run automatically on startup
  • Backup your database regularly

⭐ Star this repository if you find it helpful!

Made with ❤️ by ApexTeam

About

Fullstack Social Media Platform with secure authentication, real-time messaging, posts with likes/comments/shares, profile customization, and privacy features. Built with Go, React, WebSocket, PostgreSQL, and Docker.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages