Update environment configuration, Docker setup, and frontend/backend dependencies
- Updated .env.example and .env files for backend and frontend with placeholder values. - Enhanced .gitignore to include additional files and directories. - Modified docker-compose.yml to change image names and improve service health checks. - Updated README.md and SETUP_THE_PROJECT.md for clearer setup instructions. - Added database initialization scripts and SQL files for structured database setup. - Updated frontend Dockerfile to use Node.js 22 and adjusted package.json scripts. - Improved error handling and logging in start scripts for better debugging. - Added reCAPTCHA support in the signup page with conditional loading based on environment variables.
This commit is contained in:
@@ -4,21 +4,20 @@ Getting started with development is a breeze! Follow these steps and you'll be c
|
||||
|
||||
## Requirements
|
||||
|
||||
- Node.js version v18 or newer - [Node.js](https://nodejs.org/en/download/current)
|
||||
- Postgres version v15.6 - [PostgreSQL](https://www.postgresql.org/download/)
|
||||
- Redis version v4.6.7 (not used yet. setup only.)
|
||||
- Node.js version v16 or newer - [Node.js](https://nodejs.org/en/download/)
|
||||
- PostgreSQL version v15 or newer - [PostgreSQL](https://www.postgresql.org/download/)
|
||||
- S3-compatible storage (like MinIO) for file storage
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- `$ npm install -g ts-node`
|
||||
- `$ npm install -g typescript`
|
||||
- `$ npm install -g grunt grunt-cli`
|
||||
- `$ npm install -g typescript` (optional, but recommended)
|
||||
|
||||
## Installation
|
||||
**Clone the repository:**
|
||||
|
||||
```bash
|
||||
git clone https://github.com/Worklenz/worklenz.git
|
||||
cd worklenz
|
||||
```
|
||||
|
||||
### Frontend installation
|
||||
@@ -32,13 +31,14 @@ Getting started with development is a breeze! Follow these steps and you'll be c
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
3. **Run the frontend:**
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
4. Navigate to [http://localhost:4200](http://localhost:4200)
|
||||
4. Navigate to [http://localhost:5173](http://localhost:5173)
|
||||
|
||||
### Backend installation
|
||||
|
||||
@@ -54,13 +54,34 @@ Getting started with development is a breeze! Follow these steps and you'll be c
|
||||
|
||||
3. **Configure Environment Variables:**
|
||||
|
||||
- Create a copy of the `.env.template` file and name it `.env`.
|
||||
- Update the required fields in `.env` with the specific information.
|
||||
- Create a copy of the `.env.example` file and name it `.env`.
|
||||
- Update the required fields in `.env` with your specific configuration.
|
||||
|
||||
4. **Restore Database**
|
||||
4. **Set up Database**
|
||||
- Create a new database named `worklenz_db` on your local PostgreSQL server.
|
||||
- Update the `DATABASE_NAME` and `PASSWORD` in the `database/6_user_permission.sql` with your DB credentials.
|
||||
- Open a query console and execute the queries from the .sql files in the `database` directories, following the provided order.
|
||||
- Update the database connection details in your `.env` file.
|
||||
- Execute the SQL setup files in the correct order:
|
||||
|
||||
```bash
|
||||
# From your PostgreSQL client or command line
|
||||
psql -U your_username -d worklenz_db -f database/sql/0_extensions.sql
|
||||
psql -U your_username -d worklenz_db -f database/sql/1_tables.sql
|
||||
psql -U your_username -d worklenz_db -f database/sql/indexes.sql
|
||||
psql -U your_username -d worklenz_db -f database/sql/4_functions.sql
|
||||
psql -U your_username -d worklenz_db -f database/sql/triggers.sql
|
||||
psql -U your_username -d worklenz_db -f database/sql/3_views.sql
|
||||
psql -U your_username -d worklenz_db -f database/sql/2_dml.sql
|
||||
psql -U your_username -d worklenz_db -f database/sql/5_database_user.sql
|
||||
```
|
||||
|
||||
Alternatively, you can use the provided shell script:
|
||||
|
||||
```bash
|
||||
# Make sure the script is executable
|
||||
chmod +x database/00-init-db.sh
|
||||
# Run the script (may need modifications for local execution)
|
||||
./database/00-init-db.sh
|
||||
```
|
||||
|
||||
5. **Install Dependencies:**
|
||||
|
||||
@@ -68,48 +89,49 @@ Getting started with development is a breeze! Follow these steps and you'll be c
|
||||
npm install
|
||||
```
|
||||
|
||||
This command installs all the necessary libraries required to run the project.
|
||||
|
||||
6. **Run the Development Server:**
|
||||
|
||||
**a. Start the TypeScript compiler:**
|
||||
|
||||
Open a new terminal window and run the following command:
|
||||
|
||||
```bash
|
||||
grunt dev
|
||||
```
|
||||
|
||||
This starts the `grunt` task runner, which compiles TypeScript code into JavaScript.
|
||||
|
||||
**b. Start the development server:**
|
||||
|
||||
Open another separate terminal window and run the following command:
|
||||
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
This starts the development server allowing you to work on the project.
|
||||
|
||||
7. **Run the Production Server:**
|
||||
|
||||
**a. Compile TypeScript to JavaScript:**
|
||||
**a. Build the project:**
|
||||
|
||||
Open a new terminal window and run the following command:
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
```bash
|
||||
grunt build
|
||||
```
|
||||
|
||||
This starts the `grunt` task runner, which compiles TypeScript code into JavaScript for production use.
|
||||
This will compile the 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:
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
## Docker Setup (Alternative)
|
||||
|
||||
This starts the production server for your application.
|
||||
For an easier setup, you can use Docker and Docker Compose:
|
||||
|
||||
1. Make sure you have Docker and Docker Compose installed on your system.
|
||||
|
||||
2. From the root directory, run:
|
||||
|
||||
```bash
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
3. Access the application:
|
||||
- Frontend: http://localhost:5000
|
||||
- Backend API: http://localhost:3000
|
||||
- MinIO Console: http://localhost:9001 (login with minioadmin/minioadmin)
|
||||
|
||||
4. To stop the services:
|
||||
|
||||
```bash
|
||||
docker-compose down
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user