PicProof is a next-generation social media platform designed to combat misinformation by integrating AI-powered image verification. It allows users to share images, follow other users, and engage with content, while providing a trust score for each image to indicate its authenticity.
- User Authentication: Secure user registration and login with email/password and Google OAuth.
- Social Feed: A dynamic feed to view posts from followed users.
- Create & Share: Upload images with captions.
- AI Image Verification: Each uploaded image is analyzed by a deep learning model to detect if it's real or potentially AI-generated/manipulated.
- User Profiles: View user profiles, posts, follower, and following counts.
- Follow System: Follow and unfollow other users to customize your feed.
- Notifications: Receive notifications for new followers and comments on your posts.
- Search: Find and discover other users on the platform.
The project is built with the MERN stack and includes a separate Python server for machine learning inference.
-
Frontend:
- React.js (with Vite)
- Zustand for state management
- React Router for navigation
- Axios for API requests
- Lucide React for icons
-
Backend:
- Node.js & Express.js
- MongoDB with Mongoose for database management
- JWT (JSON Web Tokens) & Passport.js for authentication
- Multer for file uploads
- Google Gemini API for potential generative AI features.
-
AI/ML:
- Python
- Flask as a micro-framework to serve the model
- PyTorch for the deepfake detection model (
discriminator_cnn.pth)
The repository is a monorepo containing three main parts:
.
├── client/ # React frontend application
├── server/ # Node.js/Express backend API
└── model_inference/ # Python/Flask server for AI model inference
client/: Contains all the UI components, pages, and logic for the user-facing application.server/: The core backend that handles business logic, user data, authentication, and interaction with the database.model_inference/: A lightweight Flask server that exposes an endpoint to the main backend for running the image classification model.
Follow these instructions to set up and run the project on your local machine.
- Node.js (v18 or newer recommended)
- Python (v3.8 or newer)
- MongoDB instance (local or a cloud-based one like MongoDB Atlas)
gitfor cloning the repository.
-
Clone the repository:
git clone https://github.com/chayan-mann/PicProof.git cd PicProof -
Set up the Backend Server:
cd server npm installCreate a
.envfile in theserver/directory. This file is crucial for storing sensitive information. Add the following variables:PORT=5000 MONGO_URI=<YOUR_MONGODB_CONNECTION_STRING> JWT_SECRET=<YOUR_JWT_SECRET> JWT_EXPIRE=30d # Google OAuth Credentials GOOGLE_CLIENT_ID=<YOUR_GOOGLE_CLIENT_ID> GOOGLE_CLIENT_SECRET=<YOUR_GOOGLE_CLIENT_SECRET> # URL of the Flask AI Service FLASK_API_URL=http://127.0.0.1:8000/predict
-
Set up the Frontend Client:
cd ../client npm install -
Set up the AI Model Inference Server:
cd ../model_inference pip install -r requirements.txt
You need to run all three parts (backend, frontend, and AI server) concurrently in separate terminal windows.
-
Start the Backend Server:
# In the /server directory npm run devThe server will start on the port defined in your
.envfile (e.g.,http://localhost:5000). -
Start the Frontend Application:
# In the /client directory npm run devThe React development server will start, typically at
http://localhost:5173. -
Start the AI Model Server:
# In the /model_inference directory python inference.pyThe Flask server will start on port
8000.
Once all services are running, you can open your browser and navigate to the frontend URL (e.g., http://localhost:5173) to use the application.
The backend API documentation, including available endpoints, request formats, and responses, can be found in the server/API_DOCS.md file.
This project is licensed under the MIT License.