Skip to content

Commit

Permalink
Update documentation (#92)
Browse files Browse the repository at this point in the history
* Update private branch name

* Update versions

* Configure sonar

---------

Co-authored-by: kaklakariada <[email protected]>
  • Loading branch information
kaklakariada and kaklakariada authored May 11, 2024
1 parent 12d6869 commit a8fe2ea
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@
"**/.settings": true,
"**/.factorypath": true
},
"java.configuration.updateBuildConfiguration": "automatic"
"java.configuration.updateBuildConfiguration": "automatic",
"sonarlint.connectedMode.project": {
"connectionId": "kaklakariada-github",
"projectKey": "aws-ec2-controller-backend"
}
}
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ EC2 controller uses the following technologies:
* Authentication and Authorization: Cognito
* Static web content: Cloudfront and S3
* Frontend: React and AWS Amplify
* Backend: API-Gateway and Lambda
* Backend: API-Gateway (REST API) and Lambda
* Storage: DynamoDb
* Deployment: Cloudformation / CDK
* Backend framework: Java 11 and Micronaut
* Deployment: CloudFormation / CDK
* Backend framework: Java 21 and Micronaut with SnapStart

![Architecture](arch/architecture.png "Architecture")

Expand All @@ -32,14 +32,14 @@ To deploy this in your AWS account you will need the following:

On your local machine you will need the following:

* [Node.js](https://nodejs.org/en/) 16.x
* Java Development Kit (JDK) 11 (e.g. from [Adoptium](https://adoptium.net/?variant=openjdk11&jvmVariant=hotspot))
* [Node.js](https://nodejs.org/en/) 22
* Java Development Kit (JDK) 21 (e.g. from [Adoptium](https://adoptium.net/?variant=openjdk21&jvmVariant=hotspot))
* [AWS Command line interface](https://aws.amazon.com/cli/)
* Configure AWS credentials for the AWS CLI by calling `aws configure`

### Build backend

```bash
```sh
cd backend
./gradlew clean build
```
Expand Down Expand Up @@ -68,7 +68,7 @@ export const CONFIG: InfrastructureConfig = {

### Deploy infrastructure and backend

```bash
```sh
cd infrastructure
npm run cdk deploy
```
Expand Down Expand Up @@ -102,7 +102,7 @@ exports.CONFIG = {

### Deploy frontend

```bash
```sh
cd frontend
npm run deploy
```
Expand Down Expand Up @@ -146,20 +146,20 @@ HOSTED_ZONE_ID = XXXXXXXXXXXXXX

Then start the local server:

```bash
```sh
cd backend
./gradlew runServer
```

#### Check for dependency updates

```bash
```sh
./gradlew dependencyUpdates
```

#### Configure eclipse project

```bash
```sh
cd backend
./gradlew eclipse
```
Expand All @@ -168,28 +168,28 @@ cd backend

Run local frontend during development:

```bash
```sh
cd frontend
npm start
```

### Upgrade dependencies in `package.json`

```bash
```sh
npx npm-check-updates -u && npm install
```

### Managing configuration in a private branch

This project requires some configuration files with deployment specific information, e.g. domain names that should not be stored in a public git repository. That's why these files are added to `.gitignore`. If you want to still keep your configuration under version control you can do so in a private branch (e.g. `private-master`) that you could push to a private repository only.
This project requires some configuration files with deployment specific information, e.g. domain names that should not be stored in a public git repository. That's why these files are added to `.gitignore`. If you want to still keep your configuration under version control you can do so in a private branch (e.g. `private-main`) that you could push to a private repository only.

When switching from `private-master` to the public `main` branch, git will delete the configuration files. To restore them you can use the following command:
When switching from `private-main` to the public `main` branch, git will delete the configuration files. To restore them you can use the following command:

```bash
git show private-master:frontend/deploy/deploy-config.js > frontend/deploy/deploy-config.js \
&& git show private-master:frontend/src/frontend-config.ts > frontend/src/frontend-config.ts \
&& git show private-master:backend/local-server-env.properties > backend/local-server-env.properties \
&& git show private-master:infrastructure/infrastructure-config.ts > infrastructure/infrastructure-config.ts
```sh
git show private-main:frontend/deploy/deploy-config.js > frontend/deploy/deploy-config.js \
&& git show private-main:frontend/src/frontend-config.ts > frontend/src/frontend-config.ts \
&& git show private-main:backend/local-server-env.properties > backend/local-server-env.properties \
&& git show private-main:infrastructure/infrastructure-config.ts > infrastructure/infrastructure-config.ts
```

### Troubleshooting
Expand All @@ -210,15 +210,15 @@ Add an entry for your instance to the DynamoDB table and set `controlAllowed` to

Configure project using gradle and refresh project in Eclipse:

```bash
```sh
cd backend && ./gradlew eclipse
```

#### Unit test fail with a `NullPointerException` when running in Eclipse

Configure project using gradle and refresh project in Eclipse:

```bash
```sh
cd backend && ./gradlew eclipse
```

Expand Down

0 comments on commit a8fe2ea

Please sign in to comment.