CeluAlquilo is a web platform designed to facilitate users with quick and affordable mobile phone rentals.
CeluAlquilo es una plataforma web diseñada para facilitar a los usuarios el alquiler rápido y asequible de teléfonos móviles.
This repository contains the backend of the CeluAlquilo platform. It is a RESTful API built with NestJS. The API is designed to be consumed by the frontend of the platform.
The backend connects to a PostgreSQL database. It is dockerized, so you can use Docker to run the backend, the database and the pgAdmin4
tool to manage the database in separate containers.
-
Ensure Docker and Docker Compose are installed in your system. An easy way is to install Docker Desktop, which includes both.
-
To build and run the backend, the database, and the
pgAdmin4
tool, execute the following command from the root folder of the repository in the terminal:docker-compose up
- If changes are made to the code and the backend needs to be rebuilt, the
--build
flag can be used. - The containers can be run in the background using the
-d
flag.
The
pgAdmin4
tool will be running onhttp://localhost:5050
. The backend will be running onhttp://localhost:3000
. The database will be running onlocalhost:5432
. - If changes are made to the code and the backend needs to be rebuilt, the
-
Access the
pgAdmin4
tool on http://localhost:5050 with the credentials found in the docker-compose.yml file. Create a new server with the following credentials:- Name:
celualquilo
- Host:
postgres
- Port:
5432
- Username:
user
- Password:
password
- Name:
-
On the server, access the
celualquilo
database and create the tables running the SQL script in theinsertionsCelualquilo.sql
file with theQuery Tool
ofpgAdmin4
. This will populate the database with some initial data, which is crucial for the frontend to look and work properly.
To stop the containers, run docker-compose down
in the terminal.