Git Product home page Git Product logo

awokenfix's Introduction

AWOKEN News Api

By Maryanne Njuguna

Description

Awoken is a rest REST API for querying and retrieving scoped news and information.

User Stories

As a user, you should be able to create the following objects:-

  • Departments
  • News:
    • General News (Information affecting the whole company)
    • Department news (Objects within Object)
  • Users:
    • As a user you should see:
    • individual users, their details, i.e position in the company, their roles, which department(s) they are associated with etc
    • specific information such as the Departments name, description, number of employees in the department.
    • all users from a specific Department, the news relating to that department or a link to a page with said news (for tidiness).
    • As a user, you will be able to Post some news relating to a department.

Known Bugs

Report any bugs by hovering to https://github.com/themaryanjuguna/Awoken/issues and create a new issue.

Setup/Installation Requirements

  • Internet connection
  • access to a browser
  • fork from https://github.com/themaryanjuguna/Awoken.git
  • To use the postgres database run the create.sql script in the create.sql folder in the project directory or run the following:
  • For testing use Postman desktop client to access the forked collection because their cloud client does not access local ports like http://localhost:4567.
  • In postman replace where indicated :id the number with the id you want to use in the path variables
  • Make sure you recreate the database in your local psql by running the psql commands above.

In Terminal PSQL:

psql -U postgres
\l
\dt
* CREATE DATABASE awoken;
* \c awoken;
CREATE TABLE users(id serial PRIMARY KEY, name varchar, profile varchar, position varchar, role varchar);
CREATE TABLE news(id serial PRIMARY KEY, title varchar, content varchar);
CREATE TABLE departments(id serial PRIMARY KEY, name varchar, profile varchar);

CREATE DATABASE awoken_test WITH TEMPLATE awoken;

Technologies Used

Some sample endpoint responses using the News and user Objects

Departments

#### Entry
{
"name":"HR",
"profile":"Manages Human Relations",
"deptId":id
}

#### Response
{"id":4,"name":"HR","profile":"Manages Human Relations","deptId":1}

User

#### Entry
{
"employeeId":"1",
"name":"Tim",
"profile":"outspoken",
"position":"IT Manager",
"role":"Technician"
}

#### Response
{
"id": 1,
"employeeId": 1,
"name": "Tim",
"profile": "outspoken",
"position": "IT Manager",
"role": "Technician"
}

News

#### Entry
`{
"id": 2,
"employeeId": 0,
"title": "Employee of the Month Award",
"content": "Award goes out to Tim"
}

#### Response
{
    "id": 3,
    "employeeId": 0,
    "title": "NHIF update",
    "content": "Award goes out to Tim"
}

Author Details

Maryanne Njuguna Linktree Profile

License

Licensed by MIT Copyright (c) 2022 themaryanjuguna

awokenfix's People

Watchers

 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.