I-Sparkle development uses Docker. Using Docker simplifies and standardizes the development environment so that developers can quickly and easily start developing I-Sparkle.
- Install Docker from here. In the Docker preferences, set the RAM to at least 5GB.
- In the same folder, checkout I-Sparkle-Docker-Dev (this project), I-Sparkle-API, and I-Sparkle-Client.
$ git clone https://github.com/I-Sparkle-Germany/I-Sparkle-Docker-Dev
$ git clone https://github.com/I-Sparkle-Germany/I-Sparkle-API
$ git clone https://github.com/I-Sparkle-Germany/I-Sparkle-Client
$ ls
I-Sparkle-Docker-Dev
I-Sparkle-API
I-Sparkle-Client
- Run
npm installin I-Sparkle-Client directory
$ cd I-Sparkle-Client
I-Sparkle-Client $ npm install
- Run
docker compose upin the I-Sparkle-Docker-Dev directory
$ cd ../I-Sparkle-Docker-Dev
I-Sparkle-Docker-Dev $ docker compose up
- Wait for everything to download, compile, and start. This can take a while depending on your computer and connection speeds. When you see this in the output, all of the application has started:
...
i-sparkle-client | ** Angular Live Development Server is listening on 0.0.0.0:4200, open your browser on http://localhost:4200/ **
i-sparkle-client |
i-sparkle-client |
i-sparkle-client | ✔ Compiled successfully.
- When you see the above output in your log output, I-Sparkle will be running at http://localhost:81. Go there with your browser to load the I-Sparkle homepage.
- Log in with admin/pass, or previewuser/wise.
Any changes that you make to the source code will be automatically compiled and reloaded in the browser.
- Start/Stop development containers
$ docker-compose [up/down]
- List running containers
$ docker container ls
- Restart container (ex: 'i-sparkle-client')
$ docker restart i-sparkle-client
- Access container's command line (ex: 'i-sparkle-client')
$ docker exec -it i-sparkle-client sh
- Run 'npm test' in i-sparkle-client container
$ docker exec -it i-sparkle-client npm test
- Run 'npm test' in i-sparkle-client container with the watch option
$ docker exec -it i-sparkle-client npm test -- "--watch=true"
- Run 'maven test' in i-sparkle-api container
$ docker exec -it i-sparkle-api mvn test
- Connect to MySQL container (password: iamroot)
$ docker run -it --network i-sparkle-docker-dev_default --rm mysql:8 mysql -hi-sparkle-mysql -uroot -p
- Import data from mysqldump
$ docker exec -i i-sparkle-mysql sh -c 'exec mysql wise_database -uroot -p"$MYSQL_ROOT_PASSWORD"' < ~/path_to/wise_database_dump.sql
- Dump data from MySQL container
$ docker exec -i i-sparkle-mysql sh -c 'exec mysqldump wise_database -uroot -p"$MYSQL_ROOT_PASSWORD"' > wise_database_dump.sql
Please head over to our wiki page for additional documentation, like how to run the unit tests and commonly-used Docker commands.
Open-source license: GNU General Public License, v3. See LICENSE.txt for details.