Skip to content

ariebrainware/connecc-api

 
 

Repository files navigation

CONNECC-api

Greenkeeper badge TravisCI badge Content

API endpoint for Connecc application

Endpoint HTTP Description
/contacts GET Show all contacts
/contacts POST Add new contact
/contacts/:id DELETE Delete contact by id
/contacts/search GET Search contact by query
/connecc/devteam GET List Connecc DevTeam

Feature

Adding Database Feature which is contains Connecc DevTeam's Information

+------+----------------+----------+-------------+------------+--------------------+----------------------+
|   id | name           | gender   | from_date   | to_date    | address            | title                |
|------+----------------+----------+-------------+------------+--------------------+----------------------|
|    1 | Arie Brainware | M        | 2018-08-07  | 2020-08-07 | Nowhere            | Full-stack Developer |
|    2 | Indro Lie      | M        | 2018-08-07  | 2020-08-07 | Perumahan Baloi    | Backend Developer    |
|    3 | Abba Yosua     | M        | 2018-08-07  | 2020-08-07 | Perumahan Bengkong | Frontend Developer   |
+------+----------------+----------+-------------+------------+--------------------+----------------------+

Not contain all field because layouting problem

SQL VIEWS

CREATE VIEW is an alternative to modify your show result

Input

CREATE VIEW identity AS SELECT name,gender,from_date,address,title,email,github from team_members;
SELECT * FROM identity;

Output

+----------------+----------+-------------+--------------------+----------------------+-----------------------+---------------------------+
| name           | gender   | from_date   | address            | title                | email                 | github                    |
|----------------+----------+-------------+--------------------+----------------------+-----------------------+---------------------------|
| Arie Brainware | M        | 2018-08-07  | Nowhere            | Full-stack Developer | dev_ace@protonmail.ch | https://github.com/ariebrainware|
| Indro Lie      | M        | 2018-08-07  | Perumahan Baloi    | Backend Developer    | indrolie@gmail.com    | https://github.com/indrolie |
| Abba Yosua     | M        | 2018-08-07  | Perumahan Bengkong | Frontend Developer   | abbasiagian@gmail.com | https://github.com/abbayosua|
+----------------+----------+-------------+--------------------+----------------------+-----------------------+---------------------------+

Describe table team_members

Using DESC SQL syntax to show table structure

Input

DESC team_members;

Output

+-----------+---------------+--------+-------+-----------+----------------+
| Field     | Type          | Null   | Key   |   Default | Extra          |
|-----------+---------------+--------+-------+-----------+----------------|
| id        | int(4)        | NO     | PRI   |    <null> | auto_increment |
| name      | varchar(30)   | YES    |       |    <null> |                |
| gender    | enum('M','F') | YES    |       |    <null> |                |
| from_date | date          | YES    |       |    <null> |                |
| to_date   | date          | YES    |       |    <null> |                |
| address   | text          | YES    |       |    <null> |                |
| title     | varchar(20)   | YES    |       |    <null> |                |
| email     | varchar(30)   | YES    |       |    <null> |                |
| github    | varchar(40)   | YES    |       |    <null> |                |
+-----------+---------------+--------+-------+-----------+----------------+

Describe table users

Table user will contain user info account

Input

CREATE TABLE users(id int(4) PRIMARY KEY auto_increment, username varchar(20), password varchar(32), email VARCHAR(30));
DESC `users`;

Output

+----------+-------------+--------+-------+-----------+----------------+
| Field    | Type        | Null   | Key   |   Default | Extra          |
|----------+-------------+--------+-------+-----------+----------------|
| id       | int(4)      | NO     | PRI   |    <null> | auto_increment |
| username | varchar(20) | YES    |       |    <null> |                |
| password | varchar(32) | YES    |       |    <null> |                |
| email    | varchar(30) | YES    |       |    <null> |                |
+----------+-------------+--------+-------+-----------+----------------+

Table users

Input

SELECT * FROM `users`;

Output

+------+------------+---------------+--------------------+
|   id | username   | password      | email              |
|------+------------+---------------+--------------------|
|    1 | paulkece   | kangenmama123 | paulkece88@fbi.gov |
|    2 | jenkins    | blackst0ne    | jenkins@nsa.gov    |
+------+------------+---------------+--------------------+

JSON

Request body example:

{
  "name": "Alpha",
  "phoneNumber": "+62-8-1234-56789",
  "email": "alpha@alphabet.com",
  "address": "Alphabet Inc, USA"
}

How to install

First of all you need to follow this link to install nvm . How to use nvm?

Then you can simply clone this repository via terminal with syntax:

git clone https://github.com/ariebrainware/connecc-api.git

then after that, run this syntax in your terminal:

nvm install node && cd connecc-api && chmod +x setup.sh && sudo ./setup.sh

and then, import database connecc.sql using syntax:

mycli -u yourusername < connecc.sql

Enter your database user's password then you're good to go

About

API and Backend section for Connecc application

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 98.6%
  • Shell 1.4%