This project is for the Milestone 4: High-Fi Prototype of KAIST CS473 Introduction to Social Computing.
Start studyo-back with:
npm start
Database consists of 3 folder : ./migrations, ./models, ./seeders. Each has our table structure. We have tables below.
- user
- course
- lecture
- note
- keyword
- question
- answer
- user-course
- user-keyword
- edit-note
- edit-user
In routes, there are routers that communicate with front end by request. For example in ./user/index.js, router get front-end's post request "login", and implement login function in ./user/user.js.
./user/index.js
const Router = require('koa-router');
const user = new Router();
const userCtrl = require('./user');
user.post('/login', userCtrl.login);
...
./user/user.js
...
exports.login = async (ctx) => {
const { email, password } = ctx.request.body;
''' Implement Login '''
ctx.status = 204;
};
...
