Skip to content

zoltan-nz/koa-ts-contacts-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

koa-ts-contacts-app

Building a simple contact management REST API using Node.js, TypeScript, Koa.js.

Requirements

  • MVC pattern
  • Dependency Injection
  • Authentication
  • Database, MongoDB support, migration
  • Models: Contact, Category
  • REST API, Json interface
  • Unit tests

Useful links:

Packages

Build:

  • TypeScript
  • TSLint
  • ts-node
  • chockidar
  • concurrently

Using direct command line tools with npm script.

Test:

  • Jest (or Mocha)

Core:

  • Koa

Database:

  • Sequalizer
  • Mongoose

Authentication

  • Passport?

Requirements

Data models

  • contact
  • category
  • user
Contact
- id
- name (string)
- email (string)
- category (belongsTo)

Category
- id
- name
- contacts (hasMany)

User
- id
- username
- password
- email

Resource endpoints

path method
/api/categories GET list all record
/api/categories POST create a new category record
/api/categories/:id GET get the individual record
/api/categories/:id PUT update the whole record
/api/categories/:id DELETE get the individual record
/api/contacts GET
/api/contacts POST
/api/contacts/:id GET
/api/contacts/:id PUT
/api/contacts/:id DELETE

Authentication

Following Passport.js patterns: http://www.passportjs.org/docs/authenticate/

Changelog

  • Create /api/categories route
    • Add test
    • Add implementation

Other Notes

About

REST API demo application with TypeScript, Koa.js

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published