This comprehensive solution is designed to streamline and optimize your business processes, providing a centralized platform to manage and coordinate various aspects of your enterprise. Whether you are a small business or a large corporation, our ERP software is tailored to meet your organizational needs and enhance overall efficiency.
- Asset Server
- User Authentication and Authorization
- Procurement
- Accounts Branch
- Customer Relations Management
- Transport
Install Dependencies and Setup Project
# step 1: clone repo
git clone https://github.com/Web-Woods/streamline-procurement.git
# step 2: go to project directory and run
yarn install
# step 3: go to backend directory and run
yarn install
# step 4: go to fronend directory and run
yarn install
Setup the following environment variables before starting the services.
Microservices
Replace MICROSEVICE
with the relevant microservice using the following identifiers.
Service Name | Identifier |
---|---|
Auth Service | AUTH |
Procurement Service | PRC |
e.g. The gateway endpoint for Auth
service can be set using AUTH_GATEWAY=/gateway/auth
MICROSERVICE_DB=postgres
MICROSERVICE_DB_HOST=localhost
MICROSERVICE_DB_PORT=5432
MICROSERVICE_DB_USERNAME=username
MICROSERVICE_DB_PASSWORD=password
MICROSERVICE_DB_NAME=database
MICROSERVICE_HOST=localhost
MICROSERVICE_PORT=5001
MICROSERVICE_GRAPHQL=/graphql
MICROSERVICE_GATEWAY=/gateway/microservice
MICROSERVICE_PREFIX=microservice
Mail Service
SMTP_HOST=localhost
SMTP_PORT=2525
SMTP_USER=user
SMTP_PASS=password
FROM_EMAIL=demo@email.com
Gateway
GATEWAY_HOST=localhost
GATEWAY_PORT=3333
GATEWAY_GRAPHQL=/graphql
Run the Application using the following commands.
# go to backend folder and run the microservices
yarn start:dev auth-plugin
yarn start:dev procurement-plugin
# go to backend folder and start the gateway service
yarn start:dev streamline
# go to frontend folder and run
yarn dev:new
User Interface starts on http://localhost:3000
Server starts on http://localhost:3333/graphql
Use a graphql client like Altair or use the playground on http://localhost:3333/graphql/playground
This solution is developed on top of the Nestjs, GraphQL and Nextjs. Each app is separated according to it's functionality and conneted via Apollo client instances. The solution itself is a monorepo including teh frontend and backend apps.
The backend directory contains a Nestjs workspace which has been structured to include a shared library and share these resources with each individual app in the workspace.
The apps directory contains all the individual microserices. Each app can be run on there own and can connect to other services using an Apollo client.
The libs directory contains database configurations, apollo client configurations, shared modules, services and resolvers, guards, and sql script generators.
The backend services are developed as a headless server system which can be integrated into any frontend application. This solution uses an instance of a NextJs server which will serve the ui.
The provided SQL script defines tables for an application dealing with procurement processes. Let's describe the entity relationships based on the script:
-
File Entity:
- Represents a file used in the system.
- Used to store a collection of Requests.
- Related to the
Request
entity through thefile_id
foreign key.
-
Migrations Entity:
- Represents information related to database migrations.
- No explicit relationships defined in this script.
-
ProcurementUser Entity:
- Represents a user with roles related to procurement activities.
- Related to the
Role
entity through theroleId
foreign key.
-
Property Entity:
- Represents key-value pair properties.
- Used in a many-to-many relationship with the
RequestItem
entity through therequest-item-properties
junction table. - Related to the
RequestItem
entity through therequest-item-properties
junction table.
-
Request Entity:
- Represents a procurement request.
- Related to the
File
entity through thefile_id
foreign key. - Has a many-to-many relationship with the
RequestItem
entity through therequest_request_items
junction table.
-
RequestItem Entity:
- Represents an item within a procurement request.
- Has a many-to-many relationship with the
Property
entity through therequest-item-properties
junction table. - Related to the
Request
entity through therequest_request_items
junction table.
-
Request-RequestItems Junction Table:
- Represents the many-to-many relationship between the
Request
andRequestItem
entities.
- Represents the many-to-many relationship between the
-
RequestItem-Properties Junction Table:
- Represents the many-to-many relationship between the
RequestItem
andProperty
entities.
- Represents the many-to-many relationship between the
-
Role Entity:
- Represents user roles, including those related to procurement activities.
- Related to the
ProcurementUser
andUser
entities through theroleId
foreign key.
-
User Entity:
- Represents a user in the system.
- Related to the
Role
entity through theroleId
foreign key. - Related to the
VerificationCode
entity through theid
foreign key.
-
VerificationCode Entity:
- Represents a verification code associated with a user.
- Related to the
User
entity through theuser_id
foreign key.
These relationships provide a structure for handling procurement-related activities, including requests, items, users, roles, and associated properties. The script also includes foreign key constraints to maintain referential integrity between the tables.