Angular client and Springboot api application to manage monthly expenses/income with a MySQL backend and search provided by Solr
-
Install docker-ce
-
Make sure the user that will run docker is in the docker group. In this example, the username is
vmuser
sudo usermod vmuser -a -G docker
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
- Test that mysql docker will work with
mysql/docker-mysql.sh
- After making sure the container runs you can stop the container with
docker stop mysql
- Run the export script
./mysql/db-backup.sh
billDb.sql.gz
will be located in the directory abovebill-manager
-
Make sure
billDb.sql.gz
is located in the directory abovebill-manager
-
Run the restore script
./mysql/db-restore.sh
- Configure the container core directory with
./solr/solr-configure.sh
- Run the Solr container with
./solr/docker-solr.sh
- The
/opt/solr/server/solr/mycores/bills/conf/solrconfig.xml
has the code added to the config element
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</requestHandler>
- The
/opt/solr/server/solr/mycores/bills/conf/managed-schema
has after this line
<field name="_text_" type="text_general" indexed="true" stored="false" multiValued="true" />
- The following block added
<!-- ********** custom fields for bill-manager ********** -->
<field name="db_id" type="string" indexed="true" stored="true" />
<field name="item_date" type="pdate" indexed="true" stored="true" />
<field name="author" type="string" indexed="true" stored="true" />
<field name="description" type="text_general" indexed="true" stored="true" />
<field name="price" type="pfloat" indexed="true" stored="true" />
<field name="last_modified" type="pdate" indexed="true" stored="true" />
<field name="category" type="string" indexed="true" stored="true" />
<copyField source="author" dest="_text_" />
<copyField source="description" dest="_text_" />
<copyField source="category" dest="_text_" />
<!-- ********** end custom fields ********** -->
- Inside the springboot-api directory, build a container with
./docker-build.sh
- Verify the containers runs with
./docker-springboot.sh
- Use the following script to run locally against a mysql docker container
./local-run.sh
- Build client project
npm install
npx bower install
npx grunt build
- Build the nginx container from the client build output in
./client/dist
client/docker-build.sh
- Make sure the client runs with
client/docker-nginx.sh
- The application will be running on http://localhost
- Inside the
client
directory run
npx grunt serve
- A livereload development server will be available at http://localhost:9000
- After configuring and verifying the containers run, use the following scripts to run and stop all the containers
./docker-run-all.sh
./docker-stop-all.sh