1
0
mirror of https://github.com/XFox111/MuiCharts.git synced 2026-04-22 06:51:05 +03:00

- Moved frontend to a separate folder

- Updated README.md
This commit is contained in:
2024-02-22 18:34:31 +00:00
parent 293222aaba
commit 9c05f4333b
32 changed files with 46 additions and 43 deletions
-22
View File
@@ -1,22 +0,0 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "Node.js & TypeScript",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "yarn install"
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
-12
View File
@@ -1,12 +0,0 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot
version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
+46 -9
View File
@@ -1,14 +1,51 @@
# MuiCharts
Small demo app on .NET/React. Job entry challenge
> **IMPORTANT**: This branch contains the source code for the front-end of the application. The back-end source code is located in the `backend` branch.
## Devcontainers
This repository is equipped with configuration files for Dev Containers feature which allows you to develop this project in a containerized environment. You can use VS Code with Dev Containers extension and Docker or you can use GitHub Codespaces. Read more at [Developing inside a Container](https://code.visualstudio.com/docs/remote/containers).
## Development
```bash
yarn dev
```
## Backend
Path: `/backend`
## Build
```bash
yarn build
```
Backend is a simple ASP.NET Core Web API project with EF Core and SQLite. It provides a RESTful API for the frontend to consume and incorportaes DDD principles.
### Projects
- `MuiCharts.Api` - ASP.NET Core Web API project
- `MuiCharts.Contracts` - Shared Web API contracts that can be extracted into a separate package and shared between the client and the server
- `MuiCharts.Infrastructure` - Infrastructure layer with EF Core and SQLite
- `MuiCharts.Domain` - Domain layer with business logic and models
### Essential variables
Use these properties as environmental variables or CLI arguments to configure the backend:
#### HTTPS
If you want to use Kestrel as your primary web server (with no reverse proxy), you can use the following properties to configure HTTPS with Let's Encrypt certificate:
- `HTTPS_PORTS=443` - Listen for HTTPS requests on port 443
- `LettuceEncrypt:AcceptTermsOfService=true` - bypass interactive prompt
- `LettuceEncrypt:DomainNames:0=example.com` - domain name for the certificate (use `:1`, `:2`, `:3`, etc. to add more)
- `LettuceEncrypt:EmailAddress=eugene@xfox111.net` - email address for certificate issuer
> **Note**: you need to have either a public IP address or a domain name to use Let's Encrypt certificates. Otherwise, use `dotnet dev-certs https` to generate a self-signed certificate.
#### Data persistence
Configure these options if you want to change default paths for data persistence:
- `ConnectionStrings:DataContext=Data Source=/persistence/data.db` - SQLite DB connection string (default: `/persistence/data.db`)
- `LettuceEncrypt:CertificatesPath=/persistence` - path to store Let's Encrypt certificates (default: `/persistence` for `Production` and `data.db` for `Development`)
> **IMPORTANT**: default persistence paths are configured to be used in a Docker container, where the user is `root`. `/persistence` is not writtable by a non-root user, so you need either to change the paths if you want to run the app outside of a container without root privileges or run app as `sudo`.
## Frontend
Path: `/frontend`
Frontend is a simple React app with Material-UI. It consumes the RESTful API provided by the backend (or uses its emulation) and visualizes the data.
> 🚧 WIP
## Docker
Use sample `docker-compose.yml` file to deploy the project on one server using Nginx
## GitHub Actions
Path: `.github/workflows`
There are two GitHub Actions workflows:
- `backend.yml` - CI/CD for the backend. Deploys the app to a remote server using Docker and SSH
- `frontend.yml` - CI/CD for the frontend. Deploys the app to GitHub Pages
View File
View File
View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File
View File