2.8 KiB
Setting up development environment
Getting started with development is a breeze! Follow these steps and you'll be contributing in no time.
Requirements
- Node.js version v18 or newer - Node.js
- Postgres version v15.6 - PostgreSQL
- Redis version v4.6.7 (not used yet. setup only.)
Prerequisites
$ npm install -g ts-node$ npm install -g typescript$ npm install -g grunt grunt-cli
Installation
Clone the repository:
git clone https://github.com/Worklenz/worklenz.git
Frontend installation
-
Navigate to the frontend project directory:
cd worklenz-frontend -
Install dependencies:
npm install -
Run the frontend:
npm start -
Navigate to http://localhost:4200
Backend installation
-
Navigate to the backend project directory:
cd worklenz-backend -
Open your IDE:
Open the project directory in your preferred code editor or IDE like Visual Studio Code.
-
Configure Environment Variables:
- Create a copy of the
.env.templatefile and name it.env. - Update the required fields in
.envwith the specific information.
- Create a copy of the
-
Restore Database
- Create a new database named
worklenz_dbon your local PostgreSQL server. - Update the
DATABASE_NAMEandPASSWORDin thedatabase/6_user_permission.sqlwith your DB credentials. - Open a query console and execute the queries from the .sql files in the
databasedirectories, following the provided order.
- Create a new database named
-
Install Dependencies:
npm installThis command installs all the necessary libraries required to run the project.
-
Run the Development Server:
a. Start the TypeScript compiler:
Open a new terminal window and run the following command:
grunt devThis starts the
grunttask runner, which compiles TypeScript code into JavaScript.b. Start the development server:
Open another separate terminal window and run the following command:
npm startThis starts the development server allowing you to work on the project.
-
Run the Production Server:
a. Compile TypeScript to JavaScript:
Open a new terminal window and run the following command:
grunt buildThis starts the
grunttask runner, which compiles TypeScript code into JavaScript for production use.b. Start the production server:
Once the compilation is complete, run the following command in the same terminal window:
npm startThis starts the production server for your application.