https://github.com/madhvi-n/django-reddit
A feature-rich Reddit clone built using Django for the backend and Angular for the frontend. This project allows users to create, interact, and engage in discussions within communities.
https://github.com/madhvi-n/django-reddit
angular10 django django-ci django-reddit djangorestframework python reddit-clone
Last synced: 3 months ago
JSON representation
A feature-rich Reddit clone built using Django for the backend and Angular for the frontend. This project allows users to create, interact, and engage in discussions within communities.
- Host: GitHub
- URL: https://github.com/madhvi-n/django-reddit
- Owner: madhvi-n
- Created: 2022-09-05T16:03:51.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-22T15:20:04.000Z (4 months ago)
- Last Synced: 2025-03-20T14:40:43.358Z (4 months ago)
- Topics: angular10, django, django-ci, django-reddit, djangorestframework, python, reddit-clone
- Language: Python
- Homepage:
- Size: 1.99 MB
- Stars: 29
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# Django Reddit
[](https://github.com/madhvi-n/django-reddit/actions/workflows/django.yml)
[](https://github.com/madhvi-n/django-reddit/actions/workflows/github-code-scanning/codeql)
[](https://www.python.org/)
[](https://www.djangoproject.com/)
[](https://www.django-rest-framework.org/)
[](https://angular.io/)A **feature-rich Reddit clone** built using **Django** for the backend and **Angular** for the frontend. This project allows users to create, interact, and engage in discussions within communities.
## 🚀 Features
- **User Authentication**: Sign up, log in, and manage accounts securely.
- **Create & Interact with Posts**: Standalone and group-based posts with threaded discussions.
- **Community Features**: Users can create and join groups (public, private, or restricted).
- **Engagement Mechanisms**: Upvote/downvote system for posts and comments.
- **Social Interaction**: Follow users and posts.
- **Content Moderation**: Report inappropriate content.
- **Bookmarks & Saves**: Users can save their favorite posts.
- **Invites & Membership Requests**: Manage group access through invites and requests.## 📸 Screenshots




## 🔧 Requirements
### Backend
- Python 3.8+
- virtualenv
- WSL (Windows Subsystem for Linux)### Frontend
- Angular 10.2.4 (or 10.2.5)
- Node 10.13.x+## ⚙️ Installation
### Backend Setup
1. Clone the repository and navigate to the project directory:
```bash
git clone https://github.com/madhvi-n/django-reddit.git
cd django-reddit
```2. Create and activate a virtual environment:
```bash
virtualenv venv
source venv/bin/activate # For macOS/Linux
venv\Scripts\activate # For Windows
```3. Install dependencies:
```bash
pip install -r requirements.txt
```4. Set the **Django Secret Key**:
- Edit `reddit_clone/settings.py` and manually set a secret key.
- Or, export `SECRET_KEY` in your environment variables.5. Apply database migrations:
```bash
python manage.py migrate
```6. Run the development server:
```bash
python manage.py runserver
```Visit **`http://127.0.0.1:8000/`** to access the app.
### 🌐 Frontend Setup
1. Navigate to the frontend directory:
```bash
cd static/frontend/reddit-app
```2. Install Angular dependencies:
```bash
npm install
```3. Run the frontend development server:
```bash
ng serve
```Visit **`http://127.0.0.1:4200/`** to access the frontend.
## 📝 API Documentation
The API documentation is available via **Swagger**:
- **Swagger UI:** `http://127.0.0.1:8000/api/swagger/`
- **Redoc:** `http://127.0.0.1:8000/api/redoc/`## ⚙️ Environment Variables
Create a `.env` file to store sensitive configuration details:
```ini
SECRET_KEY=your_secret_key
DEBUG=True
DATABASE_NAME=my_db
DATABASE_USER=my_username
DATABASE_PASSWORD=my_db_password
DATABASE_HOST=localhost
DATABASE_PORT=5432
```## 📈 Management Commands
### Generate Data in Django Shell
```python
from django.contrib.auth.models import User
from posts.models import Post
from groups.models import Groupuser = User.objects.get(id=1)
post = Post.objects.create(title="Sample Post", content="Post content here", author=user)
group = Group.objects.create(name="Django", description="Official Django community on Django Reddit")
```### Populate Dummy Data
```bash
python manage.py populate_users
python manage.py populate_posts
python manage.py populate_tags
python manage.py populate_groups
```## 💡 Notes
- **Backend (Django) runs on WSL**
- **Frontend (Angular) runs directly on Windows**## 📐 References
- [How to Install Python 3.8 on Ubuntu 18.04](https://linuxize.com/post/how-to-install-python-3-8-on-ubuntu-18-04/)
- [Installing Node.js on Windows](https://www.guru99.com/download-install-node-js.html)
- [Official Angular 10 Installation Guide](https://v10.angular.io/guide/setup-local)
- [Installing a Specific Version of Angular CLI](https://stackoverflow.com/questions/44759621/install-specific-version-of-ng-cli)
- [Angular, Angular CLI, and Node.js Compatibility](https://stackoverflow.com/questions/60248452/is-there-a-compatibility-list-for-angular-angular-cli-and-node-js)### 🎉 **Happy Coding!** 🚀