A full-stack Facebook clone / social media application built with Django and React.
SocialMediaDjangoReact is a social media application that leverages the power of Django for backend development and React for frontend development. This project aims to provide a platform for users to connect, share content, and engage with each other.
- User Authentication (Signup, Login, Logout)
- User Profiles
- User Follow Feature
- Posts (Create, Read, Update, Delete)
- Comments on posts
- Like functionality for posts and comments
- Realtime Websocket Notifications on new comments & follows & likes
- Responsive design
- Backend: Django
- Frontend: React
- Database: SQLite (default, can be configured to use PostgreSQL or MySQL)
- Others: Django REST Framework, Axios, Channels
- Python 3.x
- Node.js and npm
- REDIS
-
Clone the repository:
git clone https://github.com/ardaaltinors/SocialMediaDjangoReact.git cd SocialMediaDjangoReact
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the backend dependencies:
pip install -r requirements.txt
-
Apply the migrations:
python manage.py migrate
-
Start Redis service (for WebSocket notifications):
brew services start redis #On MacOS
-
Run the development server:
python manage.py runserver
-
Navigate to the
frontend
directory:cd frontend
-
Install the frontend dependencies:
npm install
-
Start the React development server:
npm run dev
Once both the backend and frontend servers are running, you can access the application at http://localhost:5173
for the frontend and http://localhost:8000
for the backend API.
To simplify the development setup, you can use Docker and Docker Compose.
To start the application using Docker Compose, follow these steps:
- Ensure Docker and Docker Compose are installed on your system.
- Navigate to the project root directory where the docker-compose.yml file is located.
- Run the following command to build and start the containers:
docker-compose up --build
- Access the frontend at
http://localhost
and the backend API athttp://localhost:8000
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature-branch
) - Commit your changes (
git commit -m 'Add new feature'
) - Push to the branch (
git push main feature-branch
) - Create a pull request
This project is licensed under the MIT License.