Skip to content

Mariovido/portfolio-backend

Repository files navigation

PORTFOLIO API

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Deploy
  5. License
  6. Contact

About The Project

This repository will be the repository containing the the backend of the Portfolio.

The main functionality of this app is to make an easy API where you can retrieve the data from a database.

Built With

The frameworks/libraries used to complete this project are:

(Back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

Before installing the software you must have installed the npm package. You can do it using the next command.

  • npm
    npm install --global yarn

Installation

The steps to get working the project are the following ones:

  1. Clone the repo
    git clone https://github.com/Mariovido/portfolio-backend.git
  2. Run the following command.
    yarn install
  3. Create two .env file called .env.stage.dev and .env.stage.prod on the root directory and fill the fields with your data.
    STAGE="ENTER YOUR STAGE (dev | prod)"
    ENV_FILE_NAME="ENTER YOUR ENV FILE NAME"
    
    HOST_PORT="ENTER YOUR HOST_PORT"
    JWT_SECRET="ENTER YOUR JWT SECRET"
    
    DB_URL="ENTER YOUR DATABASE URL"
    DB_HOST="ENTER YOUR DATABASE HOST"
    DB_PORT="ENTER YOUR DATABASE PORT"
    DB_DATABASE="ENTER YOUR DATABASE NAME"
    DB_USERNAME="ENTER YOUR DATABASE USERNAME"
    DB_PASSWORD="ENTER YOUR DATABASE PASSWORD"
    
    POSTGRES_DB="ENTER YOUR POSTGRES DATABASE NAME"
    POSTGRES_USER="ENTER YOUR POSTGRES USERNAME"
    POSTGRES_PASSWORD="ENTER YOUR POSTGRES PASSWORD"
    
    FRONTEND_URL="ENTER YOUR FRONTEND URL"
  4. Create the database by running the following command
    docker-compose --env-file .env.stage.dev up -d postgres-db

(Back to top)

Usage

To start using the app you need to run the following steps:

  1. Open a terminal on the root folder
  2. If you want to use it in dev purpose run the following commands
    # development
    $ yarn run start
    
    # watch mode
    $ yarn run start:dev
  3. If you want to use it to run the tests run the following commands
    # unit tests
    $ yarn run test
    
    # e2e tests
    $ yarn run test:e2e
    
    # test coverage
    $ yarn run test:cov

Visit "YOUR HOST URL"\docs after using yarn run start to get more info about the REST API Services

(Back to top)

Deploy

  1. Open a terminal on the root folder
  2. Run the following command
    docker-compose --env-file .env.stage.prod up <!-- TODO - CAMBIAR -->

License

Distributed under the MIT License. See LICENSE for more information.

(Back to top)

Contact

Your Name - @mariovido - mario.vidaldom@gmail.com

Project Link: https://github.com/Mariovido/portfolio-backend.git

(Back to top)

About

Repository containing the backend of the portfolio app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages