https://github.com/matrix278/wallestertestapp
Wallester test - web application having CRUD operations under customer object
https://github.com/matrix278/wallestertestapp
bootstrap4 crud database database-schema golang html-css-javascript middleware postgresql rest router
Last synced: 10 days ago
JSON representation
Wallester test - web application having CRUD operations under customer object
- Host: GitHub
- URL: https://github.com/matrix278/wallestertestapp
- Owner: Matrix278
- Created: 2020-06-25T12:58:36.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-01-31T13:44:09.000Z (about 5 years ago)
- Last Synced: 2025-04-10T22:49:25.018Z (about 1 year ago)
- Topics: bootstrap4, crud, database, database-schema, golang, html-css-javascript, middleware, postgresql, rest, router
- Language: Go
- Homepage: wallester-test-app.vercel.app
- Size: 58.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Wallester test
Web application having CRUD operations under customer object
### Technologies:
- Go language
- PostgreSQL DB
- HTML
- CSS
- JS
- Bootstrap 4
### Libraries:
- github.com/gorilla/mux
- github.com/lib/pq
### PSQL DataBase data:
- host: localhost
- port: 5432
- user: martin
- password: qweasdzxc
- DB name: application
### Table data:
```
CREATE TABLE customers (
id SERIAL PRIMARY KEY,
first_name VARCHAR(100) NOT NULL,
last_name VARCHAR(100) NOT NULL,
birth_date TIMESTAMP NOT NULL,
gender VARCHAR(10) NOT NULL,
email VARCHAR(100) UNIQUE NOT NULL,
address VARCHAR(200)
);
INSERT INTO customers(
first_name,
last_name,
birth_date,
gender,
email,
address
)
VALUES (
'Test',
'Tester',
'2016-06-22 19:10:25',
'Male',
'test@tester.com',
'Test City address'
);
```
1. (MODELS folder) The **models** package will store the database schema. Using **struct** type to represent or map the database schema in golang.
2. (MIDDLEWARE folder) The **middleware** package is the bridge between APIs and Database. This package will handle all the db operations like Insert, Select, Update, and Delete (CRUD).
3. (ROUTER folder) In the **router** package defines all the api endpoints.
4. (MAIN file) The **main.go** is server. It will start a server on **8080** port and serve all the **Router**.
### Routes:
1. localhost:8080/customers, GET ALL CUSTOMERS ( GET )
2. localhost:8080/customer/{id}, GET CUSTOMER ( GET )
3. localhost:8080/customer/create, CREATE CUSTOMER ( POST )
4. localhost:8080/customer/{id}/update, UPDATE CUSTOMER BY ID ( PUT )
5. localhost:8080/customer/{id}/delete, DELETE CUSTOMER BY ID ( DELETE )