Version: 1.0.3
Dialektor is a tool for recording audio and creating a ledger in order to study the changes overtime.
Under supervision of Dr. Rafal Jabrzemski.
MIT License
Possible Usages
- Learning languages, instruments, and speech therapy
- Researching dialects and linguistics
- Professions involving sound
- Speech Therapist, Musician, Linguist, Translator, Post Production, Recording/Studio Engineer, Audio Forensic Engineer
- Setup Docker for Local Development
- Visual Studio Code Setup
- Development Lifecyle
- Command Reference List
- Meet the Team
- Useful Links and Sources Cited
Install Git here
Clone the GitHub Repo
git clone https://github.com/will7hughes/Dialektor.git
Change directory to the Dialektor project
Commands for Mac Windows and Linux
cd Dialektor
Install Docker Desktop here
Follow installation prompts from Docker desktop for extra configuration setup
.
For example, I had to copy/paste and run a powershell command for WSL
.
I also had to do step 4
from this site here
Restart your computer
Create the container
docker-compose create
Startup the container
docker-compose up
Verify that there are two containers up db
and web
docker ps
Open a new powershell window
Enter the web
container
You can either enter the web
container through powershell or through Visual Studio Code at this point
If you want to connect via Visual Studio Code and run the rest of the commands on VS Code Terminal
Go to Visual Studio Code Setup
docker-compose exec web sh
Create first time migrations on the personal app.
This create the tables defined in models.py and creates them in our PostgreSQL database.
You only have to do this for first time setup
Every other time you just do the migrations without specifying the personal
app
Django will know that personal
app exists and will make the migration along with the default
app
python manage.py makemigrations personal
python manage.py migrate personal
Apply database migrations to the default app.
This creates the tables defined in our django application and creates them in our PostgreSQL database we just configured.
python manage.py makemigrations
python manage.py migrate
Create a superuser to login to the django admin console
python manage.py createsuperuser
You can now go to http://127.0.0.1:8000/admin
and login with the superuser you created
If you forget your password. Just re-run the createsuper command above
You have now completely setup the development environment
Table of Contents
Download Here: https://code.visualstudio.com/download
Install Pluggin Remote - Containers: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers
Make sure Docker is running
If you close Docker with Ctrl+C
your VS Code window will disconnect
docker-compose up
If you develop without being connected
to the Docker you will have to rebuild the docker web
container for changes to make effect
Note that code changes take immediate effect when you save a file
If you write something that throws an error. You may have to develop locally, without Docker
Fix the error. And rebuild the web
container
To rebuild web
container run
docker-compose build web
Once Docker is up and running and is not throwing any errors
Connect to the Docker Container in VS Code
VS Code -> View -> Command Palette -> search
Attach -> Attach to Running Containers
It will then prompt you to select db
or web
Select web
Navigate to the folder
VS Code -> File -> Open Folder -> /code/
-> Ok
You can now edit and develop right from VS Code as if you were on your local machine
Make sure that you are connected to the Container
by looking at the bottom left green area
It should say Container dialektor_web (/web)
Connect to VS Code terminal to startup localhost django website
VS Code -> Terminal -> New Terminal
Change directory
cd code
Start localhost development website
python manage.py runserver
You can now go to http://127.0.0.1:8080 to view your localhost website while you develop
You can shutdown the website by going to the console and using the key combination
Ctr + C
Create a feature branch
DO NOT WORK ON THE MASTER BRANCH ON YOUR LOCAL DEVELOPMENT!!!!!!!!!!!
DO NOT MERGE TO THE MASTER BRANCH ON YOUR LOCAL DEVELOPMENT!!!!!!!!!
DO NOT TOUCH THE MASTER BRANCH ON YOUR LOCAL DEVELOPMENT!!!!!!!!!!
Note that you can run these git commands directly from the VS Code terminal while connected to Docker web
component
git branch 1.0.1-john
The naming convention for a feature branch is X.X.X-firstname.
Where X(major)-X(minor)-X(point) are version codes
Checkout your feature branch
git checkout 1.0.1-john
Assign yourself on an issue in Github or create an issue that describes what you will do in this update
Code your update, feature, bug fix, ui fix, etc
Add changes to staging on git
Frequently add
, and commit
you code
git add *
Verify that you are adding the files you have updated
git status
Commit the changes. Add a descriptive message about a feature, bug fix, ui change, etc.
git commit -m "My super duper descriptive message about all the new goodies I just did"
Pull changes from remote repo
We will pull the master branch so that we can merge changes to test that they work with our changes
git pull origin master
Merge master branch into our feature Branch
If there are conflicts. Resolve them manually by deleting the markup that GitHub has created and manually looking at the differences between the two options
Delete one of the options/conflicts and keep the other
It is easier to merge the master branch into your feature branch by using the Pull Requests feature on the GitHub website
To use that feature instead of doing it on the console/terminal, push
your feature branch, create a Pull Request
Change the base: master
to master
and compare: 1.0.1-john
to your feature branch
Create the Request, Apply, Merge, Resolve
git merge master
Push changes to remote repo.
DO NOT WORK ON THE MASTER BRANCH ON YOUR LOCAL DEVELOPMENT!!!!!!!!!!!
Always develop on a feature branch. For example, 1.0.1-will
See Development guide above for checking out or creating a feature branch
git push origin 1.0.1-will
Create a pull request on github
I Will
will manage the pull requests for the first couple weeks for quality assurance
I will use the pull requests to merge the feature branch into the master branch
I will also be managing Kubernetes deployment until you've made several pull requests and shown you've got that down
Don't worry about production deployment until you've handled local development
Table of Contents
Startup
docker-compose up
Create the Container
docker-compose create
List Running Apps
docker ps
Enter the web
App
docker-compose exec web sh
Enter the db
App (Local PostgreSQL Database)
docker-compose exec db sh
Build/Rebuild apps
docker-compose build
Start Localhost Dev Site at
http://127.0.0.1:8080
Admin: http://127.0.0.1:8080/admin
NOTE: Must be run inside Docker web
app
NOTE: Can be run inside Visual Studio Code terminal when VS Code is connected to Docker Container web
app
python manage.py runserver
Shutdown Localhost Dev Site
NOTE: Must be used on same terminal/console window that ran the server with the above command
Ctrl + C
Stage Database Migrations
NOTE: Change out personal
for whatever app that contains the models.py
for the Database Model that you have changed
NOTE: You can leave out personal
to makemigrations for all apps. Provided this is not the first time you are making the migrations
python manage.py makemigrations personal
Migrate Database
Applies the migrations that were staged from the above command
NOTE: You can leave out personal
to migrate for all apps. Provided this is not the first time you are migrating
python manage.py migrate personal
Create Admin
http://127.0.0.1:8080/admin
python manage.py createsuperuser
Create a Branch
git branch BRANCH_NAME
Checkout Branch
git checkout BRANCH_NAME
Create and Checkout Branch
git checkout -b BRANCH_NAME
Add Changes to Staging Area
git add *
View Staging
git status
git commit -m "My super duper descriptive message about all the new goodies I just did"
Pull
git pull origin BRANCH_NAME
git merge master
Push
git push origin BRANCH_NAME
Under supervision of Dr. Rafal Jabrzemski
Group 11 CS 4273 Software Engineering Capstone Project
Will Hughes
Lieu Dean
Jason Myers
Group APYZ CS 4263 Software Engineering Capstone Project
Adam Gracy
Phillip Voss
Yashar G. Ahari
Zachary Arani
Table of Contents
To understand the decision to use Docker for our development environment: https://www.untangled.dev/2020/05/30/why-docker-local-development/
Docker Basics https://vsupalov.com/6-docker-basics/
Docker Setup for Django: https://www.untangled.dev/2020/06/06/docker-django-local-dev/
Kubernetes Setup Tutorial: https://cloud.google.com/python/django/kubernetes-engine
Google Cloud Console Dashboard: https://console.cloud.google.com/home/dashboard
Django Documentation: https://docs.djangoproject.com/en/3.1/
Django Getting Started Series: https://docs.djangoproject.com/en/3.1/intro/tutorial01/
Django Table of Contents: https://docs.djangoproject.com/en/3.1/contents/
Django Project Structure: https://django-project-skeleton.readthedocs.io/en/latest/structure.html
Django Settings: https://docs.djangoproject.com/en/3.1/topics/settings/
Django Views: https://docs.djangoproject.com/en/3.1/topics/http/views/
Django Class Based Views: https://docs.djangoproject.com/en/3.1/topics/class-based-views/
Django Conditional Views: https://docs.djangoproject.com/en/3.1/topics/conditional-view-processing/
Django Forms: https://docs.djangoproject.com/en/3.1/topics/forms/
Django Templates: https://docs.djangoproject.com/en/3.1/topics/templates/
Django Migrations: https://docs.djangoproject.com/en/3.1/topics/migrations/
Django Files: https://docs.djangoproject.com/en/3.1/topics/files/
Django Caching: https://docs.djangoproject.com/en/3.1/topics/cache/
Django Security: https://docs.djangoproject.com/en/3.1/topics/security/
Django Rest Framework: https://www.django-rest-framework.org/tutorial/1-serialization/
Django Serialization: https://docs.djangoproject.com/en/3.1/topics/serialization/
Django How-To Guides: https://docs.djangoproject.com/en/3.1/howto/
Yashar's Original Repo: https://github.com/yasharAhari/Dialektor
Github Pull Request: https://guides.github.com/activities/hello-world/#pr
Makefile Basics: https://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/
Makefile for Django: https://gist.github.com/magopian/4077998
PostgreSQL Basics: https://www.postgresqltutorial.com/
If the Kubernetes cluster errors out you may need to re-create it. I had an issue when Kubernetes did an automatic update and I was unable to startup the cluster after the update so I re-created the cluster. Also note that this may have been caused by billing being canceled while the cluster is up. We do not know the exact cause.
- Also note that you have to do step 1 (a, b) in Set up Cloud SQL from here Useful Commands
kubectl describe pods