This Repository contains the Term Project of SWE574 class in Bogazici Univesity.\
The application is not in production for now.
LinkMe is a web based note-taking and posting application. Users can share, categorize contents from social media or blogs and interact with other users through contents. Moreover, users can browse through spaces or tags to discover contents in a specific area.
Clone this git repository by using the command:
git clone https://github.com/SWE-574-GROUP-1/SWE574-GROUP-1
Important Notes:
Open your GIT Bash terminal.\ Go to root directory and install virtualenv package to your global environment with following commands:
cd
pip install virtualenv
Create a virtual environment with following command:
virtualenv --python="</path/to/python.exe>" "</path/to/new/virtualenv/>"
Activate your virtual environment with following command:
source "</path/to/new/virtualenv>/scripts/activate" ->This command is for Mac
.\Scripts\activate -> This command is for Windows enviroment
Install site packages from requirements.txt with the following command:
pip install -r requirements.txt
Open the root directory of the project and execute the following command with terminal in order to run local server:
# Run from terminal
python manage.py runserver
# Run with docker
docker-compose up --build
To reach the web application go to http://127.0.0.1:8000.
In this section, local run of Unit and QA tests is explained.\ Please make sure that the application is up and running. (See section 'Local Run')\ Please make sure that tests are performed in test database, NOT PRODUCTION.
The application Make sure that you are at the same directory with manage.py
# Local run
cd SWE574
python manage.py test
# docker alternative 1, go into container shell and run tests
docker exec -it SWE574 sh
python manage.py test
# docker alternative 2, run from terminal
docker exec -it SWE574 sh -c "python manage.py test"
A common error that may be encountered while creating new unit tests is,
# For local run
python manage.py flush # Say yes to the upcoming prompt
# docker alternative 1, go into container shell and flush db
docker exec -it SWE574 sh
python manage.py flush
# docker alternative 2, run from terminal
docker exec -it SWE574 sh -c "python manage.py flush" # Say yes to the upcoming prompt
Make sure that the virtual environment build with requirements_dex.txt.\ Go to the root directory of project and run following from terminal
# For flake8
pip install flake8
flake8
# For coverage report in docker
docker exec -it SWE574 sh -c "pip install coverage && coverage run manage.py test && coverage rep
ort && coverage html"
## Command above will create a directory called htmlcov through volumes
## Open the index.html and manage_py.html reports with your browser