Skip to content

dungnh3/mfv-codingchallenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mfv-codingchallenge

Overview

Coding Challenge

Table of Contents

Getting Started

Installation

Prerequisites

Usage

Initialize database

Use the following command to init an instance database, and create tables

make init-db
make migrate-up
  • MySQL as our database, the schema will be stored in migrations
  • We use migrate read migrations from sources and apply them in correct order to a database.

Starting the Server

To start the SampleService Server, use the following command:

go run main.go server

API Endpoints

  • GET /users/:id: Retrieve user information by id

  • GET /users/:id/accounts: Retrieve a list account of user

  • GET /accounts/:id: Retrieve account information by id

  • POST /users/register: Add a new user to the database

{"name": "user name"}
  • POST /users/:id/accounts: Add a new account to the database
{"name": "user name"}

Testing

To run mock-tests, use the following command:

make mock-test 

To run integration-tests, use the following command:

make test-integration

Configuration

Contributing

We welcome contributions. To contribute to this project, please follow these steps:

- Fork the repository
- Create a new branch for your feature: git checkout -b feature/your-feature-name
- Commit your changes: git commit -m 'Added a new feature'
- Push to the branch: git push origin feature/your-feature-name
- Create a pull request

Please follow our code of conduct and coding style guidelines.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published