-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/client-react
- Loading branch information
Showing
177 changed files
with
213,561 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,65 @@ | ||
# Server | ||
|
||
The server is composed of two parts: the admin panel and the api. It is built on top of [Strapi](https://strapi.io/documentation/3.0.0-beta.x/getting-started/introduction.html), a headless content management system. The file structure is documented [here](https://strapi.io/documentation/3.0.0-beta.x/concepts/file-structure.html#files-structure). | ||
|
||
|
||
|
||
## Setup | ||
|
||
### Installation | ||
|
||
`yarn install` | ||
|
||
### Developing | ||
|
||
`yarn develop` | ||
|
||
|
||
|
||
## Admin Panel `/admin` | ||
|
||
Built with [React](https://reactjs.org/) and served by [Node](https://nodejs.org/en/), the admin panel allows for full customization of the server. Here you can create new content types and their corresponding endpoints, configure roles and permissions, and much more. The interface itself can be customized and configured as needed. | ||
|
||
Read the full [documentation](https://strapi.io/documentation/3.0.0-beta.x/admin-panel/customization.html) on the admin panel. | ||
|
||
|
||
|
||
## API `/` | ||
|
||
Built with [Node](https://nodejs.org/en/), [Koa](https://github.com/koajs/koa#readme), and [Bookshelf](https://bookshelfjs.org/), the REST API enables CRUD functionality with the application's content. Authentication is enabled via JWTs. The current database is sqlite3 running locally. | ||
|
||
### Entity Relationships | ||
|
||
The content available via the API is modeled as follows. | ||
|
||
![ER Digram](er_diagram.png) | ||
|
||
### Endpoints | ||
|
||
Each endpoint corresponds to an entity from the ER digram, a content type in the admin panel, a folder in the `./api` directory, and a database table. | ||
|
||
| Endpoint | Note | | ||
| ------------------- | ---- | | ||
| activities | | | ||
| blocks | | | ||
| blocks-categories | | | ||
| complexities | | | ||
| difficulties | | | ||
| learning-categories | | | ||
| models | | | ||
| topics | | | ||
| types | | | ||
|
||
Each and every endpoint can be interacted with by using the following method and path combinations. | ||
|
||
| Method | Path | Description | | ||
| ------ | ----------------- | --------------------- | | ||
| GET | /{endpoint} | Get a list of entries | | ||
| GET | /{endpoint}/:id | Get a specific entry | | ||
| GET | /{endpoint}/count | Count entries | | ||
| POST | /{endpoint} | Create a new entry | | ||
| DELETE | /{endpoint}/:id | Delete an entry | | ||
| PUT | /{endpoint}/:id | Update an entry | | ||
|
||
Read the full [documentation](https://strapi.io/documentation/3.0.0-beta.x/content-api/api-endpoints.html#api-endpoints) on the api endpoints. | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"routes": [ | ||
{ | ||
"method": "GET", | ||
"path": "/activities", | ||
"handler": "activity.find", | ||
"config": { | ||
"policies": [] | ||
} | ||
}, | ||
{ | ||
"method": "GET", | ||
"path": "/activities/count", | ||
"handler": "activity.count", | ||
"config": { | ||
"policies": [] | ||
} | ||
}, | ||
{ | ||
"method": "GET", | ||
"path": "/activities/:id", | ||
"handler": "activity.findOne", | ||
"config": { | ||
"policies": [] | ||
} | ||
}, | ||
{ | ||
"method": "POST", | ||
"path": "/activities", | ||
"handler": "activity.create", | ||
"config": { | ||
"policies": [] | ||
} | ||
}, | ||
{ | ||
"method": "PUT", | ||
"path": "/activities/:id", | ||
"handler": "activity.update", | ||
"config": { | ||
"policies": [] | ||
} | ||
}, | ||
{ | ||
"method": "DELETE", | ||
"path": "/activities/:id", | ||
"handler": "activity.delete", | ||
"config": { | ||
"policies": [] | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use strict'; | ||
|
||
/** | ||
* Read the documentation (https://strapi.io/documentation/3.0.0-beta.x/concepts/controllers.html#core-controllers) | ||
* to customize this controller | ||
*/ | ||
|
||
module.exports = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
'use strict'; | ||
|
||
/** | ||
* Lifecycle callbacks for the `activity` model. | ||
*/ | ||
|
||
module.exports = { | ||
// Before saving a value. | ||
// Fired before an `insert` or `update` query. | ||
// beforeSave: async (model, attrs, options) => {}, | ||
|
||
// After saving a value. | ||
// Fired after an `insert` or `update` query. | ||
// afterSave: async (model, response, options) => {}, | ||
|
||
// Before fetching a value. | ||
// Fired before a `fetch` operation. | ||
// beforeFetch: async (model, columns, options) => {}, | ||
|
||
// After fetching a value. | ||
// Fired after a `fetch` operation. | ||
// afterFetch: async (model, response, options) => {}, | ||
|
||
// Before fetching all values. | ||
// Fired before a `fetchAll` operation. | ||
// beforeFetchAll: async (model, columns, options) => {}, | ||
|
||
// After fetching all values. | ||
// Fired after a `fetchAll` operation. | ||
// afterFetchAll: async (model, response, options) => {}, | ||
|
||
// Before creating a value. | ||
// Fired before an `insert` query. | ||
// beforeCreate: async (model, attrs, options) => {}, | ||
|
||
// After creating a value. | ||
// Fired after an `insert` query. | ||
// afterCreate: async (model, attrs, options) => {}, | ||
|
||
// Before updating a value. | ||
// Fired before an `update` query. | ||
// beforeUpdate: async (model, attrs, options) => {}, | ||
|
||
// After updating a value. | ||
// Fired after an `update` query. | ||
// afterUpdate: async (model, attrs, options) => {}, | ||
|
||
// Before destroying a value. | ||
// Fired before a `delete` query. | ||
// beforeDestroy: async (model, attrs, options) => {}, | ||
|
||
// After destroying a value. | ||
// Fired after a `delete` query. | ||
// afterDestroy: async (model, attrs, options) => {} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"kind": "collectionType", | ||
"connection": "default", | ||
"collectionName": "activities", | ||
"info": { | ||
"name": "activity" | ||
}, | ||
"options": { | ||
"increments": true, | ||
"timestamps": true | ||
}, | ||
"attributes": { | ||
"name": { | ||
"type": "string", | ||
"required": true | ||
}, | ||
"description": { | ||
"type": "text" | ||
}, | ||
"difficulty": { | ||
"model": "difficulty" | ||
}, | ||
"models": { | ||
"collection": "model" | ||
}, | ||
"blocks_categories": { | ||
"collection": "blocks-category" | ||
}, | ||
"learning_category": { | ||
"model": "learning-category" | ||
}, | ||
"topic": { | ||
"model": "topic" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use strict'; | ||
|
||
/** | ||
* Read the documentation (https://strapi.io/documentation/3.0.0-beta.x/concepts/services.html#core-services) | ||
* to customize this service | ||
*/ | ||
|
||
module.exports = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"routes": [ | ||
{ | ||
"method": "GET", | ||
"path": "/blocks", | ||
"handler": "block.find", | ||
"config": { | ||
"policies": [] | ||
} | ||
}, | ||
{ | ||
"method": "GET", | ||
"path": "/blocks/count", | ||
"handler": "block.count", | ||
"config": { | ||
"policies": [] | ||
} | ||
}, | ||
{ | ||
"method": "GET", | ||
"path": "/blocks/:id", | ||
"handler": "block.findOne", | ||
"config": { | ||
"policies": [] | ||
} | ||
}, | ||
{ | ||
"method": "POST", | ||
"path": "/blocks", | ||
"handler": "block.create", | ||
"config": { | ||
"policies": [] | ||
} | ||
}, | ||
{ | ||
"method": "PUT", | ||
"path": "/blocks/:id", | ||
"handler": "block.update", | ||
"config": { | ||
"policies": [] | ||
} | ||
}, | ||
{ | ||
"method": "DELETE", | ||
"path": "/blocks/:id", | ||
"handler": "block.delete", | ||
"config": { | ||
"policies": [] | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use strict'; | ||
|
||
/** | ||
* Read the documentation (https://strapi.io/documentation/3.0.0-beta.x/concepts/controllers.html#core-controllers) | ||
* to customize this controller | ||
*/ | ||
|
||
module.exports = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
'use strict'; | ||
|
||
/** | ||
* Lifecycle callbacks for the `block` model. | ||
*/ | ||
|
||
module.exports = { | ||
// Before saving a value. | ||
// Fired before an `insert` or `update` query. | ||
// beforeSave: async (model, attrs, options) => {}, | ||
|
||
// After saving a value. | ||
// Fired after an `insert` or `update` query. | ||
// afterSave: async (model, response, options) => {}, | ||
|
||
// Before fetching a value. | ||
// Fired before a `fetch` operation. | ||
// beforeFetch: async (model, columns, options) => {}, | ||
|
||
// After fetching a value. | ||
// Fired after a `fetch` operation. | ||
// afterFetch: async (model, response, options) => {}, | ||
|
||
// Before fetching all values. | ||
// Fired before a `fetchAll` operation. | ||
// beforeFetchAll: async (model, columns, options) => {}, | ||
|
||
// After fetching all values. | ||
// Fired after a `fetchAll` operation. | ||
// afterFetchAll: async (model, response, options) => {}, | ||
|
||
// Before creating a value. | ||
// Fired before an `insert` query. | ||
// beforeCreate: async (model, attrs, options) => {}, | ||
|
||
// After creating a value. | ||
// Fired after an `insert` query. | ||
// afterCreate: async (model, attrs, options) => {}, | ||
|
||
// Before updating a value. | ||
// Fired before an `update` query. | ||
// beforeUpdate: async (model, attrs, options) => {}, | ||
|
||
// After updating a value. | ||
// Fired after an `update` query. | ||
// afterUpdate: async (model, attrs, options) => {}, | ||
|
||
// Before destroying a value. | ||
// Fired before a `delete` query. | ||
// beforeDestroy: async (model, attrs, options) => {}, | ||
|
||
// After destroying a value. | ||
// Fired after a `delete` query. | ||
// afterDestroy: async (model, attrs, options) => {} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"kind": "collectionType", | ||
"connection": "default", | ||
"collectionName": "blocks", | ||
"info": { | ||
"name": "Block" | ||
}, | ||
"options": { | ||
"increments": true, | ||
"timestamps": true | ||
}, | ||
"attributes": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"definition": { | ||
"type": "text" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use strict'; | ||
|
||
/** | ||
* Read the documentation (https://strapi.io/documentation/3.0.0-beta.x/concepts/services.html#core-services) | ||
* to customize this service | ||
*/ | ||
|
||
module.exports = {}; |
Oops, something went wrong.