Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
LimpidCrypto committed Feb 28, 2024
1 parent 3cb4b34 commit def6cbc
Show file tree
Hide file tree
Showing 52 changed files with 13,157 additions and 1,490 deletions.
6 changes: 6 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& cargo install sea-orm-cli cargo-insta \
&& chown -R vscode /usr/local/cargo

# Install Node.js and npm
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
&& apt-get install -y nodejs
# Install Angular CLI
RUN npm install -g @angular/cli

COPY .env /.env
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "lc_api_template",
"name": "lc_saas_template",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace]

[package]
name = "lc_api_template"
name = "lc_saas_template"
version = "0.1.0"
edition = "2021"

Expand Down Expand Up @@ -42,7 +42,7 @@ git = "https://github.com/LimpidCrypto/lc_user.git"
rev = "edfbe35"

[[bin]]
name = "lc_api_template-cli"
name = "lc_saas_template-cli"
path = "src/bin/main.rs"
required-features = []

Expand Down
6 changes: 3 additions & 3 deletions config/development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ server:
precompressed: false
folder:
uri: "/"
path: "frontend/dist"
fallback: "frontend/dist/index.html"
path: "frontend/dist/frontend/browser"
fallback: "frontend/dist/frontend/browser/index.html"

# Worker Configuration
workers:
Expand Down Expand Up @@ -108,7 +108,7 @@ mailer:
# Database Configuration
database:
# Database connection URI
uri: {{ get_env(name="DATABASE_URL", default="postgres://loco:loco@localhost:5432/lc_api_template_development") }}
uri: {{ get_env(name="DATABASE_URL", default="postgres://loco:loco@localhost:5432/lc_saas_template_development") }}
# When enabled, the sql query will be logged.
enable_logging: false
# Set the timeout duration when acquiring a connection.
Expand Down
2 changes: 1 addition & 1 deletion config/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ mailer:
# Database Configuration
database:
# Database connection URI
uri: {{ get_env(name="DATABASE_URL", default="postgres://loco:loco@localhost:5432/lc_api_template_test") }}
uri: {{ get_env(name="DATABASE_URL", default="postgres://loco:loco@localhost:5432/lc_saas_template_test") }}
# When enabled, the sql query will be logged.
enable_logging: false
# Set the timeout duration when acquiring a connection.
Expand Down
2 changes: 1 addition & 1 deletion examples/playground.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use eyre::Context;
use lc_saas_template::app::App;
#[allow(unused_imports)]
use loco_rs::{cli::playground, prelude::*};
use lc_api_template::app::App;

#[tokio::main]
async fn main() -> eyre::Result<()> {
Expand Down
16 changes: 16 additions & 0 deletions frontend/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
55 changes: 37 additions & 18 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,42 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
# See http://help.github.com/ignore-files/ for more about ignoring files.

node_modules
dist-ssr
*.local
# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Editor directories and files
# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.idea
.history/*

# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

# System files
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
Thumbs.db
4 changes: 4 additions & 0 deletions frontend/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
"recommendations": ["angular.ng-template"]
}
20 changes: 20 additions & 0 deletions frontend/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "ng serve",
"type": "chrome",
"request": "launch",
"preLaunchTask": "npm: start",
"url": "http://localhost:4200/"
},
{
"name": "ng test",
"type": "chrome",
"request": "launch",
"preLaunchTask": "npm: test",
"url": "http://localhost:9876/debug.html"
}
]
}
42 changes: 42 additions & 0 deletions frontend/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "start",
"isBackground": true,
"problemMatcher": {
"owner": "typescript",
"pattern": "$tsc",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "(.*?)"
},
"endsPattern": {
"regexp": "bundle generation complete"
}
}
}
},
{
"type": "npm",
"script": "test",
"isBackground": true,
"problemMatcher": {
"owner": "typescript",
"pattern": "$tsc",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "(.*?)"
},
"endsPattern": {
"regexp": "bundle generation complete"
}
}
}
}
]
}
34 changes: 14 additions & 20 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,27 @@
# Saas Frontend
# Frontend

# Development
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.2.1.

To get started with the development of the SaaS frontend, follow these steps:
## Development server

### 1. Install Packages
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.

Use the following command to install the required packages using pnpm:
## Code scaffolding

```sh
pnpm install
```
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

### 2. Run in Development Mode
## Build

Once the packages are installed, run your frontend application in development mode with the following command:
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.

```sh
pnpm dev
```
## Running unit tests

This will start the development frontend server serving via vit
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

### 3. Build The application
## Running end-to-end tests

To build your application run the following command:
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

```sh
pnpm build
```
## Further help

After the build `dist` folder is ready to served by loco. run loco `cargo loco start` and the frontend application will served via Loco
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
104 changes: 104 additions & 0 deletions frontend/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"frontend": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/frontend",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "frontend:build:production"
},
"development": {
"buildTarget": "frontend:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"buildTarget": "frontend:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": []
}
}
}
}
},
"cli": {
"analytics": false
}
}
Binary file removed frontend/dist/assets/favicon-WRxYIZSq.ico
Binary file not shown.
Loading

0 comments on commit def6cbc

Please sign in to comment.