A Quora clone using Django and Vue. This was a hobby project I started a year ago. I've updated it recently and added many features which exist in Quora like questions, answers, comments, follow users, and rating questions and answers.
Learning by creating clones of popular websites is a great way to enhance your programming skills. By replicating the functionality of well-known platforms, you can gain a deeper understanding of the technologies and design patterns they use. This project helped me learn about Django's powerful features and Vue's reactive components, and how to integrate them to build a full-stack application.
| Technology | Description |
|---|---|
| Python | A high-level programming language used for general-purpose programming. |
| Django | A high-level Python web framework that encourages rapid development. |
| Django Rest Framework | A powerful and flexible toolkit for building Web APIs in Django. |
| JavaScript | A programming language commonly used to create interactive effects in web browsers. |
| Vue | A progressive JavaScript framework for building user interfaces. |
| Swagger | A tool for designing, building, and documenting RESTful APIs. |
| Tailwind CSS | A utility-first CSS framework for rapidly building custom user interfaces. |
| Headless UI | A set of completely unstyled, fully accessible UI components for React and Vue. |
- 21st December - Initial release stable version.
- User authentication and authorization using JWT.
- Create, read, update, and delete questions and answers.
- Upvote and downvote answers.
- Follow and unfollow users.
- Search functionality to find questions and answers.
- Responsive design for mobile and desktop views.
- User profile management.
- RESTful API for integration with other services.
- Detailed documentation for API endpoints using Swagger docs.
- Unit and integration tests for critical components.
-
Clone the repository:
git clone https://github.com/yourusername/quora_clone.git cd quora_clone -
Create a virtual environment:
python3 -m venv env source env/bin/activate # On Windows use `env\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Apply the migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
-
Navigate to the frontend directory and install dependencies:
cd client npm install -
Run the frontend development server:
npm run dev
-
Open your browser and go to:
http://127.0.0.1:8000/ # For the Django backend http://localhost:8080/ # For the Vue frontend
To deploy this project using Docker, follow these steps:
-
Install Docker: Make sure you have Docker installed on your machine. You can download it from here.
-
Create a
Dockerfilefor the backend:# Dockerfile FROM python:3.9-slim WORKDIR /app COPY requirements.txt requirements.txt RUN pip install -r requirements.txt COPY . . CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
-
Create a
Dockerfilefor the frontend:# client/Dockerfile FROM node:14 WORKDIR /app COPY package.json package-lock.json ./ RUN npm install COPY . . CMD ["npm", "run", "dev"]
-
Create a
docker-compose.ymlfile:version: '3.8' services: backend: build: . ports: - "8000:8000" volumes: - .:/app depends_on: - db frontend: build: context: ./client ports: - "8080:8080" volumes: - ./client:/app depends_on: - backend db: image: postgres:13 environment: POSTGRES_DB: quora_clone POSTGRES_USER: user POSTGRES_PASSWORD: password volumes: - postgres_data:/var/lib/postgresql/data volumes: postgres_data:
-
Run the Docker containers:
docker-compose up --build
-
Access the application:
- Backend:
http://127.0.0.1:8000/ - Frontend:
http://localhost:8080/
- Backend:
This setup uses Docker to containerize both the backend and frontend of the application, along with a PostgreSQL database. The docker-compose.yml file orchestrates the services, ensuring they are built and run together.
- To run the Celery worker and scheduler (Beat) for the project, open separate terminal windows in the project root directory where manage.py lives and run:
celery -A quora_clone worker --loglevel=info
- Celery Beat (Scheduler / Executor)
celery -A quora_clone beat --loglevel=info
Running both scehduler and worker in a single terminal
celery -A quora_clone worker --beat --loglevel=info
Question detail page, it has all the info associated with a given question.
My Questions page
My Answers page
Profile settings page
Dashboard page
This project is licensed under the MIT License. See the LICENSE file for more details.
We welcome contributions to improve this project! Here are some ways you can contribute:
-
Report Bugs: If you find any bugs, please report them by opening an issue on the GitHub repository.
-
Suggest Features: If you have ideas for new features or improvements, feel free to suggest them by opening an issue.
-
Submit Pull Requests: If you want to contribute code, follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes and push the branch to your fork.
- Open a pull request with a detailed description of your changes.
-
Improve Documentation: Help us improve the documentation by making it more comprehensive and easier to understand.
-
Write Tests: Ensure the codebase remains stable by writing unit and integration tests.
Please make sure to follow the project's code of conduct and contribution guidelines when contributing.
Thank you for your interest in contributing to this project!




