Skip to content

Commit c62370b

Browse files
authored
Release/0.1 (#2)
release/0.1: Core functionalities implemented - plugins api   - upload   - download   - show info - homepage - account system   - login   - register - profile   - show plugins   - show user data - marketplace   - show all plugins   - search plugin - download application page - dev guide (very minimal) - Docker files -> Runs on linux in two docker containers. One for the main application and one for the yottadb database. - json schemas for the api and communication with the db
1 parent c0f9474 commit c62370b

107 files changed

Lines changed: 3986 additions & 502 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/docs

.gitignore

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@ build
22
.idea
33

44
# project specific
5-
src/public/plugins
65
out
76
dist
87
node_modules
98
.tscache
10-
package-lock.json
9+
package-lock.json
10+
/plugins/
11+
12+
**/*.jade.go
13+
**/jade.go
14+
*.tmp.txt
15+
16+
# generated schemas
17+
**.schema.go

.idea/runConfigurations/build.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/go_build_generate_server.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/start.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

Lines changed: 0 additions & 8 deletions
This file was deleted.

Dockerfile-db

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM yottadb/yottadb-debian-base
2+
3+
RUN apt update && apt install -y git
4+
5+
WORKDIR /db
6+
ENV GOBIN /db/bin
7+
ENV GOPATH /db/go
8+
ENV PATH=$PATH:/db/db:/db/bin
9+
10+
COPY db ./db
11+
COPY ./schemas ./schemas
12+
13+
RUN wget -q https://golang.org/dl/go1.14.7.linux-amd64.tar.gz
14+
RUN tar -C /usr/local -xzf go1.14.7.linux-amd64.tar.gz
15+
ENV PATH=/usr/local/go/bin:$PATH
16+
17+
RUN go get lang.yottadb.com/go/yottadb
18+
RUN go get -u github.com/a-h/generate/...
19+
20+
WORKDIR /db/db
21+
22+
RUN go generate
23+
RUN go get -v
24+
RUN go install -v
25+
26+
EXPOSE 8090
27+
28+
RUN chmod +x start
29+
30+
CMD ["start"]
31+

Dockerfile-webapp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM alpine:latest
2+
3+
RUN apk add --no-cache git go npm
4+
5+
WORKDIR /server
6+
ENV GOBIN /server/bin
7+
RUN go get github.com/Joker/jade/cmd/jade
8+
RUN go get -u github.com/a-h/generate/...
9+
ENV GOPATH /server
10+
ENV PATH=$PATH:$GOPATH/bin
11+
12+
COPY . .
13+
14+
RUN npm install
15+
RUN npm run grunt
16+
17+
WORKDIR /server/src
18+
RUN go get -d ./...
19+
RUN go generate
20+
RUN go install -v ./...
21+
22+
23+
EXPOSE 8080
24+
25+
CMD ["server"]

README.md

Lines changed: 125 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,125 @@
1-
# StudyTool Server
1+
# StudyTool Server
2+
3+
The Web-application for the StudyTool.
4+
5+
## Features
6+
7+
- API for plugins
8+
- upload
9+
- download
10+
- info
11+
- homepage
12+
- account system
13+
- login
14+
- register
15+
- profile
16+
- show plugins
17+
- show user data
18+
- marketplace
19+
- show all plugins
20+
- search plugin
21+
- download application page
22+
- dev guide
23+
24+
## Installation
25+
26+
### For developers
27+
28+
**Prerequisites**
29+
30+
- golang version 1.13 or above (https://golang.org/dl/)
31+
- npm (https://www.npmjs.com/get-npm)
32+
33+
**Install everything**
34+
35+
- clone this repo
36+
```shell script
37+
git clone https://github.com/PluginSystem-StudyManager/Server.git
38+
cd Server
39+
```
40+
- install all needed node packages
41+
```shell script
42+
# WORKDIR: Server
43+
npm install
44+
```
45+
- install all needed go modules
46+
```shell script
47+
# WORKDIR: Server/src
48+
go get -d ./...
49+
```
50+
51+
**Start the server**
52+
53+
- **compile all 'sass' and 'ts' files**
54+
55+
This also watches for changes and automatically compiles these files.
56+
```shell script
57+
# WORKDIR: Server
58+
npm run grunt
59+
```
60+
61+
- generate go code
62+
63+
Some go code is generated by tools. This code is not added to version control.
64+
You only need to execute this the first time or when you made changes to a `.jade` or `.schema.json` file.
65+
```shell script
66+
# WORKDIR: Server/src
67+
go generate
68+
```
69+
70+
- compile go code
71+
72+
```shell script
73+
# WORKDIR: Server/src
74+
go install ./...
75+
```
76+
77+
- Start the server
78+
79+
```shell script
80+
server
81+
```
82+
83+
**Troubleshooting**
84+
85+
### Run on a Server
86+
87+
**Prerequisites**
88+
89+
You need a linux based os for this to work.
90+
91+
**Single script setup**
92+
93+
If you are on a debian based distro you can use this one liner to set up everything and start the server.
94+
95+
[//]: # (TODO: change to master branch)
96+
97+
```shell script
98+
sh -c "$(curl -fsSL https://raw.githubusercontent.com/PluginSystem-StudyManager/Server/dev/scripts/install.sh)"
99+
```
100+
101+
**Manual setup**
102+
103+
You can also do the steps from the above script manually:
104+
105+
- Clone repo
106+
107+
```shell script
108+
git clone https://github.com/PluginSystem-StudyManager/Server.git
109+
cd Server
110+
```
111+
112+
- Install docker and docker-compose (https://docs.docker.com/get-docker/)
113+
114+
You can use the [install_docker](scripts/install_docker) script if you are on a debian based distro.
115+
116+
- build + start the server
117+
118+
You may have to run this as `sudo`.
119+
120+
For more information about docker-compose see: https://docs.docker.com/compose/reference/overview/
121+
122+
```shell script
123+
# WORKDIR: Server
124+
docker-compose up
125+
```

db/go.mod

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module db
2+
3+
go 1.14
4+
5+
require (
6+
github.com/a-h/generate v0.0.0-20190312091541-e59c34d33fb3 // indirect
7+
github.com/google/go-cmp v0.5.2
8+
lang.yottadb.com/go/yottadb v1.0.0
9+
)

0 commit comments

Comments
 (0)