![]() |
|---|
A customer resource management web-application, utilizing Angular, NestJS and Postgres technologies.
Allows users to manage contacts, create and manage invoices or quotes. With intentions to progess further with time tracking and employee management.
* Angular
* NestJS
* NodeJS
* Postgres Database
* @hiddentemple/api-interfaces
* https://github.com/hiddentemple/api-interfaces
* Docker (if running locally)
[ For local installation and development ]
-
Download / Clone Repository
-
Download and Install NodeJS
- https://nodejs.org/en/download/
- v14.11.0 or higher
- https://nodejs.org/en/download/
-
Download and Install AngularCLI
npm i -g @angular/cli:10.1.1
-
Download and Install NestJS/CLI
npm i -g @nestjs/cli:7.0.0
-
To configure the database connection and other environment variables:
[ For Local Environment Configuration ]
- Edit the
.env.localfile located in the./pb-crm-api/configfolder of your project directory: - Ensure that the following variables are set you match your desired configuration.
DB_TYPE=<db-type> DB_HOST=<db-host-or-ip> DB_PORT=<db-port-number> DB_USR=<db-user> DB_PWD=<db-password> DB_NAME=<your-db-name-here> DB_DROP=boolean //Drops existing schema and data from database. Recommended only for local use. DB_SYNC=true //Synchronizes database schema with that in codebase.[ For Development / Production Environment Configuration ]
- Create a new
.envfile in the./pb-crm-api/configdirectory:.env.devfor development environment configuration.env.productionfor production environment configuration
- Ensure that the following variables are set to match your desired configuration.
DB_TYPE=<db-type> DB_HOST=<db-host-or-ip> DB_PORT=<db-port-number> DB_USR=<db-user> DB_PWD=<db-password> DB_NAME=<your-db-name-here> DB_DROP=boolean //Drops existing schema and data from database. Recommended only for local use. DB_SYNC=true //Synchronizes database schema with that in codebase.( NOTE ) - The
.env.dev&.env.productionfiles should not be commited to the repository. - Edit the
-
In order to install the required package
@hiddentemple/api-interfacesyou'll need to generate a github personal access token with at minimum READ permissions. More detailed instructions can be found here:The following checkbox must be selected when creating a personal access token, in order for the package to download properly.
Once that token is generated, you will need to create an environment variable named
NPM_TOKENwith the value of your newly generated token. This can be placed in the.envfile created above, as a system environment variable, or through your IDE's enviroment variables in the run configuration.( NOTE ) The generated token should never be commited to the file repository, as it will invalidate the token and thus need to be regenerated.
-
Run
npm installin the following project folders:./pb-crm-api/./pb-crm-ui/
-
Configure Docker for local development:
cdinto directory/local-db- Run the following command:
- On MacOS / Linux:
docker run -d --name pg -v "$PWD/my-postgres.conf":/etc/postgresql/postgresql.conf -e POSTGRES_PASSWORD=localpassword -p 5432:5432 postgres -c 'config_file=/etc/postgresql/postgresql.conf'
- On Windows:
docker run -d --name pg -v "%cd%/my-postgres.conf:/etc/postgresql/postgresql.conf" -e POSTGRES_PASSWORD=localpassword -p 5432:5432 postgres -c "config_file=/etc/postgresql/postgresql.conf"
- On MacOS / Linux:
- ( Note ) - To change the password of the local postgres instance, change the following
POSTGRES_PASSWORD=localpasswordin the command to whatever password you desire. Otherwise it will be set tolocalpassword.
-
To start the API, run the following command:
- To connect to a provisioned / configured database:
npm run start:devornpm run start:dev -- watchto watch for changes.
- To connect to a local postgres database
- Run
npm run start:local
- Run
- To connect to a provisioned / configured database:
-
To start the UI, run the following command:
ng serveornpm run start
-
Open browser to:

