Coders-HQ / CodersHQ

Social platform for developers to network, create and challenge themselves
https://codershq.ae
MIT License
135 stars 46 forks source link
competitive-programming-contests django docker hackathon hacktoberfest profile social-platform
Coders(hq) logo # Coders Headquarters

Cookiecutter Django Badge MIT License Badge Discord Server Badge

Index

Coders Headquarters (CodersHQ) is a social platform for developers to grow, network, challenge themselves, and gain points by contributing and helping others in this community. This platform was built by the community and for the community. The essence of CodersHq is to inspire everyone to learn to code, share knowledge and learn together.

Currently the platform is at the alpha stage with a lot of the foundations being set. It is built using django and deployed using docker.

📄 The Docs

Have a look at the docs, we document everything over there. We plan to migrate from the docs to something more established, like readthedocs, once we have enough material to work with.

We also document the tasks in Notion and you can have a look at the issues section to find out what we are working on.

[Back To Top ↥](#coders-headquarters)

⚙️ Quick Setup

Make sure you have Docker version 2+ and then do the following to build the stack and update the databse :

$ docker-compose -f local.yml build
$ docker-compose -f local.yml run --rm django python manage.py makemigrations
$ docker-compose -f local.yml run --rm django python manage.py migrate
$ docker-compose -f local.yml run --rm django python manage.py createsuperuser

Follow the rest of the README for more information and use /admin to edit and create challenges.

[Back To Top ↥](#coders-headquarters)

🧑‍💻 Getting Up and Running Locally With Docker

The steps below will get you up and running with a local development environment. All of these commands assume you are in the root of your generated project.

Note

If you're new to Docker, please be aware that some resources are cached system-wide and might reappear if you generate a project multiple times with the same name.

[Back To Top ↥](#coders-headquarters)

Prerequisites

[Back To Top ↥](#coders-headquarters)

🏗️ Build the Stack

This can take a while, especially the first time you run this particular command on your development system::

$ docker-compose -f local.yml build

Generally, if you want to emulate production environment use production.yml instead. And this is true for any other actions you might need to perform: whenever a switch is required, just do it!

[Back To Top ↥](#coders-headquarters)

Run the Stack

This brings up both Django and PostgreSQL. The first time it is run it might take a while to get started, but subsequent runs will occur quickly.

Open a terminal at the project root and run the following for local development::

$ docker-compose -f local.yml up

You can also set the environment variable COMPOSE_FILE pointing to local.yml like this::

$ export COMPOSE_FILE=local.yml

And then run::

$ docker-compose up

To run in a detached (background) mode, just::

$ docker-compose up -d
[Back To Top ↥](#coders-headquarters)

Execute Management Commands

As with any shell command that we wish to run in our container, this is done using the docker-compose -f local.yml run --rm command: ::

$ docker-compose -f local.yml run --rm django python manage.py migrate
$ docker-compose -f local.yml run --rm django python manage.py createsuperuser

Here, django is the target service we are executing the commands against.

[Back To Top ↥](#coders-headquarters)

(Optionally) Designate your Docker Development Server IP

When DEBUG is set to True, the host is validated against ['localhost', '127.0.0.1', '[::1]']. This is adequate when running a virtualenv. For Docker, in the config.settings.local, add your host development server IP to INTERNAL_IPS or ALLOWED_HOSTS if the variable exists.

[Back To Top ↥](#coders-headquarters)

Basic Commands

Setting Up Your Users

Type checks

Running type checks with mypy:

    $ mypy codershq

Test coverage

To run the tests, check your test coverage, and generate an HTML coverage report:

    $ coverage run -m pytest
    $ coverage html
    $ open htmlcov/index.html

Running tests with py.test

    $ pytest

Celery

This app comes with Celery.

To run a celery worker:

    cd codershq
    celery -A config.celery_app worker -l info

Please note: For Celery's import magic to work, it is important where the celery commands are run. If you are in the same folder with manage.py, you should be right.

Email Server

In development, it is often nice to be able to see emails that are being sent from your application. For that reason local SMTP server MailHog with a web interface is available as docker container.

Container mailhog will start automatically when you will run all docker containers. Please check cookiecutter-django Docker documentation for more details how to start all containers.

With MailHog running, to view messages that are sent by your application, open your browser and go to http://127.0.0.1:8025

Stargazers ⭐

Thanks to all of our Stargazers ⭐ 🔭 who are supporting CodersHQ project

Stargazers repo roster for @Coders-HQ/CodersHQ

[Back To Top ↥](#coders-headquarters)

Contributors ✨

We would like to thank and appreciate our extraordinary contributors :clap:


Rashed Suwaidi

💻 🎨 📆 🚇 🚧

Musab

💻

Abdulrahman Alblooshi

💻 🎨

Abdulkarim Suleiman

🖋

arsxl

💻 🔌

DerpySmurf

💻 🎨

haralali

📆

Kajal Doshi

💻 🚇

Khushboo Gehi

📆

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!