An sms application that allows users send and receive messages.
The project structure follows the MVC (Model-View-Controller) pattern.
├── src
│ ├── config
│ │ └── config.js
│ ├── controllers
│ │ └── ContactController
│ │ │ └── ContactController.js
│ │ └── SmsController
│ │ │ └── SmsController.js
│ ├── helpers
│ │ └── errorHandler.js
│ ├── app.js
│ ├── middlewares
│ │ └── ContactValidator.js
│ │ └── SmsValidator.js
│ │ └── Authentication.js
│ ├── database
│ │ └── migrations
│ │ │ └── 20190821232415-create-contact.js
│ │ │ └── 20190821232739-create-sms.js
│ │ └── seeders
│ │ └── models
│ │ └── index.js
│ │ └── contact.js
│ │ └── sms.js
│ │ └── ContactController
│ │ │ └── contactRoute.js
│ │ │ └── index.js
│ │ └── SmsController
│ │ │ └── smsRoute.js
│ │ │ └── index.js
- Node.js
- npm
- PostgresDB
- Sequelize
$ git clone https://github.com/uchemukolo/smsManagementApplicationAPI.git
$ cd smsManagementApplicationAPI
$ npm install
$ npm start # For development purpose
You should now be able to access the API via http://localhost:port/api/v1/
NOTE: Create a .env
file configuration following the .env.sample
.
SMS:
- person sending sms
- person receiving sms
- message of sms
- sms status
Contact:
- name of person
- phone number of person
The following relationships are represented in the model:
- All sms sent by a Contact are linked to them
- All sms sent to a Contact are linked to them
- Deleting a contact removes the messages they sent and references to messages they received.
HTTP VERB | ENDPOINTS | DESCRIPTION | QUERY |
---|---|---|---|
GET | /api/v1/contacts/:contactId | Gets a contact | |
POST | /api/v1/contacts/signup | Creates a contact | |
POST | /api/v1/contacts/login | logins a contact | |
DELETE | /api/v1/contacts/delete/:contactId | Deletes a contact | |
GET | /api/v1/messages/sent | Gets a contact sent sms | |
GET | /api/v1/messages/received | Gets a contact received sms | |
GET | /api/v1/message/:messageId | Gets a particular contact sms | |
POST | /api/v1/messages/:phoneNumber | Sends sms to a contact |