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.
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:
Request
entity through the file_id
foreign key.Migrations Entity:
ProcurementUser Entity:
Role
entity through the roleId
foreign key.Property Entity:
RequestItem
entity through the request-item-properties
junction table.RequestItem
entity through the request-item-properties
junction table.Request Entity:
File
entity through the file_id
foreign key.RequestItem
entity through the request_request_items
junction table.RequestItem Entity:
Property
entity through the request-item-properties
junction table.Request
entity through the request_request_items
junction table.Request-RequestItems Junction Table:
Request
and RequestItem
entities.RequestItem-Properties Junction Table:
RequestItem
and Property
entities.Role Entity:
ProcurementUser
and User
entities through the roleId
foreign key.User Entity:
Role
entity through the roleId
foreign key.VerificationCode
entity through the id
foreign key.VerificationCode Entity:
User
entity through the user_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.