Skip to content

mink0613/test-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

BRIEF APPLICATION STRUCTURE

  • app-restify.js: main application
  • sql-db-table.sql: sql query for creating database & tables
  • api/: all the apis that main application use
  • api/auth/: apis for user authentication, use JWT
  • api/database/: apis for accessing database & retrieve data (currently not located here yet)
  • api/mode/: models that this application use

DATABASE CREATION

  1. Run command line or terminal
  2. Go to a folder where sql-db-table.sql file is located
  3. Type as following: your-mysql-location -u your-mysql-id -p < sql-db-table.sql
  • Ex: usr/local/mysql/bin/mysql -u root -p < sql-db-table.sql
  1. Type password

AVAILABLE FUNCTIONS

  1. Create a user (sign-up).
  • url: localhost:3000:/createUser
  • body: { “userId”: “yourId”, “password”: “yourPassword”, “fname”: “firstName”, “lname”: “lastName”, “email”: “[email protected]” }
  1. Login (sign-in).
  • url: localhost:3000/login
  • body: { “userId”: “yourId”, “password”: “yourPassword” }
  1. Logout (sign-out) (requires session).
  • url: localhost:3000/logout
  • header
    • key: x-access-token
    • value: yourToken
  • body: { “userId”: “yourId”, “password”: “yourPassword” }
  1. Update a user’s email or name (requires session).
  • url: localhost:3000/updateUser
  • header
    • key: x-access-token
    • value: yourToken
  • body: { “userId”: “yourId”, “password”: “yourPassword”, “fname”: “firstName”, “lname”: “lastName”, “email”: “[email protected]” }
  1. Retrieve project list (requires session).
  • url: localhost:3000/projects/list
  • header
    • key: x-access-token
    • value: yourToken
  • body: { }
  1. Create a project (requires session).
  • url: localhost:3000/projects/create
  • header
    • key: x-access-token
    • value: yourToken
  • body: { “title”: “projectTitle” }
  1. Retrieve a project (requires session).
  • url: localhost:3000/projects/project
  • header
    • key: x-access-token
    • value: yourToken
  • body: { “projectId”: “targetProjectId” }
  1. Create a task list (requires session).
  • url: localhost:3000/projects/project/createTaskList
  • header
    • key: x-access-token
    • value: yourToken
  • body: { “title”: “taskTitle”, “todo”: “taskToDo”, “taskListId”: “targetTaskListId” }
  1. Create a task (requires session).
  • url: localhost:3000/projects/project/taskList/createTask
  • header
    • key: x-access-token
    • value: yourToken
  • body: { “title”: “taskListTitle”, “projectId”: “targetProjectId” }
  1. Move Task within a List or between Lists (require session).
  • url: localhost:3000/projects/project/taskList/switchTaskWithinList
  • header
    • key: x-access-token
    • value: yourToken
  • body: { “taskListId”: “targetTaskListId”, “taskId”: “targetTaskId”, “switchOrder”: “targetSwitchOrder” }
  1. Move Task between Lists (require session).
  • url: localhost:3000/projects/project/taskList/moveTaskToOtherList
  • header
    • key: x-access-token
    • value: yourToken
  • body: { “taskListId”: “targetTaskListId”, “moveToTaskListId”: “targetMoveToTaskListId”, “taskId”: “targetTaskId” }
  1. Search Tasks (requires session).
  • NOT IMPLEMENTED YET

TODO

  1. IMPLEMENT Search Task
  2. IMPLEMENT Unit Test
  3. IMPLEMENT Integration Test
  4. Remove unnecessary files, remove unnecessary logs & re-arrange application structure
  5. Add encryption & decryption for user passwords
  6. Catch & fix bugs

Releases

No releases published

Packages

No packages published