Skip to content

Commit

Permalink
📰 Updating project documentation (#79)
Browse files Browse the repository at this point in the history
* update backend readme

* windows casing delete first

* windows casing add

* windows casing delete first

* windows casing add

* windows casing delete first

* windows casing add

* windows casing delete first

* windows casing add

* lint

* update npm jackage info

only seen privately in artifactory

* revamp branding

* detailing usage of lockfiles

* fixup changelong typos

* create infra readme

* Update readme.md

* Update upload.yml
  • Loading branch information
prince-chrismc authored Feb 7, 2021
1 parent 4d4cdd1 commit ee02264
Show file tree
Hide file tree
Showing 10 changed files with 209 additions and 130 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ jobs:
echo 'email = prince.chrismc@gmail.com' >> ~/.npmrc
echo 'always-auth = true' >> ~/.npmrc
npm pack
npm publish --registry $NPM_REGISTRY_URL $NAME-$BUILD_VERSION.tgz
npm publish --registry $NPM_REGISTRY_URL $NAME-frontend-$BUILD_VERSION.tgz
test:
needs: [setup, backend-image, frontend-image]
Expand Down
41 changes: 41 additions & 0 deletions .infra/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# User Management Deployment

## Setup

### Pulumi Configuration

Select the target stack

```sh
pulumi stack select dev
```
### Dependencies
Install dependencies
```sh
npm install
```
## Development
Preview deployment
```sh
pulumi preview
```
### Updating dependencies
```sh
npm update
```
## Usage
Deploy
```sh
pulumi up
```
23 changes: 0 additions & 23 deletions README.md

This file was deleted.

83 changes: 0 additions & 83 deletions backend/README.md

This file was deleted.

113 changes: 113 additions & 0 deletions backend/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# User Management Back-end

## Setup

### Conan Configuration

> :warning: This **must** be done before any usage!
If that is not possible, you will need to clear your conan cache. This can be done using `conan remove -f '*'`

Enable recipe revisions

```sh
conan config set general.revisions_enabled=1
```

#### Targeting different `C` library implementations

The Conan default `settings.yml` does not take these into account. The settings model can be extended by doing the following:

1. install an extended settings model

```sh
conan config install .conan/settings.yml
```

2. configure your profile (or build settings)

```sh
conan profile update settings.compiler.musl=1.2 default
# or
conan profile update settings.compiler.glibc=2.32 default
```

## Development

Generate build files via CMake

```sh
mkdir build
cmake ..
```

Build the project

```sh
cmake --build . # from the build folder
```

Enable building tests

```sh
cmake .. -DBUILD_TESTS=ON
```

Enable building tests

```sh
cmake .. -DRUN_TIDY=ON
```

### Updating dependencies

To update the top level `conan.lock` run:

```sh
conan lock create conanfile.py --version=1.0.0-dev.0 --base --update
```

```sh
cd build && conan install .. -s build_type=Debug --lockfile=../conan.lock
```

*Note*: You will need to change the "build type" to match your intentions

## Usage

### Lock Dependency graph

```sh
conan lock create conanfile.py --version 1.0.0-dev.0+`git rev-parse --short HEAD` --lockfile=conan.lock --lockfile-out=locks/conan.lock
```

### Package Back-end

```sh
conan create conanfile.py 1.0.0-dev.0+`git rev-parse --short HEAD`@ --lockfile locks/conan.lock
```

### Install Application

> :notebook: This step requires the [packing](#package) to be completed first
```sh
conan install user-managment/1.0.0-dev.0+`git rev-parse --short HEAD` --lockfile locks/conan.lock
```

### Build Docker Image

```sh
docker build . -f Dockerfile -t user-managment-backend:1.0.0-dev.0 # Docker does not support SemVer build information
```

## Run Container

```sh
docker run --rm -d -p 8443:8443 -v "$(pwd):/dist" user-managment-backend:1.0.0-dev.0
```

> :notebook: By default the back-end image is setup for HTTPS for unsecure transport use the following
```sh
docker run --rm -d -p 8080:8080 -v "$(pwd):/dist" user-managment-backend:1.0.0-dev.0 dist -a "0.0.0.0" -p 8080 -n 4
```
8 changes: 4 additions & 4 deletions CHANGELOG.md → changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).1
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).

## [v1.0.0-dev.0](https://github.com/prince-chrismc/user-management/tree/v1.0.0-dev.0) (2020-08-12)

Expand All @@ -9,9 +9,9 @@ All notable changes to this project will be documented in this file. This projec
**:dart: Features:**

- Minimal API set for viewing, adding, editing, removing users
- With Documentation hosted on GitHub Pages
- Functional back-end C++14 inomplementation
- Feature complete front-end in ReactJS 16 that is Webpacked
- With documentation hosted on GitHub Pages
- Functional back-end with a C++14 implementation
- Feature complete front-end in ReactJS 16 that is built using webpack
- AWS EC2 instance hosting the working proof-of-concept

