Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

philippfranke/mathub

Repository files navigation

mathub

Logo

Mathub is a revision control system based on git for academic assignments. The online tex-editor allows users to easily solve their assignments by sharing solutions and commenting on others.

Please use docker for demo or testing!

Code Status

Build Status

Testing/Demo and Deployment

Please use docker in order to review our project. Our docker image only includes our application interface and its dependencies. Notice: You need your own mysql server, it is not included in our docker image

The following steps will guide you to run our application:

1) mySQL Container

If you have not installed a mysql server on your machine, please use this docker images. Further information: here

docker pull mysql
docker run --name mathub-mysql -e MYSQL_ROOT_PASSWORD=mathub \
-e MYSQL_USER=mathub -e MYSQL_PASSWORD=mathub -e MYSQL_DATABASE=mathub -d mysql

2) Build our docker image

Go to the project's root and build a docker image

docker build -t mathub:latest .

3) Run docker image

Run a docker container with a linked mysql container

docker run --name mathub -p 80:8080 -v ~/repos:/tmp/repos --link mathub-mysql:mysql -d mathub:latest

or

Run a docker container with your database credentials (replace $your_mysql_* with your credentials)

docker run --name mathub -p 80:8080 -v ~/repos:/tmp/repos --link mathub-mysql:mysql \
-e MYSQL_USER=$your_mysql_username -e MYSQL_PASSWORD=$your_mysql_password \
-e MYSQL_DATABASE=$your_mysql_database -e MYSQL_PORT_3306_TCP_ADDR=$your_mysql_ip \
-e MYSQL_PORT_3306_TCP_PORT=$your_mysql_port -d mathub:latest

Reminder: Port Fordwarding on linux: http://localhost, Port Forwarding on others: http://$(`boot2docker ip`)

4) Change API host in angular app

Open /angular/app/scripts/factories/api.js and change urlBase to "http://localhost" on linux or "http://$(boot2docker_ip)" on windows or mac.

5) Run grunt

Install first

npm install -g grunt-cli bower

Go to /angular and run npm install && bower install && grunt serve. Finally start your browser and open http://localhost:9000

Development

For development

Install dependencies

go get github.com/gorilla/mux
go get github.com/jmoiron/sqlx
go get github.com/go-sql-driver/mysql

Change db

Import mathub.sql to your mysql server

Run or build

ENV

export MYSQL_USER=mathub
export MYSQL_PASSWORD=mathub
export MYSQL_DATABASE=mathub
export MYSQL_PORT_3306_TCP_ADDR=192.168.59.103
export MYSQL_PORT_3306_TCP_PORT=3306

RUN

cd gateway
go run main.go routes.go

Default flags:

  -listen=:8080           // HTTP listen address
  -data=./repos           // Repository path, all assignments and solutions are under version control
  -dump=""                // mySQL dump file for import ,

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published