Work in progress - the current version doesn't have the basic features yet and shouldn't be used
This is an API written to support your studies in Competitive Programming.
Its is a tool to:
- List subjects with difficulty and dependencies
- List problems for each subject
- Suggest new subjects to learn
- Suggest new problems to solve
- Track subjects you've learned
- Track problems you've solved
- Suggest when its time to review some subject by recommending problems of that subject (based on spaced repetition method)
- Give permissions for coaches and teammates to track your progress
This API uses Azure CosmosDB graph database. To use it you will need to configure these environment variables for accessing your db:
$env:CDB_USERNAME="/dbs/<collection name>/<graph name>"
$env:CDB_HOST="wss://<resource name>.gremlin.cosmos.azure.com"
$env:CDB_KEY="<resource access key>"
go build .
.\dont-panic-api
Subjects CRUD
CREATEIt's aPOSTrequest with URLlocalhost:8080/api/problems. Remember to put a valid body. Example:
{
"name": "xavi-and-the-cookies",
"subjects": [
"dynamic-programming",
"math"
],
"difficulty": 2
}The expected result of this request is that the Problem will be created if there isn't already any other Problem with the name you specified.
-
READTo fetch all problems, make aGETrequest with URLlocalhost:8080/api/problems. To get a specific Problem, make a GET request with URLlocalhost:8080/api/problems/{name}, being{name}the name of the Problem. The expected result is ajsonwith the information from the problems you requested. -
UPDATEIt's aPUTrequest with URLlocalhost:8080/api/problems/{name}, being{name}the name of the Problem. Put a valid body that represents the updated Problem. The expected result is that the Problem information will be updated if there exists a Problem in the database with the name you specified. -
DELETEIt's aDELETErequest with URLlocalhost:8080/api/problems/{name}, being{name}the name of the Problem. The expected result is that the Problem will be delete if there is a Problem in the database with the name you specified, or an error if there isn't.