Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microservice Name

A brief description of what the microservice does.

Table of Contents

New Service Repo Setup

Duplicating the Repo

Labels

In order to keep labels consitent across micro services, we will use the template available in the docs folder of this repo to auto populate the new repo with labels. After running "npm install", run the following commands from the server directory:

    npx ghlbl -o NACAGA -r <name-of-new-repo> -t <organization-pat> -d
    npx ghlbl -o NACAGA -r <name-of-new-repo> -t <organization-pat> -i docs/labels.json

Overview

Provide a high-level overview of the microservice, including its purpose, key features, and any important concepts.

Endpoints

Base URL

Endpoint 1

  • URL: /endpoint1

  • Method: GET

  • Description: Description of what this endpoint does.

  • Query Parameters:

    Parameter Type Description
    param1 String Description of param1
    param2 Number Description of param2
  • Example:

    Request

    {
        "headers": {},
        "body": {
            "body-element-1": "element-1"
        }
    }
    {
        "result": {
            "response-element-1": "example response"
        }
    }

Database

Setup

These are the steps to follow to get the database running in a local docker container.

Database Type

The microservice uses a relational database system, specifically MySQL.

Database Schema

The following tables constitute the database schema:

Users Table

Stores information about users.

Column Type Description
id INT Unique user identifier
username VARCHAR User's username
email VARCHAR User's email address
created_at DATETIME Date and time of user creation

Relationships

  • The Posts table has a foreign key (user_id) referencing the Users table's id.

Getting Started

Prerequisites

Before you begin, ensure you have the following prerequisites installed:

  • Node.js (version X.X.X or higher)
  • npm (version X.X.X or higher)
  • MySQL (if using a MySQL database)

Installation

  1. Clone the repository:

    git clone https://github.com/NACAGA/<new-microservice>.git
  2. Change into the project directory:

    cd <new-microservice>
  3. Install dependencies:

    npm install

Environment Variables

Make sure to include a .env file in the root directory of the project (Same directory as this README). The following environment variables should be present:

HOST=localhost

Adjust the values based on your specific configuration.

Running the Microservice

To run the service locally on your machine, run the following command inside of the server directory.

npm start

To run the service in Docker containers the following command from the base directory:

docker compose up --build --force-recreate

To remove all containers afterwards, run:

docker compose down

To spin up the microservice in a local docker container, follow these steps:

  1. Run this command in the server directory
    docker ...

Testing

Provide instructions on how to perform tests from the test suite here.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages