It is better to manage the metadatas of documents in a relational database rather than placing it in the title of a document in a file system. For example, Projectx_document2_20150101_v01.doc lost in a maze of subfolders, duplicated on several servers.
To try to solve these problems simply, here is a basic document management (DM) system, with a search by metadata. Access to documents through a classification plan. The metadata categories as well as the types of relationships between documents are part of the Dublin Core repository. The ressource URL or attached documents URL are inside the field "text".
I used Symfony 5: The Fast Track and Symfony demo to implement my data model.
- PHP 7.2.9 or higher;
- pdo_pgsql PHP extension enabled in php.ini;
- intl PHP extension enabled in php.ini
- Postgresql standalone OR Docker-compose
- and the usual Symfony application requirements.
Verify that you have installed composer, git, npm (node.js), yarn and, depending on your environment, docker-compose OR postgresql.
Verify that you have PHP installed : sudo apt-get install php
on linux or, for windows, use php already included in xampp.
If you have Windows, do not forget to indicate in the environment variable PATH,
the path to access php.exe (for example, C:\xampp\php).
Download Symfony to install the symfony
binary on your computer and run
this command:
git clone https://github.com/coyote333666/meta_doc meta_doc
cd meta_doc
composer update
cp FrameworkExtension.php ./vendor/symfony/framework-bundle/DependencyInjection
composer update
composer install --no-interaction
cp -r build ./public
# dependencies problems when creating buid with these commands :
# symfony run yarn add node-sass sass-loader --dev
# symfony run yarn add encore --dev
If you just want to create the structure of the database with Symfony and docker-compose, you can run this command:
docker-compose up -d
symfony console make:migration
symfony console doctrine:migrations:migrate
If necessary, load Dublin Core data for your local parameter :
symfony run psql -f dublin_core/dublin_core_element_<your locale parameter>.sql
symfony run psql -f dublin_core/dublin_core_relation_<your locale parameter>.sql
If you want to create and populate the database (english version), run this command with Postgresql binaries installed:
symfony run psql -f meta_doc.sql
Modify your locale parameter in /config/services.yaml:
parameters:
locale: '<your locale parameter>'
# This parameter defines the codes of the locales (languages) enabled in the application
app_locales: ar|en|fr|de|es|ru|it|ja|zh|pt
Run application
symfony server:start -d
Then access the application in your browser at the given URL (https://localhost:8000 by default).
If you don't have the Symfony binary installed, run php -S localhost:8000 -t public/
to use the built-in PHP web server or configure a web server like Nginx or
Apache to run the application.
The username and password of the admin account are admin/admin.