Skip to content

ApplETS/Backend-Hello

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backend Hello

This API allows to interface the database and handles business functions

Installation

Different ways can be used to spin up a backend Hello API.

Create the DB

First of, you need to create a postgreSQL DB if it's not already done.

⚠️ If your database is already created and running, you can skip this step and directly go to Run the image.

Access this repository to get started!

Installation introduction

There is two ways you can install the API:

  • Using a docker image: Docker Installation
    • This method doesn't allows you to modify easily the existing code and is more suited for a local server when there is only front-end development to be done.
  • Using the classic approach with Visual Studio: Local Installation

🐳 Docker Installation

Start by pulling the image from docker hub

docker pull ghcr.io/applets/backend-hello:<VERSION>

multiple versions are available, you can check them here

The default one is latest but for cutting edge updates you can use main branch name.

Running the docker image

You'll need to setup the environment variables in the .env file

Simply copy and paste the .env.template file, rename it to .env and fill it with the correct value.

Then, run the image on your local machine

docker run --env-file .env --restart always -d -p 8080:8080 -v <PATH_TO_VOLUME_FOLDER>:/app/volume:rw --name ps-api ghcr.io/applets/backend-hello:<VERSION>

You can navigate to http:https://localhost:8080/swagger to check if the API is running correctly!

👷 Local Installation

You will need a couple of things to get started developing and maintaining Hello-Backend.

  • Docker (suppose to be already installed at this point)
  • Git
  • Visual Studio 2022 or above version.
    • Make sure to check the ASP.NET and web development component
image
  • .NET8 (which is supposed to come package with VS2022, but in case it's not.)

Setup

  1. Open Bash, navigate to somewhere you like:
cd path/to/repo
  1. Clone the repo using an ssh key or without:
# With an SSH Key
git clone [email protected]:ApplETS/Backend-Hello.git
# Without an ssh key
git clone https://github.com/ApplETS/Backend-Hello.git
  1. Open the .sln in Visual Studio 2022
  2. You'll now need to create your .env file from the .env.template. You can ask help to fill the empty values from a project maintainer.

Running the app using Visual Studio

To run the app make sure to check Docker to run it using docker:

image

Then click on image to run the API.

You can navigate to http:https://localhost:8080 where you're app is running.