Skip to content

ugonnathelma/SMS-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SMS-api

SMS-api is an sms management system that enables users send an sms from to each other.

Features!

  • Contacts can be created with the following fields:
    • First name
    • Last name
    • Phone number
  • Contact can send an sms to another existing contact
  • The status of the message is set as sent when a message has been sent
  • When a contact is deleted, all messages associated with that contact are also deleted

Tools and Modules Required

  • NodeJs - Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.
  • Express - fast node.js network app framework
  • PostgreSQL- The Relational database
  • Sequelize.js - An ORM to interface with PostgresQL
  • Postman - To test APi's
  • Terminal or Command Line
  • Text Editor or IDE

Installation

SMS-api requires you have Node.js v7+. Check your node version by typing node -v

$ git clone https://github.com/ugonnathelma/SMS-api.git
$ cd <into folder>
$ npm install

If you have postgres db already online, then copy the db url and add it to the env file as as DATABASE_URL= '<link from dashboard>' else if you are using postgres locally, then you need to do the following:

  1. Create a db: Type creadtedb <db name> in your terminal
  2. Add an example of the following to your .env file, Note that DB_PASSWORD is optional
DB_PASSWORD=
DB_USER=
DB_NAME=
DB_TEST_NAME=
DB_PORT=5432
NODE_ENV=development
HOST=127.0.0.1

Run migration

$ sequelize db:migrate

Start the server.

$ npm start

To run Tests locally,

$ npm test

Endpoints

VERB URL ACTION
POST /api/contact Creates a new contact
DELETE /api/contact/:phoneNumber Deletes contact
POST /api/contact/:senderNumber/message/:receiverNumber Create a message
DELETE /api/message/:id Deletes a message
GET /api/message/:id Gets a message

Apiary Documentation

https://app.apiary.io/smsapi24

Development

Want to contribute? Great!

Future Improvements

  • Write MORE Tests
  • Allow messgae to be sent to multiple recipients
  • Enable messgaes to be saved as draft so it can be editted
  • Add UI

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors