-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #954 from idurar/dev
Add Docker
- Loading branch information
Showing
7 changed files
with
252 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
## Getting started | ||
|
||
#### Step 1: Clone the repository | ||
|
||
```bash | ||
git clone https://github.com/idurar/idurar-erp-crm.git | ||
``` | ||
|
||
```bash | ||
cd idurar-erp-crm | ||
``` | ||
|
||
#### Step 2: Create Your MongoDB Account and Database Cluster | ||
|
||
- Create your own MongoDB account by visiting the MongoDB website and signing up for a new account. | ||
|
||
- Create a new database or cluster by following the instructions provided in the MongoDB documentation. Remember to note down the "Connect to your application URI" for the database, as you will need it later. Also, make sure to change `<password>` with your own password | ||
|
||
- add your current IP address to the MongoDB database's IP whitelist to allow connections (this is needed whenever your ip changes) | ||
|
||
#### Step 3: Edit the Environment File | ||
|
||
- Check a file named .env in the /backend directory. | ||
|
||
This file will store environment variables for the project to run. | ||
|
||
#### Step 4: Update MongoDB URI | ||
|
||
In the .env file, find the line that reads: | ||
|
||
`DATABASE="your-mongodb-uri"` | ||
|
||
Replace "your-mongodb-uri" with the actual URI of your MongoDB database. | ||
|
||
#### Step 5: Install Backend Dependencies | ||
|
||
In your terminal, navigate to the /backend directory | ||
|
||
```bash | ||
cd backend | ||
``` | ||
|
||
the urn the following command to install the backend dependencies: | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
This command will install all the required packages specified in the package.json file. | ||
|
||
#### Step 6: Run Setup Script | ||
|
||
While still in the /backend directory of the project, execute the following command to run the setup script: | ||
|
||
```bash | ||
npm run setup | ||
``` | ||
|
||
This setup script may perform necessary database migrations or any other initialization tasks required for the project. | ||
|
||
#### Step 7: Run the Backend Server | ||
|
||
In the same terminal, run the following command to start the backend server: | ||
|
||
```bash | ||
npm run dev | ||
``` | ||
|
||
This command will start the backend server, and it will listen for incoming requests. | ||
|
||
#### Step 8: Install Frontend Dependencies | ||
|
||
Open a new terminal window , and run the following command to install the frontend dependencies: | ||
|
||
```bash | ||
cd frontend | ||
``` | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
#### Step 9: Run the Frontend Server | ||
|
||
After installing the frontend dependencies, run the following command in the same terminal to start the frontend server: | ||
|
||
```bash | ||
npm run dev | ||
``` | ||
|
||
This command will start the frontend server, and you'll be able to access the website on localhost:3000 in your web browser. | ||
|
||
:exclamation: :warning:` If you encounter an OpenSSL error while running the frontend server, follow these additional steps:` | ||
|
||
Reason behind error: This is caused by the node.js V17 compatible issues with OpenSSL, see [this](https://github.com/nodejs/node/issues/40547) and [this](https://github.com/webpack/webpack/issues/14532) issue on GitHub. | ||
|
||
|
||
Try one of these and error will be solved | ||
|
||
- > upgrade to Node.js v20. | ||
- > Enable legacy OpenSSL provider | ||
Here is how you can enable legacy OpenSSL provider | ||
|
||
- On Unix-like (Linux, macOS, Git bash, etc.) | ||
|
||
```bash | ||
export NODE_OPTIONS=--openssl-legacy-provider | ||
``` | ||
|
||
- On Windows command prompt: | ||
|
||
```bash | ||
set NODE_OPTIONS=--openssl-legacy-provider | ||
``` | ||
|
||
- On PowerShell: | ||
|
||
```bash | ||
$env:NODE_OPTIONS = "--openssl-legacy-provider" | ||
``` | ||
|
||
Here is [reference](https://github.com/webpack/webpack/issues/14532#issuecomment-947012063) about enabling legacy OpenSSL provider | ||
|
||
After trying above solutions, run below command | ||
|
||
```bash | ||
npm run dev | ||
``` | ||
|
||
> If you still facing issue, then follow [this stackoverflow thread](https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported). It has so many different types of opinions. You definitely have solution after going through the thread. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,11 @@ IDURAR is Open "Fair-Code" Source ERP / CRM (Invoice / Inventory / Accounting / | |
|
||
**Live App Demo** : [https://www.idurarapp.com/demo-erp-crm/](https://www.idurarapp.com/demo-erp-crm/) | ||
|
||
**Credentials** : | ||
``` | ||
username : [email protected] password : admin123 | ||
``` | ||
|
||
``` | ||
🚀 Give a Star ⭐️ & Fork to this project ... Happy coding! 🤩` | ||
``` | ||
|
@@ -28,6 +33,20 @@ IDURAR is Free Open Code Source [fair-code](http://faircode.io) distributed unde | |
|
||
## License FAQ : | ||
|
||
## Features : | ||
|
||
Invoice Management 💰 | ||
|
||
Inventory Management 🧳 | ||
|
||
Accounting Management 📈 | ||
|
||
HR Management 🧑🤝🧑 | ||
|
||
Ant Design Framework(AntD) 🐜 | ||
|
||
Based on Mern Stack (Node.js / Express.js / MongoDb / React.js ) 👨💻 | ||
|
||
### May i can use IDURAR for Commercail use : | ||
|
||
- Yes You can use IDURAR for free for personal or Commercial use. | ||
|
@@ -65,135 +84,43 @@ IDURAR is Open "Fair-Code" Source ERP / CRM (Invoice / Inventory / Accounting / | |
|
||
## Getting started | ||
|
||
#### Step 1: Clone the repository | ||
|
||
```bash | ||
git clone https://github.com/idurar/idurar-erp-crm.git | ||
``` | ||
|
||
```bash | ||
cd idurar-erp-crm | ||
``` | ||
|
||
#### Step 2: Create Your MongoDB Account and Database/Cluster | ||
|
||
- Create your own MongoDB account by visiting the MongoDB website and signing up for a new account. | ||
|
||
- Create a new database or cluster by following the instructions provided in the MongoDB documentation. Remember to note down the "Connect to your application URI" for the database, as you will need it later. Also, make sure to change `<password>` with your own password | ||
|
||
- add your current IP address to the MongoDB database's IP whitelist to allow connections (this is needed whenever your ip changes) | ||
|
||
#### Step 3: Edit the Environment File | ||
|
||
- Check a file named .env in the /backend directory. | ||
|
||
This file will store environment variables for the project to run. | ||
|
||
#### Step 4: Update MongoDB URI | ||
|
||
In the .env file, find the line that reads: | ||
|
||
`DATABASE="your-mongodb-uri"` | ||
|
||
Replace "your-mongodb-uri" with the actual URI of your MongoDB database. | ||
|
||
#### Step 5: Install Backend Dependencies | ||
|
||
In your terminal, navigate to the /backend directory | ||
|
||
```bash | ||
cd backend | ||
``` | ||
|
||
In your terminal, run the following command to install the backend dependencies: | ||
|
||
```bash | ||
npm install | ||
``` | ||
1.[Clone the repository](INSTALLATION-INSTRUCTIONS.md#step-1-clone-the-repository) | ||
|
||
This command will install all the required packages specified in the package.json file. | ||
|
||
#### Step 6: Run Setup Script | ||
2.[Create Your MongoDB Account and Database Cluster](INSTALLATION-INSTRUCTIONS.md#Step-2-Create-Your-MongoDB-Account-and-Database-Cluster) | ||
|
||
While still in the /backend directory of the project, execute the following command to run the setup script: | ||
3.[Edit the Environment File](INSTALLATION-INSTRUCTIONS.md#Step-3-Edit-the-Environment-File) | ||
|
||
```bash | ||
npm run setup | ||
``` | ||
4.[Update MongoDB URI](INSTALLATION-INSTRUCTIONS.md#Step-4-Update-MongoDB-URI) | ||
|
||
This setup script may perform necessary database migrations or any other initialization tasks required for the project. | ||
5.[Install Backend Dependencies](INSTALLATION-INSTRUCTIONS.md#Step-5-Install-Backend-Dependencies) | ||
|
||
#### Step 7: Run the Backend Server | ||
6.[Run Setup Script](INSTALLATION-INSTRUCTIONS.md#Step-6-Run-Setup-Script) | ||
|
||
In the same terminal, run the following command to start the backend server: | ||
7.[Run the Backend Server](INSTALLATION-INSTRUCTIONS.md#Step-7-Run-the-Backend-Server) | ||
|
||
```bash | ||
npm run dev | ||
``` | ||
|
||
This command will start the backend server, and it will listen for incoming requests. | ||
8.[Install Frontend Dependencies](INSTALLATION-INSTRUCTIONS.md#Step-8-Install-Frontend-Dependencies) | ||
|
||
#### Step 8: Install Frontend Dependencies | ||
9.[Run the Frontend Server](INSTALLATION-INSTRUCTIONS.md#Step-9-Run-the-Frontend-Server) | ||
|
||
Open a new terminal window , and run the following command to install the frontend dependencies: | ||
## Docker Compose for local development | ||
|
||
```bash | ||
cd frontend | ||
``` | ||
- setup additional env variables, if necessary in the below file | ||
|
||
```bash | ||
npm install | ||
docker-compose.yml | ||
``` | ||
|
||
#### Step 9: Run the Frontend Server | ||
|
||
After installing the frontend dependencies, run the following command in the same terminal to start the frontend server: | ||
- After the necessary configurations run below command : | ||
|
||
```bash | ||
npm run dev | ||
docker-compose up -d | ||
``` | ||
|
||
This command will start the frontend server, and you'll be able to access the website on localhost:3000 in your web browser. | ||
|
||
:exclamation: :warning:` If you encounter an OpenSSL error while running the frontend server, follow these additional steps:` | ||
|
||
Reason behind error: This is caused by the node.js V17 compatible issues with OpenSSL, see [this](https://github.com/nodejs/node/issues/40547) and [this](https://github.com/webpack/webpack/issues/14532) issue on GitHub. | ||
|
||
Try one of these and error will be solved | ||
|
||
- > upgrade to Node.js v20. | ||
- > Enable legacy OpenSSL provider | ||
Here is how you can enable legacy OpenSSL provider | ||
|
||
- On Unix-like (Linux, macOS, Git bash, etc.) | ||
|
||
```bash | ||
export NODE_OPTIONS=--openssl-legacy-provider | ||
``` | ||
|
||
- On Windows command prompt: | ||
|
||
```bash | ||
set NODE_OPTIONS=--openssl-legacy-provider | ||
``` | ||
|
||
- On PowerShell: | ||
|
||
```bash | ||
$env:NODE_OPTIONS = "--openssl-legacy-provider" | ||
``` | ||
|
||
Here is [reference](https://github.com/webpack/webpack/issues/14532#issuecomment-947012063) about enabling legacy OpenSSL provider | ||
|
||
After trying above solutions, run below command | ||
|
||
```bash | ||
npm run dev | ||
``` | ||
This will build the images and bring up the containers for frontend, backend and mongodb. | ||
|
||
> If you still facing issue, then follow [this stackoverflow thread](https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported). It has so many different types of opinions. You definitely have solution after going through the thread. | ||
**_NOTE:_** This docker-compose setup is associated for local development only. | ||
|
||
## Contributing | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM node:20.9.0-alpine | ||
|
||
WORKDIR /usr/src/app | ||
|
||
RUN npm install -g [email protected] | ||
|
||
COPY package*.json ./ | ||
|
||
COPY . . | ||
|
||
RUN npm install | ||
|
||
EXPOSE 8888 | ||
|
||
CMD ["npm", "run", "dev"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
version: "3.8" | ||
services: | ||
backend: | ||
build: ./backend | ||
volumes: | ||
- ./backend:/usr/src/app | ||
- /usr/src/app/node_modules | ||
ports: | ||
- "8888:8888" | ||
environment: | ||
- NODE_ENV=development | ||
- DATABASE=mongodb://mongo:27017/local-idurar-erp-crp | ||
- PORT=8888 | ||
- NODE_OPTIONS=--openssl-legacy-provider | ||
- JWT_SECRET=secret_key_1234 | ||
|
||
command: sh -c "npm run setup && npm run dev" | ||
|
||
networks: | ||
- server-mongo | ||
|
||
depends_on: | ||
- mongo | ||
|
||
frontend: | ||
build: ./frontend | ||
volumes: | ||
- ./frontend:/usr/src/app | ||
- /usr/src/app/node_modules | ||
ports: | ||
- "3000:3000" | ||
environment: | ||
- NODE_ENV=development | ||
- REACT_APP_API_URL=http://backend:8888/api | ||
- NODE_OPTIONS=--openssl-legacy-provider | ||
|
||
depends_on: | ||
- backend | ||
|
||
mongo: | ||
image: mongo | ||
volumes: | ||
- mongodb_data:/data/db | ||
networks: | ||
- server-mongo | ||
|
||
volumes: | ||
mongodb_data: | ||
|
||
networks: | ||
server-mongo: |
Oops, something went wrong.