Skip to content

nihilSup/Hasker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hasker - stackoverflow core functionality

How to use

To deploy app use

cd Hasker
docker-compose up --build -V

app will be available on localhost:8000/hasker/ !!! For prod environment you have to set DJANGO_SECRET_KEY !!!

This will deploy all stack on port 8000. One can use shell docker build . -t web to launch only django with uWSGI. But it is up to you to configure db.

There are several ENV vars to control the config:

  • DJANGO_SETTINGS_MODULE module name with django settings. Currently there is settings package in hasker_proj dir. It contains base.py, local.py and prod.py. Each one contains settings specific to desired environment(e.g. static and media files will be handled differently, same true for secret key and db settings)
  • DJANGO_SECRET_KEY used for csrf protection. Must be set in production
  • EMAIL_USER and EMAIL_PASS will be used to send emails

To set them provide .env file in the root folder (among docker-compose.yml)

There are several convience things in entrypoint of django uWSGI docker:

  • db flush
  • db load from fixture
  • collect static

Feel free to remove them (except collect static)

Architecture

web client <-> nginx <-> uWSGI <-> django app <-> postgresql

nginx -

  • reverse proxy from port 8000 to internal 80 and then to port 8000 of uWSGI docker
  • serves static and media in prod (need to python manage.py collectstatic)

uWSGI -

  • gets dynamic requests from nginx and call django middleware

django app -

  • contains all business logic
  • serves dynamic content
  • talks to persistance

postgresql -

  • persistance

REST API

root: http://127.0.0.1:8000/hasker/api/ Swagger: http://127.0.0.1:8000/hasker/api/swagger-ui/

Usefull links

Rest API links

TODO

  • Change arrows up
  • Add sorting by votes and date to answers
  • Fix login required for doing GET to votes
  • Add asked time ago
  • Add paging to question view
  • Add Vote and Asnwer counters to index
  • Add double sorting and paging to index
  • Add email notifications of new answers
  • Add correct asnwer mark
  • Handle tags
  • Add search functional
  • Add sidebar
  • Check email notifications
  • Rewrite password validation by using forms clean
  • Add messages to creating questions and adding answers. Also add messages when something can't be done
  • Implement tests
  • Migrate to postgresql
  • Add docker, uWSGI, make from github
  • Add tags autocomplit
  • Refactor admin creation form and userform
  • Implement REST API
  • Add logging
  • Change profile view - add preview of current avatar

About

Stackoverflow like django site

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published