RESTful API for the "Inventify" inventory management system. Built with NestJS, TypeScript, and PostgreSQL, and fully dockerized for easy deployment and development.
- Modern Framework: Built with NestJS, a progressive Node.js framework for building efficient and scalable applications.
- Robust Database: Uses PostgreSQL for data persistence.
- Fully Typed: Written in TypeScript for safer and more maintainable code.
- Dockerized: Complete setup with
Dockerfile
anddocker-compose.yml
for a consistent development and production environment. - Efficient Package Manager: Uses pnpm for fast and space-efficient dependency management.
Follow these instructions to get a copy of the project up and running on your local machine for development and testing purposes.
Make sure you have the following installed on your system:
- Node.js (v20 o superior)
- pnpm
- Docker
- Docker Compose
-
Clone the repository:
git clone https://github.com/your-username/inventify.git cd inventify
-
Install dependencies:
pnpm install
-
Environment Setup (for local development without Docker):
Create a
.env
file in the project root. You can use the.env.example
file as a template:cp .env.example .env
Adjust the variables inside
.env
if necessary for your local PostgreSQL setup.
The easiest way to get the entire environment (API + Database) up and running is by using Docker Compose. The environment variables for the database connection are already configured in the docker-compose.yml
file for container-to-container communication.
-
Build and start the containers:
docker-compose up --build
- The
--build
flag will rebuild the API image if you've made changes to the code. - To run in the background, add the
-d
flag:docker-compose up --build -d
.
- The
-
Access the application:
- The API will be available at
http://localhost:3000
. - The API documentation (Swagger) will be available at
http://localhost:3000/api
.
- The API will be available at
-
To stop the services:
docker-compose down
In the package.json
, you will find several useful scripts:
-
Run in development mode (with hot-reloading):
pnpm run start:dev
-
Construir la aplicación para producción:
pnpm run build
-
Ejecutar la aplicación en producción (después de construir):
pnpm run start:prod
-
Ejecutar tests unitarios:
pnpm run test
-
Ejecutar tests e2e:
pnpm run test:e2e
-
Linting y formateo:
pnpm run lint pnpm run format
Este proyecto no tiene una licencia especificada.