The SocialMediaApp is a web-based social media application that enables users to connect with each other through a variety of features. The application is built with React for the frontend, Node.js for the backend, and MySQL for the database. Users can register, login, upload posts, manage profiles, engage in social interactions, categorize posts, and use an image generator.
- Frontend: React
- Backend: Node.js
- Database: MySQL
- User registration and account creation.
- Login functionality.
- Post creation and upload functionality.
- Display of uploaded posts on the home page.
- Post deletion capability.
- Account information editing for users.
- Profile deletion functionality.
- Like and report features for posts.
- User following functionality.
- Comments can be added to posts.
- Users can categorize posts by adding tags.
- Dedicated tab for image generation.
- Users can input prompts and adjust image size.
- Direct sharing of generated images.
The image generation feature in the SocialMediaApp is powered by the HuggingFace Diffusers library, utilizing advanced safetensor image models. This library enhances the quality and safety of image generation, providing a robust foundation for creating visually appealing and secure images.
The image generation process involves a Python virtual environment (venv) that is dynamically created and managed by the server. The backend server executes a series of steps during the first run to ensure a controlled and isolated environment for image generation:
-
Creation of Virtual Environment (venv):
- The server sends a command to create a virtual environment in the project folder.
- This virtual environment is essential for isolating dependencies and ensuring reproducibility.
-
Activation of Virtual Environment:
- Once created, the server activates the virtual environment, isolating the image generation process.
-
Dependency Installation:
- Dependencies required for image generation are installed into the virtual environment using a
requirements.txt
file. - This step ensures that the necessary Python packages, including the HuggingFace Diffusers library, are available within the isolated environment.
- Dependencies required for image generation are installed into the virtual environment using a
-
Execution of Python Script:
- With the virtual environment activated and dependencies installed, the server runs a Python script responsible for image generation.
- The data required for image generation is passed from the frontend to the backend.
-
Frontend Development:
- React for building the user interface.
-
Backend Development:
- Node.js for server-side development.
-
Database:
- MySQL for storing user and post-related data.
-
Frontend:
- React components for the user interface.
- Routing for different pages and features.
-
Backend:
- Node.js server handling authentication, post management, and social interactions.
- APIs for frontend-backend communication.
-
Database:
- MySQL database for storing user profiles, posts, and related data.
-
Image Generator:
- Module for image generation with adjustable parameters.