Skip to content

a specialized forum where users can make posts, chatting in real-time, create discussions for other users to respond to, and manage their data in a personal profile.

License

Notifications You must be signed in to change notification settings

YuriiDorosh/chess-forum

Repository files navigation


Logo

Chess Forum

Django project: chess forum concept.
Explore Getting Started topic »

Table of Contents
  1. Features
  2. Getting Started
  3. Explanations
  4. License
  5. Contacts

Features

  • Main page with information of the most liked posts and open discussions.
  • Chats section.
  • Page with posts where user can sort posts by date added or most likes.
  • Discussions where users can discus, and if author receives a reply, they can close the discussion.
  • Profiles containing information about the user, including their bio, photo, Telegram ID, chess profile URL, information about whether the user is a subscriber, user's posts, and posts liked by the user and authors can edit their profile and posts.

Technology Stack

Python Django Django Channels PostgreSQL Docker Docker Compose Celery Redis Flower

Getting Started

Run docker compose.

Prerequisites

  • Docker 24.0.6
  1. Clone the repo.

    $ git clone git@github.com:YuriiDorosh/chess-forum.git
  2. Define environment variables

      $ cd chess-forum
      $ nano .env
    SECRET_KEY=my_django_key
    POSTGRES_DB=my_database
    POSTGRES_USER=my_database_user
    POSTGRES_PASSWORD=my_database_password
  3. Build and run docker compose by predefined make command.

    $ make setup

    WARNING!
    If database connection fails, try again in a few seconds. It could be because postress server is not running yet.

Run as python script.

Prerequisites

  • python 3.10
  • pip

Installation

  1. Clone the repo.

    $ git clone git@github.com:YuriiDorosh/chess-forum.git
  2. Activate virtual environment.

    $ cd chess-forum
    $ python3 -m venv venv
    $ source venv/bin/activate
    
  3. Install requirements.

    (venv) $ pip install -r requirements.txt
  4. Define environment variables

      $ nano .env
    SECRET_KEY=my_django_key
    POSTGRES_DB=my_database
    POSTGRES_USER=my_database_user
    POSTGRES_PASSWORD=my_database_password

(back to top)

Explanations

  1. Database Structure. db

    User
    Inheritance of the model from AbstractUser.

    Includes the following information about the user: first name, last name, username, user bio (optional field), user photo (optional field), telegram user id (optional field), link to chess profile (optional field), whether the user is a subscriber to the service (by default False), and the date when the user was registered.

    UserPost
    Model inheritance from BaseModel.

    Includes the following information about the user post: user id, post title, game link(optional field), body of post, and the date when the post was added.

    Like
    Model inheritance from BaseModel.

    Includes the following information: user id, post id, date added.

    UserPostImage
    Model inheritance from Model.

    Includes the following information: post id, image

    Room
    Model inheritance from BaseModel.

    Includes the following information about the room: name, slug, if the room is premium(by default False), and the date when the room was created.

    Message
    Model inheritance from BaseModel.

    Includes the following information: room id, user id, content of the message, and date when user write the message.

    Discussion
    Model inheritance from BaseModel.

    Includes the following information about the discussion: title of the discussion, text, author(user) id, image(optional field), closed(by default False), and the date when discussion was created.

    Reply
    Model inheritance from BaseModel.

    Includes the following information about the reply: discussion id, text, author id, image(optional field), and the date when reply was writing.

    ReplyLike
    Model inheritance from BaseModel.

    Includes the following information about: reply id, user id, date added.

License

This project is licensed under the MIT License. You can find the license details in the LICENSE file. Feel free to use, modify, and distribute the code as per the terms of the MIT License.

Contacts

Yurii Dorosh

Telegram Badge
Gmail Badge

(back to top)

About

a specialized forum where users can make posts, chatting in real-time, create discussions for other users to respond to, and manage their data in a personal profile.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages