The new version of GitMate - written in django!
What exactly is GitMate?
GitMate is a software which listens for certain events in your git project (e.g. push event) and runs a plugin (which you have configured) when that event is detected.
So what can GitMate do?
Anything! In gitmate different plugins perform different functions that you can choose from. If you can't find a plugin you are looking for you can make your own!
Running the Project
Make sure virtual environment with pip is available:
virtualenv ~/.venvs/coon . ~/.venvs/coon/bin/activate
To run GitMate you'll need a secret. Use any string you can come up with:
Now install the project specific requirements and create your initial database:
pip install -r requirements.txt python3 manage.py migrate
Followed by updating the database with all configured GitMate plugins:
python3 manage.py upmate
Now change to the "fronted" Directory and install the frontend dependencies:
cd frontend npm install ./node_modules/typings/dist/bin.js install dt~hammerjs --global
Compile the app once, or continuously on filechange:
npm run tsc # one-shot compilation npm run tsc:w # continuous compilation
Now you can go back to the "gitmate-2" dir and run the server:
cd .. python3 manage.py runserver
Tests can be run with
python3 manage.py test
The code analysis can be run in the
official coala container
or locally when installing the
coala-bears pip package:
Modifications to Models
After adding/removing models in apps, you would need to make migrations for the database. You could make migrations with
python3 manage.py makemigrations
And then migrate the changes with
python3 manage.py migrate
Accessing Django shell
To run a python interpreter with a complete django environment setup, just run
python3 manage.py shell
Accessing Django's database(via an SQL shell)
We could access the database through SQL commands via a shell, to do so, just run
python3 manage.py dbshell
Collecting static assets into wsgi application(production stage)
We could collect all static files into a single location so they could be served easily in production.
python3 manage.py collectstatic
Ever got caught in an irksome situation, without a logout button? You could end all your sessions with,
python manage.py clearsessions
- GitLab (OAuth2)
- GitHub (OAuth2)
- Bitbucket (OAuth)
Please include your CLIENT ID and CLIENT SECRET keys in
The login URL:
This saves the required access tokens as provided by the providers
User model, which could later be used to send
authenticated requests to communicate with the providers.
Frontend Unit Tests
TypeScript unit-tests are usually in the
app folder. Their filenames must end in
Look for the example
.spec.ts files as you wish; we configured karma to find them.
Run it with
That command first compiles the application, then simultaneously re-compiles and runs the karma test-runner. Both the compiler and the karma watch for (different) file changes.
Shut it down manually with
Test-runner output appears in the terminal window.
We can update our app and our tests in real-time, keeping a weather eye on the console for broken tests.
Karma is occasionally confused and it is often necessary to shut down its browser or even shut the command down (
restart it. No worries; it's pretty quick.
both frontend and backend combined
You could test the full app, by following these steps.
cd frontend: change directory into frontend
npm run tsc: compile the app once (
npm run tsc:wfor coninuous compilation)
cd ..: change directory back into the root
python3 manage.py runserver: runs the server for testing
http://localhost:8000/ to see the application running.
Note that the link
/static/specified as STATIC_URL in
gitmate/settings.pylinks the static serve of files, so all static links in
frontend/index.htmlshould prefix the same, and the
frontend/system.config.jsshould reflect the same, for proper functioning of the application.
Documentation to API Endpoints
The docs could be accessed via http://localhost:8000/docs once the server is running.