Skip to content

Repository files navigation

CONNECC-api

Greenkeeper badgeTravisCI badgeContent

API endpoint for Connecc application

EndpointHTTPDescription
/contactsGETShow all contacts
/contactsPOSTAdd new contact
/contacts/:idDELETEDelete contact by id
/contacts/searchGETSearch contact by query
/connecc/devteamGETList 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

CREATEVIEWidentityASSELECT 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

CREATETABLEusers(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

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages