Development Setup
Getting Started
For the backend the Laravel php framework is used. For development Laravel includes Laravel Sail, a setup using Docker and Docker Compose. To get started, follow these steps:
Install Docker as described in the official Docker docs
If you're running Docker on Linux, follow the post-installation steps to manage docker as a non-root user
Install Docker Compose as described in the official Docker Compose docs
Run the boostrap.sh script in order to setup a fresh installation:
./bin/dev/bootstrap.sh
Usage
Following the steps above to start the local development setup, you will have
- the Laravel application available at http://localhost:8000
- the GraphiQL IDE available at http://localhost:8000/graphiql
- the interactive GraphQL Voyager graph representation available at http://localhost:8000/graphql-voyager
Have a look at the official Laravel Sail docs to see all possible commands and things you can do with it. Here a selection of the most used commands (also using custom scripts in ./bin):
Command | Description |
---|---|
./bin/dev/boostrap.sh | Clean install of everything |
./bin/dev/start.sh | Starts all development servers |
./bin/dev/stop.sh | Stops all containers |
Frontend
For the Frontend a SPA using Vue.js is included at resources/frontend. For the developers' convenience, there's a package.json in the project root which provides shortcuts to scripts defined in resources/frontend/package.json.
You can use the ./bin/dev/start.sh
script to startup the development vite server. The app is still accessible at http://localhost:8000 but will now use the assets compiled on the fly with vite and it's hot module replacement feature.
E2E Tests
When running e2e tests locally, you have to do this from your machine (not from inside the docker container) for the moment. So instead of running sail npm run frontend:test:e2e
you should just run npm run frontend:test:e2e
.
Documentation
An interactive website for documentation built with VitePress is included as well at docs.
You can use the ./bin/dev/start.sh
script to startup the development docs server at http://localhost:8080.
Errors when running locally
Whenever you experience any error trying to run Open Case locally, please follow these steps:
- Bring down the composer setup, including the volumes (this will delete all persisted data):
sail down -v
- Delete the
.env
:
rm .env
- Run the bootstrap script again:
./bin/dev/bootstrap.sh
If the issues persists, please check all GitLab Issues labeled with bug and dx/code style for possible previous fixes. If you can't find it, please open up a bug report.