SMS-api is an sms management system that enables users send an sms from to each other.
- 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
- 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
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 installIf 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:
- Create a db: Type
creadtedb <db name>in your terminal - 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:migrateStart the server.
$ npm startTo run Tests locally,
$ npm test| 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 |
https://app.apiary.io/smsapi24
Want to contribute? Great!
- 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
MIT