This project is a web application designed to manage and track IT procurement processes. It allows users to upload PDF files, view and edit CSV records, and generate and download PDF files based on specific templates.
- Prerequisites
- Setup
- Running the Application
- Applicationlooks
- Application Features
- Usage
- API Documentation
- Adding a Printer
- Troubleshooting
- Contributing
- License
Before you start, ensure you have the following installed on your machine:
- Node.js (v14 or higher)
- npm (v6 or higher) or yarn
- Git
First, clone the repository to your local machine using Git:
git clone https://github.com/yourusername/it-beschaffung.git
cd it-beschaffung
Navigate to the root directory of the project and install the required dependencies for both the backend and frontend:
npm install
If you are using yarn:
yarn install
Create a .env file in the root directory to store your environment variables. Below is a sample configuration:
# Backend
PORT=3000
JWT_SECRET=your_jwt_secret_key
# Frontend
REACT_APP_API_URL=http://localhost:3000
Make sure to replace your_jwt_secret_key with a secure string.
The application uses JSON templates to generate PDFs. You need to place your PDF template in the appropriate directory:
Navigate to the templates directory in your project:
mkdir -p templates
Create a template-betrieb.json file inside the templates directory. This file should contain the template for the PDF generation. You can create own Templates on https://pdfme.com/template-design.
Example template:
{
"basePdf": "BLANK_PDF",
"schemas": [
{
"produkt": { "type": "text", "position": { "x": 50, "y": 50 }, "width": 200, "height": 20 },
"accessorie": { "type": "text", "position": { "x": 50, "y": 80 }, "width": 200, "height": 20 },
"notes": { "type": "text", "position": { "x": 50, "y": 110 }, "width": 200, "height": 20 },
"Notebook": { "type": "text", "position": { "x": 50, "y": 140 }, "width": 200, "height": 20 },
"Tablet": { "type": "text", "position": { "x": 50, "y": 170 }, "width": 200, "height": 20 },
"Mobile": { "type": "text", "position": { "x": 50, "y": 200 }, "width": 200, "height": 20 },
"Storage": { "type": "text", "position": { "x": 50, "y": 230 }, "width": 200, "height": 20 },
"Else": { "type": "text", "position": { "x": 50, "y": 260 }, "width": 200, "height": 20 },
"additionalNotes": { "type": "text", "position": { "x": 50, "y": 290 }, "width": 200, "height": 20 },
"name": { "type": "text", "position": { "x": 50, "y": 320 }, "width": 200, "height": 20 }
}
]
}
Adjust the positions and fields according to your specific requirements.
To start the backend server navigate into the backend folder and run:
node app.js
This will start the server on http://localhost:3000.
In a separate terminal window, start the frontend:
npm run start
The frontend will be accessible at http://localhost:5173.
-CSV Viewer: View, search, and edit CSV records. -PDF Upload: Upload signed PDF files and manage them. -PDF Generation: Generate PDFs from CSV records using predefined templates.
- Navigate to the "PDF Files" section from the dashboard.
- Click on "Upload PDF".
- Select the PDF file from your file system.
- Click "Upload". The file will be uploaded to the server, and a notification will prompt you to update the file path in the Excel sheets section.
- Navigate to the "Excel-Sheet" section.
- Use the search bar to search for records by any column, such as ID or name.
- Click on a row to edit it, or click "Add Entry" to create a new record.
- Save changes, and the CSV file will be updated.
Ensure the CSV data is up-to-date with the correct file paths. The application will automatically generate PDFs when necessary, saving them in the configured directory. Download the generated PDFs from the "PDF Files" section.
There is a locals folder where you can take the en/translation.json and translate it into your Language. But in some cases the Language is depending on the CSV-Files you have in your backend, so you maby need to change some parts of the code for example in the EditModals for the tabels.
The API provides endpoints for managing PDFs, CSV files, and user authentication.
For Endpoints look into backend/routes
For detailed documentation, refer to the API source code comments.
For adding a Printer take a look into my two reposetorys for kyocera printer:
- https://github.com/tpmst/read-printer-tonerlevel-kyocera
- https://github.com/tpmst/read-printer-counts-kyocera
If you dont have koycera printers you can either delete this tap or try to get the SNMP-OIDs for your printers.
Error: Cannot connect to the server. Ensure that the backend server is running and accessible on the correct port. PDF template not found. Make sure the PDF template JSON file is correctly placed in the templates directory.
If you'd like to contribute to this project, please follow these steps:
Fork the repository. Create a new branch. Make your changes. Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.