- On your local computer, copy the repo using
git clone
- Open the repository in vscode.
- you can work in the following modes:
- Devcontainer - Create a docker container that runs the app with all the tools and extensions necassery. vscode will popup a notification to ask you if it should re-open the project inside a devcontainer. This will also start a mongodb database for the app to use against
- open locally - run the repo locally. Should work but you might have some OS differences at edge-cases. You will need to provice a mongodb database link for the app to work against a database.
- Open a terminal and run
npm install
inside the main folder. This will install all dependencies.
After the dependencies are installed, you need to change the project name from kb-server-client-template
to whatever project you're developing. In order to do that, you can run:
npm run init <your-project-name>
This will replace the important parts of the templates to your project name (which should be npm compliant).
In the main repo folder, run npm run start:server
to start the server
in watch mode. The server will be available at localhost:10102
.
API swagger documentation is available at localhost:10102/api/docs
(or through the client proxy).
A Product
module is included as an example for a full module\service\controller feature with db.
In the main repo folder, run npm run start:client
to start the client in local proxy mode. The client will be available at localhost:10101
. This will re-route all rest calls to
localhost:10101/api
to the server application running on localhost:10102
.
In the main repo folder, run the following commands
npm run build
node .
In vscode, at the footer, click on TESTS: Server Unit-tests and Coverage
or run npm run test:server-unit
In vscode, at the footer, click on TESTS: Client Unit-tests and Coverage
or run npm run test:client-unit
In vscode, at the footer, click on TESTS: API-tests
or run npm run test:api
In vscode, at the footer, click on TESTS: E2E-tests
or run npm run test:e2e