Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.3 #24

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open

v0.3 #24

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3f15b74
fix: update gitignore to ignore fb creds
solderneer Jun 21, 2021
2397dd6
fix: get firebase creds from env vars for digitalocean apps
solderneer Jun 21, 2021
91a170d
feat: moved to dgraph
solderneer Jun 29, 2021
e28667f
feat: update to add tutorial enrollment
solderneer Jun 29, 2021
06e227d
fix: minor big fixes
solderneer Jul 6, 2021
02f3678
feat: starting to add gamification features
solderneer Jul 12, 2021
3a79d69
feat: adding coins, energy and travelling features
solderneer Jul 13, 2021
e040147
fix: adding missing inverse links
solderneer Jul 13, 2021
6e27d1f
feat: moving to a prototype UI to show functionality
solderneer Jul 14, 2021
85040e9
feat: adding challnge and tutorial status
solderneer Jul 15, 2021
4bac219
feat: adding journey page, finishing up challenges and tutorials
solderneer Jul 19, 2021
7fd557a
feat: finishing up core UI
solderneer Jul 20, 2021
5164698
feat: final touches on new ui
solderneer Jul 20, 2021
247786d
Merge pull request #14 from axiomacademy/feat/revamping-to-new-ui
solderneer Jul 20, 2021
c1811cc
refactor: splitting up main.go into handler files for readability
solderneer Jul 20, 2021
3a67e79
Merge branch 'v0.3' of github.com:axiomacademy/microuniversity-protot…
solderneer Jul 20, 2021
5c671a0
fix: add support for LearnerPlanets to store learner specific data
solderneer Jul 20, 2021
77acb41
feat: integrating with graphql backend
solderneer Jul 20, 2021
d5c63e2
test: adding mock test data in RDF format
solderneer Jul 22, 2021
2e3be5f
refactor: starting backend structure change
solderneer Jul 25, 2021
85bcd30
refactor: following mat ryer guidelines
solderneer Jul 26, 2021
3d313e4
refactor: fixing errors
solderneer Jul 26, 2021
7e0790f
refactor: cleaning up doc formatting
solderneer Jul 27, 2021
a415b3c
feat: passing data through request context, closes #18
solderneer Jul 27, 2021
9d7bd8e
test: first working test
solderneer Aug 2, 2021
4ff8747
feat: crafted testing setup but not implemented yet
solderneer Aug 2, 2021
252c6e1
refactor: switching to proper logging statements, loglevels are kinda…
solderneer Aug 2, 2021
6169e4f
Merge pull request #20 from axiomacademy/refactor/backend-structure
solderneer Aug 2, 2021
19a7c02
feat: testing commit history
solderneer Aug 3, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
./backend/fb-creds.json
backend/fb-creds.json
16 changes: 0 additions & 16 deletions backend/Dockerfile

This file was deleted.

75 changes: 75 additions & 0 deletions backend/common_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package main

import (
"context"
"fmt"
"io/ioutil"
"os"

"github.com/dgraph-io/dgo/v200"
"github.com/dgraph-io/dgo/v200/protos/api"
"google.golang.org/grpc"
)

type testDb struct {
dg *dgo.Dgraph
}

func newTestDb() *testDb {
// Getting all the environmental variables
DB_URL := os.Getenv("DB_URL")
checkEnvVariable(DB_URL)

// Initialise the dgraph database
conn, err := grpc.Dial(DB_URL, grpc.WithInsecure())
if err != nil {
panic(fmt.Sprintf("Could not connect to grpc endpoint. Got error %v", err.Error()))
}

dg := dgo.NewDgraphClient(
api.NewDgraphClient(conn),
)

db := &testDb{
dg: dg,
}

db.loadFile("./testdata/data.rdf")
return db
}

func (db *testDb) Teardown() {
op := &api.Operation{DropOp: api.Operation_DATA}

if err := db.dg.Alter(context.Background(), op); err != nil {
panic(fmt.Sprintf("Could not cleanup database. Got error %v", err.Error()))
}
}

// Load the triples into dgraph
// Requires: triples, dgraph client
func (db *testDb) addTriples(triples string) error {
txn := db.dg.NewTxn()
ctx := context.Background()
defer txn.Discard(ctx)

_, err := txn.Mutate(ctx, &api.Mutation{
SetNquads: []byte(triples),
CommitNow: true,
})

return err
}

// Load a file containing triples into dgraph
// Requires: data file url, dgraph client
func (db *testDb) loadFile(data string) {
rdf, err := ioutil.ReadFile(data)
if err != nil {
panic(fmt.Sprintf("Could not read test data file. Got error %v", err.Error()))
}

if err = db.addTriples(string(rdf)); err != nil {
panic(fmt.Sprintf("Could not load test data file. Got error %v", err.Error()))
}
}
146 changes: 0 additions & 146 deletions backend/define.sql

This file was deleted.

Loading