Coder Social home page Coder Social logo

fikranakbar / online-learning-restful-api Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 459 KB

Golang Portofolio Project: RESTful API For Online Learning Application

Go 99.93% Shell 0.07%
backend dependency-injection echo go golang gorm layered-architecture mysql restful-api midtrans

online-learning-restful-api's Introduction

Online Learning RESTful API

Golang Portofolio Project: RESTful API For Online Learning Application

Table of Contents

  1. Built With
  2. Project Structure
  3. Getting Started
  4. Deployment and Documentation
  5. Features Roadmap

Built With

  • Go: 1.19.3^
  • MySQL : 8.0.32^
  • Wire: 0.5.0^

(back to table of contents)

Project Structure

/app/database

Information about database migration and seeder.

/app/router

All the route of the api.

/config

Configuration file that loaded in form of struct from env file.

/controller

Directory for the functions to process request from registered routes.

/di

Dependency injection for making automation in function provider.

/exception

Error handling from the api failed request.

/helper

Small functions like converter, panic helper, etc.

/model

Objects that interprets the model in the database and formats the request or response.

/repository

Layer that handling logic interaction with the database.

/service

Layer for handling main business login of the request routes.

/test

Integration tests for all the api.

(back to table of contents)

Getting Started

Prerequisites

  1. First we need to clone the repo into our local machine
git clone https://github.com/FikranAkbar/online-learning-restful-api.git
  1. then move to folder just created
cd online-learning-restful-api/
  1. then download all the required package
go mod tidy

Run Project in Development Environment

go run main.go

Environment Variables

Configuration file is write using environment variables. This file must be exists in root directory with complete example file as below:

#filename: app.env

DB_HOST= <<YOUR DB HOST>>
DB_PORT= <<YOUR DB PORT>>
DB_USER= <<YOUR DB USER>>
DB_PASSWORD= <<YOUR DB PASSWORD>>
DB_NAME= <<YOUR DB NAME>>
DB_NAME_FOR_TEST= <<YOUR DB TEST NAME>>

MIDTRANS_CLIENT_KEY= <<YOUR MIDTRANS CLIENT KEY>>
MIDTRANS_SERVER_KEY= <<YOUR MIDTRANS SERVER KEY>>

Database Migration

  1. Make file app.env and copy content from example.env

  2. Update the app.env fields based on your local

  3. Run the test in app/database/db_test.go

go test app/database/db_test.go

(back to table of contents)

Documentation

(back to table of contents)

Features Roadmap

  • Authentication
  • Course (Module, Webinar, Quiz)
  • Expert Mentor
  • Industry Insight Article
  • Payment (Course Transaction)

(back to table of contents)

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.