an internal social network for employees of an organization.
Teamwork is an internal social network for employees of an organization. The goal of this application is to facilitate more interaction between colleagues and promote team bonding.
- Admin can create an employee user account.
- Admin/Employees can sign in.
- Employees can post gifs.
- Employees can write and post articles.
- Employees can edit their articles.
- Employees can delete their articles.
- Employees can delete their gifs post.
- Employees can comment on other colleagues' article post.
- Employees can comment on other colleagues' gif post.
- Employees can view all articles and gifs, showing the most recently posted articles or gifs first.
- Employees can view a specific article.
- Employees can view a specific gif post.
- NodeJS/ExpressJS
- PostgreSQL
- Express-Validator (for server-side validation)
- Mocha & Supertest (for automated testing)
- Swagger (for API documentation using openapi 3.0.0 spec)
Ensure you have the following installed on your local machine:
-
Clone or fork repo🤷♂
- git clone https://github.com/meetKazuki/Teamwork.git - cd Teamwork - npm install
-
Create a PostgreSQL database by running the command below in
psql
createdb -h localhost -p 5432 -U postgres <database-for-dev>
-
Create/configure
.env
environment with your credentials. A sample.env.example
file has been provided to get you started. Make a duplicate of.env.example
and rename to.env
, then configure your credentials (ensure to provide the correct details). -
Run
npm run dev
to start the server and watch for changes
Test specs are implemented using mocha & chai.
-
To test or consume the API locally, you can make use of Postman to simulate a front-end client.
-
You can also run an automated test. Just ensure to follow the step below
createdb -h localhost -p 5432 -U postgres <database-for-test>
-
Fire up the tests by running
npm test
.npm test
performs a single full test suite run, including code coverage reporting.
All API requests are made by sending a secure HTTPS request using one of the following methods, depending on the action being taken:
POST
Create a resourceGET
Get a resource or list of resourcesPATCH
Update a resourceDELETE
Delete a resource
For POST
and PATCH
requests, the body of your request may include a JSON payload.
Each response will be returned with one of the following HTTP status codes:
200
OK
The request was successful400
Bad Request
There was a problem with the request (security, malformed)401
Unauthorized
The supplied API credentials are invalid403
Forbidden
The credentials provided do not have permissions to access the requested resource404
Not Found
An attempt was made to access a resource that does not exist in the API412
Authorization Header not set
An attempt was made to access a protected route without providing a token500
Server Error
An error on the server occurred
The Teamwork API is open-sourced software licensed under the MIT license.
If for some reason you find this repo useful, please give me a star. Also, if you have any issue, do well to call my attention to it🙏