**Merged pull requests:**
Expand Down
Binary file removed docs/Hello-React-From-Cpp-Diagram.png
Binary file not shown.
38 changes: 38 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# User Management [![Docs](https://img.shields.io/badge/API%20Documentation-master-blue)](https://prince-chrismc.github.io/user-management/)

An open-source application delivering a responsive user management experience.

<p align="center">
<img src="https://raw.githubusercontent.com/prince-chrismc/user-management/master/docs/Screencast-2020-07-18-230754.gif">
</p>

## :microscope: Technical Overview

This repository contains a distributed cloud native application comprised of two compents:

* [Front-end](web-app/) - Primary point of interaction with users. It is a [React](https://reactjs.org/) client side application build using [webpack](https://webpack.js.org) for _fast_ surfing.
* [Back-end](backend/) - Centralized data store containing the information of all known users. Written in [C++](https://isocpp.org/) for flexibility and scalability it leverages many Open-Source technologies [listed here](backend/conan.lock).

## :rocket: Cloud Deployments

> :information_source: The goal for this project is to span multiple public :cloud: clouds, some information may be out of date.
| Component | Status | Link
| --- | --- | --- |
| Back-end | ![staging is online][staging-online] | [AWS ECS Fargate][be]
| Front-end | ![staging is online][staging-online] | [AWS ECS Fargate][fe]
| Unified (deprecated) | ![production is stable][prod-stable] | [AWS EC2][u] |

[staging-online]: https://img.shields.io/badge/Staging-online-blue
[prod-stable]: https://img.shields.io/badge/Production-stable-brightgreen

[be]: http://backend-b54ef0d-1b76226fd6250e07.elb.us-east-2.amazonaws.com:8080
[fe]: http://frontend-aec25d0-96d61837c91fead3.elb.us-east-2.amazonaws.com
[u]: https://ec2-18-222-250-141.us-east-2.compute.amazonaws.com

## :man_scientist: Development Summary

| Component | Build | Coverage |
| --- | --- | --- |
| Back-end | [![C++ CI](https://github.com/prince-chrismc/user-management/workflows/C++%20CI/badge.svg)](https://github.com/prince-chrismc/user-management/actions?query=workflow%3A%22C%2B%2B+CI%22)| [![Coverage Status](https://coveralls.io/repos/github/prince-chrismc/user-management/badge.svg?branch=master)](https://coveralls.io/github/prince-chrismc/user-management?branch=master) |
| Front-end | [![Node.js CI](https://github.com/prince-chrismc/user-management/workflows/Node.js%20CI/badge.svg)](https://github.com/prince-chrismc/user-management/actions?query=workflow%3A%22Node.js+CI%22) | [![codecov](https://img.shields.io/codecov/c/github/prince-chrismc/user-management)](https://codecov.io/gh/prince-chrismc/user-management) |
26 changes: 10 additions & 16 deletions web-app/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"name": "user-management",
"name": "user-management-frontend",
"version": "1.0.0-dev.0",
"description": "React web application hosted from a C++ web server",
"main": "index.js",
"author": "Chris Mc",
"description": "An open-source UI delivering a responsive user management experience",
"homepage": "https://github.com/prince-chrismc/user-management/tree/master/web-app#readme",
"keywords": [
"user",
"management"
],
"license": "MIT",
"author": "prince-chrismc",
"main": "index.js",
"scripts": {
"dev": "webpack-dev-server --env.env=dev --env.API_URL=https://ec2-18-222-250-141.us-east-2.compute.amazonaws.com",
"dev:bundleanalyzer": "yarn dev --env.addons=bundleanalyzer",
Expand Down Expand Up @@ -79,17 +84,6 @@
"webpack-dev-server": "^3.11.2",
"webpack-merge": "^4.2.1"
},
"keywords": [
"react",
"react 16",
"boilerplate",
"semantic ui",
"semantic ui react",
"webpack 4",
"webpack",
"hot module replacement",
"hmr"
],
"browserslist": "> 2%, not dead",
"jest": {
"setupFiles": [
Expand All @@ -104,4 +98,4 @@
"\\.(css|less)$": "identity-obj-proxy"
}
}
}
}
5 changes: 2 additions & 3 deletions web-app/README.md → web-app/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Run ESlint
yarn lint
```

#### Updating dependencies
### Updating dependencies

A _light_ update within semver range (low risk to break)

Expand Down Expand Up @@ -88,8 +88,7 @@ yarn pack
docker build . -f Dockerfile -t user-managment-frontend:1.0.0-dev.0 # Docker does not support SemVer build information
```

As an alternative, the previsous two teps (package and build image), can be execture with

As an alternative, the previsous two teps (package and build image), can be execture with the multistage builder

```sh
docker build . -f Dockerfile.multistage \
Expand Down

2 comments on commit ee02264

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.