Skip to content

arizkinewbie/TECHTEST_BE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Technical Test – Backend Engineer

About

Cake Store RESTful API is a backend application built using Go programming language and MySQL database. It provides a set of endpoints to manage cake data in a cake store. With this API, you can perform operations such as retrieving all cakes, getting a cake by ID, adding a new cake, updating an existing cake, and deleting a cake.

This API follows RESTful guidelines and is designed to be scalable and easy to use. It leverages the power of Go to provide efficient and high-performance data operations. The MySQL database is used to store and retrieve cake data.

I do not hide some files for grading purposes

Build With

Installation

  1. Clone the repository:

    git clone https://github.com/arizkinewbie/TECHTEST_BE.git
  2. Navigate to the project directory:

    cd TECHTEST_BE
  3. Install the dependencies:

    go mod tidy
  4. Set up the database:

    • Create a MySQL database for the application. Berikut adalah struktur SQL untuk tabel "cakes":

      Field Type Null Key Default Extra
      id INT NO PRIMARY None AUTO_INCREMENT
      title VARCHAR(255) NO None
      description TEXT YES NULL
      rating FLOAT YES NULL
      image VARCHAR(255) YES NULL
      created_at DATETIME YES CURRENT_TIMESTAMP DEFAULT_GENERATED
      updated_at DATETIME YES CURRENT_TIMESTAMP DEFAULT_GENERATED
      deleted_at DATETIME YES NULL
    • Update the database configuration in the .env file.

  5. Run the application:

    go run main.go
  6. The API will be accessible at http://localhost:8080.

Usage

Use a tool like Postman to send HTTP requests to the API endpoints.

Method Endpoint Description
GET /cakes Get all cakes
GET /cakes/{id} Get a cake by ID
POST /cakes Add a new cake
PUT /cakes/{id} Update a cake
DELETE /cakes/{id} Delete a cake

Documentation

API Name Link
Cake Store RESTFul API Run in Postman

Deployment URL : https://steam-mantis-381321.et.r.appspot.com/

About

a Cake Store RESTFul API Service within the specified time

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages