# Development environment

You can start a development environment by following these few steps :&#x20;

### API

```bash
# In your workspace
git clone git@github.com:romainlavabre/backend-free-commit.git
cd backend-free-commit/docker/dev

cp .env.sample .env

# Complete the .env file

docker compose -f compose-full-stack.yaml up -d --build --force-recreate 

docker container ls
api # Java backend
reverse-proxy # Traefik
database # Mysql server
client-database # Adminer

```

### Client

```bash
# In your workspace
git clone git@github.com:romainlavabre/frontend-free-commit.git
cd frontend-free-commit

yarn && yarn start
```

### Location

<table><thead><tr><th>Site</th><th>URL</th><th data-hidden></th></tr></thead><tbody><tr><td>API</td><td>http://locahost/api </td><td></td></tr><tr><td>Database GUI</td><td>http://locahost/database</td><td></td></tr><tr><td>API GUI</td><td>http://locahost:3000</td><td></td></tr></tbody></table>

### Update changes

#### API

```bash
docker compose up -d --build --force-recreate api && docker container logs api -f

# For a slower computer

docker compose up -d --build --force-recreate api && sleep 2 && docker container logs api -f
```

### Client

Updates are automatically reloaded with the websocket provided by the React development server

### Database

If you want freeze update, set

```properties
spring.jpa.hibernate.ddl-auto=update
```

to&#x20;

```properties
spring.jpa.hibernate.ddl-auto=none
```

And reverse it if you want updates to be automatically applied
