This repository holds the Coders-HQ backend. It is made using Django and Postgres as an API backend to the Coders-HQ frontend (based on React) which is hosted in this repo. The main Coders-HQ website is hosted at codershq.ae.
All information relating to the databse and tokens/secrets are should be in a .env file. An example of the file is the .env.example copy and edit the conttents to suite your environment and save it as .env in the root directory.
Docker and docker-compose are used to build and connect the subset of apps that are required to run the backend.
- docker
- docker-compose
- (Optional) httpie
- Copy
.env.exampleto.envand edit with your github token, django secret, etc. - Run
docker-compose up backend - On a web browser open localhost:33325
All information related to the API, and how to use it, can be found here.
The front-end will be located in its own repository which can connect to django's REST framework. The REST framework makes it easy to integrate any frontend to django's API which makes it possible to work on the front and backend separately.
The final architecture combines a subset of apps together to run all the different functionalities that's needed for the backend.
The main apps are:
| Django | Main backend |
|---|---|
| CHQ_Scoring | Scoring mechanism for CHQ Backend |
| MKDocs | Documentation tool |
| Postgres | Database server |
| Jenkins | Unit tests and server build |
| Celery | Async events |
| Redis | Message broker between celery and Django |
Currently the docker-compose.yml is located inside this repository but will eventually be pulled out top integrate the frontend with the backend.
Postgres is pulled when using the docker-compose command and the databse name/user/password are all grabbed from the .env file. The data is stored at /var/lib/codershq/postgres/.
