AutoPacker is an automated software packaging and deployment solution. AutoPacker is a simple, but productive and transparent platform that is cloud-service and hosting independent and offers a way to manage projects, servers, deployment and storage, and being a platform for people to share projects and ideas. AutoPacker was created by three bachelor students at NTNU as a part of their bachelor thesis project.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
AutoPacker consists of several modules, each is a separate sub-project:
Except the Web application, all other sub-projects have a REST API interface. I.e., Web application is a REST client while all other modules are REST servers.
To run the system you need to run all these modules. See the "Installing" section for instructions.
To develop the projects, you need the following services deployed somewhere:
In addition, you need the following tools on your computer:
The first section describes general requirements - for all the modules. The following sections describe setup steps for each module of the project. Web application depends on all other modules.
All the server-side (backend) modules have two requirements which must be met:
To run the User Service:
application.yml
file in the src/main/resouces
directory (take a copy of the template.application.yml
file, fill in the values according to your implementation).mvn spring-boot:run
in the terminal, or launch the UserServiceApplication
class from your IDE. File Delivery API has one extra requirement: a MongoDB database. Steps for running File Delivery API:
application.properties
file in the src/main/resouces
directory (take a copy of the template.application.properties
file, fill in the values according to your implementation). In case if you want to run different setups for development and production environments, you can create several property files, for example, application-dev.properties
. Then you need to add a switch for the maven command when running it: -Dspring-boot.run.profiles=dev
. application.yml
file in the src/main/resouces
directory (take a copy of the template.application.yml
file, fill in the values according to your implementation).mvn spring-boot:run
in the terminal, or launch the FileDeliveryApiApplication
class from your IDE. If you use specific application.properties
files, for example, application-dev.properties
, you can specify which .properties
configuration to use, for example: mvn spring-boot:run -Dspring-boot.run.profiles=dev
will use application-dev.properties
.To run the User Service:
application.yml
file in the src/main/resouces
directory (take a copy of the template.application.yml
file, fill in the values according to your implementation).mvn spring-boot:run
in the terminal, or launch the ServerManagerApplication
class from your IDE. The web module is a React application. You need to install the dependencies (Javascript libraries) for the project first: run yarn install
in the project directory.
To run a debug-version (during development), run yarn start
in the project directory.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits. You will also see any lint errors in the console.
Run yarn build
to get a minified production-ready version of the site, it will be stored in the build
directory.
We have created a docker image called autopacker/local-config-server that will distribute application.yml properties to the backend services without needing specify the values yourself. The only requirement to use this option is that the mysql database username is root and the password is left empty. The Mongo database also has the username root, but the password here is: password.
If you are using docker you can easily setup the whole working environment with four steps. If you copy paste all the code lines below you should have a fully working development environment running on your machine!
We have created a local development keycloak server that can be run with:
docker container run -d --name keycloak -p 8080:8080 autopacker/local-keycloak
This will setup a local keycloak server on your host computer with the admin credentials (username: admin, password: admin). It also holds an example user (username: user, password: user)
Just creating a mysql container with a desired database set as environment property:
docker container run -d --name mysql-backend -p 3306:3306 -e MYSQL_DATABASE=autopacker -e MYSQL_USER=root -e MYSQL_PASSWORD= -e MYSQL_ALLOW_EMPTY_PASSWORD=1 autopacker/local-mysql-backend
docker run --name mongodb -e MONGO_INITDB_ROOT_USERNAME=root -e MONGO_INITDB_ROOT_PASSWORD=password -dp 27017:27017 mongo
Using this pre-created local config server you don't have to specify any properties unless you use custom values deviating from the database credentials mentioned further up. The config server is run with:
docker container run -d --name config-server -p 8888:8888 autopacker/local-config-server
When you have the four containers (MySQL, Mongo, Keycloak, Config Server) up and running you should be ready to start developing. Just run the backend services and they should be able to connect to the other services without any problems
TODO - Explain how to run the automated tests for this system
TODO Add additional notes about how to deploy this on a live system.
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details