Teamwork is an internal social network for organizations’ employees. The goal of this application is to facilitate more interaction between colleagues and facilitate team bonding.
Teamwork requires Node.js 10.0+. Checkout the docs to see installation guidelines. The code has been built with simplicity, reusability and code quality in mind.
- Clone the repository using
git clone https://github.com/sebalu/teamwork.git
- On your command line, switch to the app root directory
- Install dependencies using
npm install
- create an
.env
file and specify theDATABASE_URL
,DB_TEST
andsecretkey
. - DB URL format:
'postgres://postgres:mynameis@localhost:5432/tw-test'
. - Parameters in the DB URL are the DB type, user, password, DB server URL instance and the DB name.
- Run tests using
npm run test
- Start the development server using
npm run dev
- Use postman to test the endpoints listed below
The following endpoints have been implemented:
Request header:
Content-Type: application/json
METHOD | Endpoint | Description |
---|---|---|
POST | /auth/signup | Register an account |
POST | /auth/signin | Sign in |
Request headers:
Content-Type: application/json
Authorization: Bearer<space>token
METHOD | Endpoint | Description |
---|---|---|
POST | /articles | Create a new article |
PATCH | /articles/:id | Modify a specific article |
DELETE | /articles:id | Delete a specific article |
GET | /articles/:id | Get a specific article |
GET | /feeds?page=<> | Get paginated articles |
POST | /articles/:id/comments | Comment on a specific article |
GET | /articles/category?category=<> | Get articles in a specific category |