A full-stack social media application offering a unified platform for sharing images and videos. The project is built using a modern FastAPI backend and a Streamlit frontend, featuring secure user authentication and media management via ImageKit.
- User Authentication: concise and secure signup/login/logout flow using JWT (JSON Web Tokens) backed by
fastapi-users. - Media Upload: Support for image and video uploads with cloud storage integration using ImageKit.io.
- Social Feed: Real-time feed displaying posts from all users with timestamps and owner details.
- Interactive UI: A responsive, clean interface built with Streamlit.
- Database: SQLite with asynchronous SQLAlchemy for efficient data handling.
- Backend: FastAPI, Uvicorn, SQLAlchemy, Pydantic
- Frontend: Streamlit
- Authentication: FastAPI Users
- Storage: ImageKit IO
- Database: SQLite (Async)
-
Clone the repository:
git clone <repository_url> cd <repository_folder>
-
Create and activate a virtual environment:
# Windows python -m venv .venv .venv\Scripts\activate # macOS/Linux python3 -m venv .venv source .venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Environment Configuration: Create a
.envfile in the root directory and add your ImageKit credentials:# ImageKit Credentials IMAGEKIT_PRIVATE_KEY=your_private_key IMAGEKIT_PUBLIC_KEY=your_public_key IMAGEKIT_URL_ENDPOINT=your_url_endpoint # Secret for JWT SECRET=your_jwt_secret_string
Note: Ensure you have
SECRETconfigured for fastapi-users.
Run the FastAPI backend server:
python main.py
# OR
uvicorn app.app:app --reloadThe API will be available at http://localhost:8000. API Docs are at http://localhost:8000/docs.
In a new terminal, run the Streamlit app:
streamlit run frontend.pyThe application will open in your default browser (usually at http://localhost:8501).
MIT