This is the Back-end base project in Node.js for the Software and Systems Engineering discipline, offered by the Informatics Center (CIn) of the Federal University of Pernambuco (UFPE).
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
To run this project, you'll need to have the following software installed on your system:
- Node.js
- npm (Node Package Manager)
Clone the repository and install the dependencies by running the following command in the project directory:
npm install
Run the follow scripts
chmod +x .husky/pre-commit
chmod +x .husky/pre-push
npm run
This project uses .env
files to manage environment variables. You can create a .env.dev
file in the project directory and set the environment variables in the file (iou can create it from .env.example
). The env
script in the package.json
file uses the env-cmd
package to load the environment variables from the .env.dev
file.
To start the server, run the following command:
env=dev npm run start
This command will run the TypeScript compiler in watch mode and start the server using nodemon.
The following scripts are available in the package.json
file:
start
: Runs the TypeScript compiler in watch mode and starts the server using nodemon.build
: Compiles the TypeScript code.test
: Runs the Jest tests for the project.prettier
: Formats the code using Prettier.lint
: Lints the code using ESLint.
The following dependencies are used in the project:
- env-cmd: A simple way to manage your environment variables in npm scripts.
- express: Fast, unopinionated, minimalist web framework for Node.js.
- typescript: A typed superset of JavaScript that compiles to plain JavaScript.
- jest: Jest is a delightful JavaScript Testing Framework with a focus on simplicity.
- pino: Very low overhead Node.js logger.
To understand and learn more details about the structure of the project, click here to be redirected to the README that contains this information.