Coder Social home page Coder Social logo

cl0nebot / postit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jchinonso/postit

0.0 1.0 0.0 1.5 MB

PostIt is a simple application that allows friends and colleagues create groups for notifications. This way one person can post notifications to everyone by sending a message once.

License: MIT License

JavaScript 90.92% CSS 2.61% HTML 6.47%

postit's Introduction

Build Status Coverage Status Maintainability

PostIt

postit is a simple application that allows friends and colleagues create groups for notifications. This way one person can post notifications to everyone by sending a message once. The application allows people create accounts, create groups and add registered users to the groups, and then send messages out to these groups whenever they want.

image image

Development

The application was developed with NodeJs and Express is used for routing. The Postgres database was used with sequelize as the ORM The frontend was built using reactJs with redux framework.

API DOCUMENTATION

The API has routes, each dedicated to a single task that uses HTTP response codes to indicate API status and errors.

API Features

The following features make up the PostIt Application Api:

Authentication

  • It makes use of jsonwebtoken(jwt) for authentication
  • It generates a token on successful login and send it as part of response
  • It accepts the generated token before given access to all the protected routes
Users
  • It allows users to be created.
  • It allows users to login
Groups
  • It allows new Group to be created by users.
  • It ensures all Groups are accessible based on the permission specified.
  • It allows creator of group to add members to the group
  • It ensures members of group can add and retrieve messages to group and from group

Below are the API endpoints and their functions

EndPoint Functionality
POST /api/user/signin Logs a user in.
POST /api/user/signup Create a new user.
GET /api/user Get all users.
POST /api/group Creates a new group.
POST /api/group/groupid/user Add user to group.
POST /api/group/groupid/message Add message to group.
GET /api/group/groupid/message Get all messages that belongs to group.

Routes

  • POST /api/user/signup Use this route to create an account. The following fields are required:

    • username The first name of the new user
    • email Email address of the new user
    • password A secure password
    • phoneNumber Phone number
  • POST /api/user/signin Use this route to sign in to the application. The following fields are required:

    • email Email address of the new user
    • password A secure password
  • POST /api/group Use this route to create a new group. The following fields are required:

    • name The title of the group
    • description A description of the purpose of the group
  • POST /api/group/<groupId>/user Use this route to add a user to a pre-existing group

    • username The username of a user registered on the application
  • POST /api/group/<groupId>/message Use this route to post a message to a group

    • content The body of the message to be posted to the group
  • GET /api/group/<groupId>/messages Use this route to get messages made to a group

  • GET /api/user Use this route to load all registered members

Technologies Used

  • NodeJS: is an open-source, cross-platform JavaScript run-time environment for executing JavaScript code on the server-side.
  • Javascript ES6: ES6 is the sixth major release of the javascript language specification. It enables features like constants, arrow functions, template literals, spread opeartor, etc.
  • React: Facebook open source, efficient, javascript library for building front-end projects.
  • PostgreSQL: PostgreSQL is a powerful, open source object-relational database system (ORDBMS) that offers modern database features such as complex queries, foreign keys, etc.
  • Sequelize: Sequelize is a promise-based ORM for Node.js that supports different dialects such PostgreSQL, MySQL, and SQLite.
  • Babel: Babel transpiles es6 codes to es5.
  • Webpack: Webpack is used to bundle modules and does tasks automation.
  • Axios: Axios is an http client library used in consuming API.

Installation

  1. Ensure you have NodeJs and postgres installed
  2. Clone the repository https://github.com/jchinonso/PostIt
  3. Change your directory cd PostIt
  4. Install all dependencies npm install
  5. Start the app npm run start:dev for development Or
  6. Run npm start to use transpiled code
  7. Use postman to consume the API

Tests

  • The tests have been written using Mocha framework and Chai assertion library
  • Run the test with npm test

Limitations

  • Group creator cannot remove users from groups
  • Users cannot update their profile
  • Users cannot deactivate their accounts

Coding Style

  • Airbnb: Airbnb is a coding style guide that guides developers to write clean codes

How to Contribute

  • Fork this repository.
  • Clone it.
  • Create your feature branch on your local machine with git checkout -b your-feature-branch
  • Push your changes to your remote branch with git push origin your-feature-branch
  • Open a pull request to the master branch, and describe how your feature works
  • Refer to this wiki for proper GIT CONVENTION

Ensure your codes follow AirBnB Javascript Styles Guide

The full API documentation can be viewed at here

Author

Johnson Chinonso

postit's People

Contributors

andela-jchinonso avatar jchinonso avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.