Giter VIP home page Giter VIP logo

candle's Introduction

Candle

This is a project demonstrating RESTful API using the Go programming language with the Gin web framework and GORM for database interactions.

Prerequisites

  • Go installed on your machine
  • Mysql RDBMS installed on your machine
  • npm http-server installed globally in your machine

Installation

  1. Clone the repository :

    git clone https://github.com/Abyanzhafran/candle.git
    git checkout backend-experimental
    cd backend
  2. run this for synchronize the package :

    go mod tidy
  3. Configure the database:

    • Config you database setting like .env.example file.

Usage

  1. Run the application:

    go run main.go
  2. Run file storage server:

    http-server -p 8081
  3. The Go API will be available at http://localhost:8080.

Endpoints

  • For detailed api endpoint, look at api-spec.yml file, and run it using swagger editor.

How does it work ?

  • It can CRUD book entity based on provided endpoint on apis-spec.yml
  • The user entity have Ge tAllUsers, GetUserByUsername, and UserLogin api endpoint.
  • There are an image_data folder and uploaded_image folder.
  • The image_data folder is just the example book images that you can use for updating the book.
  • The uploaded_image folder, is used to visualize online file storage, so the added book cover, saved at that folder. It also applies to CRUD method for the images.

Notes

  • When you try to update the book data in postman using PUT method and for example you don't want to update the image file, then don't include the image file as form-data, and keep the "imageurl" field the same as related image file in database.
  • When you try to update the book data in postman using PUT method and for example you want to update the image file also, then include the image file and make the "imageurl" field as empty string like this "".

candle's People

Contributors

abyanzhafran avatar

Stargazers

Alexander avatar

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.