This project is licensed under the MIT License.
See LICENSE for details.
- Node.js version >= 20.9.0
- npm version >= 10.1.0
A .tool-versions
file is provided to easily work with asdf
- Clone the repository:
git clone https://github.com/vinjatovix/ts-api.git
cd ts-api
- Install dependencies:
npm install
Please rename .env_example
to .env
And full-fill the variables if needed.
Run the development server:
npm run dev
You can build and run it locally with:
npm run start:local
Or just with:
npm run docker:local
- Starts the mongo db
npm run docker:mongo
- Provisioning the db
Provisioning the local mongo with cloud
$ENV
data
npm run restoreDB $ENV password
Or restore previous dumped data.
npm run restoreDump $ENV
Note this will only work if previous data for such
$ENV
was dumped and restored before
Please, update the openApi.yaml
if you need to make critical changes related to your task/issues.
A nice postman collection is provided for you ready to work with in ./doc/postman/collection
.
Remember to update and add it to your PR.
We are working to automate this doc with swagger
You can run newman against the provided postman collection.
Just rename ENV.postman_environment.json_sample
to local.postman_environment.json
inside ./doc/postman/environments
and full-fill the needed variables.
npm run newman:local
You can run the collection against the PRE deploy if you have the needed rights to do it
npm run newman
Note this only will work if the proper
pre.postman_environment.json
is set up
We encourage ATDD flow in development phase. Cucumber and jest are ready to work in this repo.
- For acceptance tests
npm run test:features
- In development For unit tests
npm run test:unit
- Full tests routines
npm run test
Note this gathers full coverage info
This repository uses semver, $RELEASE_TYPE
could be major, minor or patch.
npm run prepare-release $RELEASE_TYPE
- build: Clean the previous build, transpile TypeScript, and copy necessary files to the dist directory.
- check-dependencies: Check for circular dependencies in the source code using madge.
- dev: Run the application in development mode using ts-node-dev.
- docker:local: Build the Docker image and start the application using Docker Compose.
- docker:mongo: Set up the local mongo docker.
- newman: Runs the postman collection against the deployed build.
- newman:local: Once you have your local env up you can check the postman collections with this script.
- prepare-release: Accepts major, minor, patch. Updates release files, commit and push the new tag.
- restoreDB: Requires an ENV and a password for restore in local mongo docker some cloud DB
- restoreDump: Accepts an ENV for restore a previously dumped ENV db stores in the local mongo docker.
- start: Start the transpiled build in the deployment server.
- start:local: Start the transpiled application in the local environment.
- test: Run both unit and feature tests.
- test:features: Run feature tests using Cucumber.js.
- test:unit: Run unit tests using Jest.
Feel free to contribute to this project but keep in mind the guidelines in CONTRIBUTING.md
Open an issue or create a pull request.
Please report bugs, issues or Report a vulnerability at GitHub Issues.
https://github.com/vinjatovix/ts-api
See package.json
for a list of dependencies and their versions.
For more details, visit the project homepage.