Table of Contents
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.
The frameworks/libraries used to complete this project are:
To get a local copy up and running follow these simple example steps.
Before installing the software you must have installed the npm package. You can do it using the next command.
- npm
npm install --global yarn
The steps to get working the project are the following ones:
- Clone the repo
git clone https://github.com/Mariovido/portfolio-backend.git
- Run the following command.
yarn install
- 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"
- Create the database by running the following command
docker-compose --env-file .env.stage.dev up -d postgres-db
To start using the app you need to run the following steps:
- Open a terminal on the root folder
- If you want to use it in dev purpose run the following commands
# development $ yarn run start # watch mode $ yarn run start:dev
- 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
- Open a terminal on the root folder
- Run the following command
docker-compose --env-file .env.stage.prod up <!-- TODO - CAMBIAR -->
Distributed under the MIT License. See LICENSE
for more information.
Your Name - @mariovido - [email protected]
Project Link: https://github.com/Mariovido/portfolio-backend.git