Catalog administration service built with NestJS.
- Docker and Docker Compose
- Visual Studio Code
- Remote - Containers extension for VS Code
This project is configured to run in a Dev Container, providing a consistent and isolated development environment.
- Open the project in Visual Studio Code
- When prompted, click "Reopen in Container" or:
- Press
F1(orCmd+Shift+Pon macOS) - Type: "Dev Containers: Reopen in Container"
- Select the option
- Press
The container will:
- Build the Docker image
- Install project dependencies (
pnpm install) - Rebuild sqlite3 (this process may take a few minutes)
post-create.sh script automatically runs the sqlite3 rebuild, but this process may take a few minutes.
You'll know the setup is complete when you see the message:
=== Setup completed successfully! ===
If you need to verify or manually run the sqlite3 rebuild:
bash scripts/rebuild-sqlite3.shOr, if you prefer to use pnpm directly:
pnpm rebuild sqlite3After the setup is complete, you can run the project:
# Development mode (with hot-reload)
pnpm start:dev
# Production mode
pnpm start:prod
# Debug mode
pnpm start:debugThe server will be available at http://localhost:3000
Before running pnpm test, make sure that:
- The
post-create.shscript has completely finished - You've seen the sqlite3 rebuild success message:
✓ sqlite3 rebuilt successfully
If you're not sure if the rebuild was completed, run it manually:
bash scripts/rebuild-sqlite3.shWait until you see the success message before proceeding.
# Run all tests
pnpm test
# Run tests in watch mode
pnpm test:watch
# Run tests with coverage
pnpm test:cov
# Run E2E tests
pnpm test:e2e
# Run tests in debug mode
pnpm test:debug# Development
pnpm start:dev # Start server in development mode
pnpm start:debug # Start server in debug mode
pnpm start:prod # Start server in production mode
# Build
pnpm build # Compile TypeScript project
# Tests
pnpm test # Run unit tests
pnpm test:watch # Run tests in watch mode
pnpm test:cov # Run tests with code coverage
pnpm test:e2e # Run end-to-end tests
# Code Quality
pnpm lint # Run ESLint and fix issues
pnpm format # Format code with Prettier- NestJS - Node.js framework
- TypeScript - Programming language
- Sequelize - Database ORM
- SQLite3 - Database
- Jest - Testing framework
- pnpm - Package manager
.
├── src/ # Source code
│ ├── categories/ # Categories module
│ ├── core/ # Business logic (domain, application, infra)
│ └── main.ts # Application entry point
├── test/ # E2E tests
├── .devcontainer/ # Dev Container configuration
├── scripts/ # Helper scripts
│ └── rebuild-sqlite3.sh # Script to rebuild sqlite3
└── package.json # Project dependencies and scripts
If you encounter errors related to sqlite3 when running tests:
-
Make sure the sqlite3 rebuild was completed:
bash scripts/rebuild-sqlite3.sh
-
If the problem persists, try reinstalling dependencies:
rm -rf node_modules pnpm install bash scripts/rebuild-sqlite3.sh
- Check if Docker is running
- Try rebuilding the container:
- Press
F1 - Type: "Dev Containers: Rebuild Container"
- Select the option
- Press
If you encounter permission issues, make sure the user in the container has the correct permissions. The container is configured to use the node user (UID 1001).
- The project uses pnpm as the package manager. Do not use
npmoryarn. - Jest is configured to not run automatically. Run tests manually when needed.
- The container's default timezone is configured to
America/Sao_Paulo.
This project is private and unlicensed.