This project is created to fulfill Binar Javascript Challenge 7.
ChatApp is an open source platform that enable users send message to other user in real-time.
- Users can signup and login to their accounts
- Verified user can access
/api/v1/chats
endpoint to start send message
- Clone this repository here.
- The
main
branch is the most stable branch at any given time, ensure you're working from it. - Run
npm install
to install all dependencies - You can either work with cloud database or use your locally installed
PostgreSQL
. Do configure to your choice in the application entry file. - Create an .env file in your project root folder and add your variables. See .env.example for assistance.
This project is available on Railway, use this base URl on your postman :
OR
- Run
npm start
to start the application. - Connect to the API using Postman on port according to your configuration.
Column | Data Type | Value | Description |
---|---|---|---|
name | String | Required | user name |
String | Required | user email (unique) | |
password | String | Required | user password |
phoneNumber | String | Required | user phone number (unique) |
dob | DateTime | Required | date of birth |
profilePhoto | String | Default null | profile photo url |
isVerified | Boolean | Default false | acccount status |
role | Enum (ADMIN, USER) | Default USER | account role |
receiverPhoneNumber | String | - | phone number to receive message |
message | String | - | a message |
HTTP Verbs | Endpoints | Payload | Action |
---|---|---|---|
POST | /api/v1/auth/register | name, email, password, phoneNumber, dob | To sign up a new user account |
POST | /api/v1/auth/login | email, password | To login an existing user account (do email verification first) |
POST | /api/v1/auth/forgot-password | To request reset password | |
POST | /api/v1/auth/reset-password/:resetToken | email, password | To reset old password |
POST | /api/v1/chats | receiverPhoneNumber, message | To start send message to other user |
Events | Endpoints | Action |
---|---|---|
receiver phone number | / | To listen message from /api/v1/chats |
- NodeJS This is a cross-platform runtime environment built on Chrome's V8 JavaScript engine used in running JavaScript codes on the server. It allows for installation and managing of dependencies and communication with databases.
- ExpressJS This is a NodeJS web application framework.
- PostgreSQL This is a open source object-relational database system with over 35 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.
- Prisma Is a modern database toolkit that simplifies and accelerates database workflows. It provides a type-safe and auto-generated query builder that allows developers to interact with databases using programming languages like TypeScript, JavaScript, and others..
This project is available for use under the MIT License.