Skip to content

william57m/mix-answer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mix Answer

Build Status

Overview

Mix Answer is a Question & Answer platform, a StackOverflow like tool.

Technologies

Mix Answer uses modern tools

Development

  • Setup
# Build images
docker-compose build

# Run containers
docker-compose up -d

# Init database
docker-compose run --rm --no-deps mix-answer-server python scripts/init_db.py --config config/dev.conf --data_test true
  • You can now access the UI
http://localhost:8080

DB Class Diagram

https://www.lucidchart.com/documents/embeddedchart/963a601e-0870-45c2-871f-acdb405c5090

Tests

# Build and tag the test image
docker build -t mix-answer-test \
             -f server/tests/Dockerfile \
             server

# Start the test DB container
docker run -d \
           -e POSTGRES_USER=mixuser \
           -e POSTGRES_PASSWORD=mixuser \
           -e POSTGRES_DB=mixanswer \
           --name mix-answer-test-db \
           postgres:10.3

# Initialize the test DB
docker run -t --rm \
           -v /$PWD/server:/home/server \
           --link mix-answer-test-db:db \
           mix-answer-test \
           python scripts/init_db.py --config=config/test.conf

# Run test
docker run --rm -it \
           -v /$PWD/server:/home/server \
           --link mix-answer-test-db:db \
           mix-answer-test \
           pytest -v

Deployment

  1. Copy the docker-compose-prod.yml file on the server you want to deploy the tool
  2. Run docker-compose up -d it will automatically pull the images and start the services
  3. Init the DB docker-compose run --rm --no-deps mix-answer-server python scripts/init_db.py --config config/prod.conf

Roadmap

Open roadmap

Contribution

  • Please use flake8 (Python) and eslint (JavaScript) as syntax linter
  • Please write and run the tests before to submit a Pull Request
  • Please open a Pull Request for review