Skip to content

Commit

Permalink
Merge pull request #8 from lwestfall/dev
Browse files Browse the repository at this point in the history
Many changes
  • Loading branch information
lwestfall authored Dec 15, 2023
2 parents 40625ba + ba3fd0d commit 1a82052
Show file tree
Hide file tree
Showing 102 changed files with 1,734 additions and 188 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Angular CI

on:
pull_request:
branches: ["*"]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "*"

- name: Install dependencies
run: |
cd src/Client
npm install
- name: Build
run: |
cd src/Client
npm run build
27 changes: 27 additions & 0 deletions .github/workflows/build-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: ASP.NET Core CI

on:
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.0.x" # specify your .NET Core version here

- name: Restore dependencies
run: |
cd src/Server
dotnet restore
- name: Build
run: |
cd src/Server
dotnet build --no-restore
42 changes: 42 additions & 0 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and Push Docker Images

on:
push:
branches:
- main

jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: Server
path: src/Server
image: cbc-api
build_args: ""
# - name: Client - Production
# path: src/Client
# image: cbc-app-prod
# build_args: "--build-arg PROFILE=prod"
- name: Client - Test
path: src/Client
image: cbc-app-test
build_args: "--build-arg PROFILE=staging"

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and Push Docker Image
if: contains(github.event.head_commit.modified, matrix.path)
run: |
cd ${{ matrix.path }}
docker build ${{ matrix.build_args }} -t ${{ secrets.DOCKER_USERNAME }}/${{ matrix.image }} .
docker push ${{ secrets.DOCKER_USERNAME }}/${{ matrix.image }}:latest
14 changes: 14 additions & 0 deletions .vscode/CitrusBookCollective.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"folders": [
{
"path": ".."
},
{
"path": "../src/Client"
},
{
"path": "../src/Server"
}
],
"settings": {}
}
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Citrus Book Collective

We are a group of people who like to read and talk about books. We meet sometimes to discuss books we've read and to vote on which book we will read next. This application is designed to help us organize our meetings and book votes.

This repository constains the source for the website. The application is still in active development and not yet in production, however the test site is currently hosted at [cbc-test.ljdub.com](https://cbc-test.ljdub.com).
6 changes: 5 additions & 1 deletion src/Client/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.formatOnSave": true,
"eslint.format.enable": true
}
1 change: 1 addition & 0 deletions src/Client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ RUN npm run build-${PROFILE}

FROM nginx:alpine
COPY --from=node /app/dist/cbc/browser /usr/share/nginx/html
COPY /nginx.conf /etc/nginx/conf.d/default.conf
32 changes: 7 additions & 25 deletions src/Client/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,9 @@
"outputPath": "dist/cbc",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"assets": ["src/favicon.ico", "src/assets"],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css"
Expand Down Expand Up @@ -105,37 +100,24 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"polyfills": ["zone.js", "zone.js/testing"],
"tsConfig": "tsconfig.spec.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
"scripts": []
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
}
}
}
}
},
"cli": {
"schematicCollections": [
"@angular-eslint/schematics"
],
"schematicCollections": ["@angular-eslint/schematics"],
"analytics": false
}
}
20 changes: 20 additions & 0 deletions src/Client/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
server {
listen 80;
sendfile on;
default_type application/octet-stream;

gzip on;
gzip_http_version 1.1;
gzip_disable "MSIE [1-6]\.";
gzip_min_length 256;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_comp_level 9;

root /usr/share/nginx/html;

location / {
try_files $uri $uri/ /index.html =404;
}
}
14 changes: 14 additions & 0 deletions src/Client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@ng-bootstrap/ng-bootstrap": "^16.0.0",
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.2",
"moment": "^2.29.4",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.2"
Expand Down
59 changes: 59 additions & 0 deletions src/Client/src/app/animations.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import {
animate,
animateChild,
group,
query,
style,
transition,
trigger,
} from '@angular/animations';

export const slideInAnimation = trigger('routeAnimations', [
transition('HomePage <=> BooksPage', [
style({ position: 'relative' }),
query(':enter, :leave', [
style({
position: 'absolute',
left: 0,
width: '100%',
}),
]),
query(':enter', [style({ left: '-100%' })], { optional: true }),
query(':leave', animateChild(), { optional: true }),
group([
query(':leave', [animate('300ms ease-out', style({ left: '100%' }))], {
optional: true,
}),
query(':enter', [animate('300ms ease-out', style({ left: '0%' }))], {
optional: true,
}),
]),
]),
transition('* <=> *', [
style({ position: 'relative' }),
query(
':enter, :leave',
[
style({
position: 'absolute',
left: 0,
width: '100%',
}),
],
{ optional: true }
),
query(':enter', [style({ left: '-100%' })], { optional: true }),
query(':leave', animateChild(), { optional: true }),
group([
query(
':leave',
[animate('200ms ease-out', style({ left: '100%', opacity: 0 }))],
{ optional: true }
),
query(':enter', [animate('300ms ease-out', style({ left: '0%' }))], {
optional: true,
}),
query('@*', animateChild(), { optional: true }),
]),
]),
]);
8 changes: 5 additions & 3 deletions src/Client/src/app/api/api.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/* tslint:disable */
/* eslint-disable */
import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';
import { ApiConfiguration, ApiConfigurationParams } from './api-configuration';

import { BooksService } from './services/books.service';
import { MeetingsService } from './services/meetings.service';
import { MiscService } from './services/misc.service';
import { UsersService } from './services/users.service';

/**
Expand All @@ -18,6 +19,7 @@ import { UsersService } from './services/users.service';
providers: [
BooksService,
MeetingsService,
MiscService,
UsersService,
ApiConfiguration
],
Expand All @@ -35,12 +37,12 @@ export class ApiModule {
}
}

constructor(
constructor(
@Optional() @SkipSelf() parentModule: ApiModule,
@Optional() http: HttpClient
) {
if (parentModule) {
throw new Error('ApiModule is already loaded. import in your base AppModule only.');
throw new Error('ApiModule is already loaded. Import in your base AppModule only.');
}
if (!http) {
throw new Error('You need to import the HttpClientModule in your AppModule! \n' +
Expand Down
2 changes: 1 addition & 1 deletion src/Client/src/app/api/base-service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* tslint:disable */
/* eslint-disable */
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ApiConfiguration } from './api-configuration';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Client/src/app/api/fn/books/create-book-plain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { RequestBuilder } from '../../request-builder';
import { StrictHttpResponse } from '../../strict-http-response';
import { RequestBuilder } from '../../request-builder';

import { BookDto } from '../../models/book-dto';
import { CreateBookDto } from '../../models/create-book-dto';
Expand Down
2 changes: 1 addition & 1 deletion src/Client/src/app/api/fn/books/create-book.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { RequestBuilder } from '../../request-builder';
import { StrictHttpResponse } from '../../strict-http-response';
import { RequestBuilder } from '../../request-builder';

import { BookDto } from '../../models/book-dto';
import { CreateBookDto } from '../../models/create-book-dto';
Expand Down
2 changes: 1 addition & 1 deletion src/Client/src/app/api/fn/books/get-book-plain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { RequestBuilder } from '../../request-builder';
import { StrictHttpResponse } from '../../strict-http-response';
import { RequestBuilder } from '../../request-builder';

import { BookDto } from '../../models/book-dto';

Expand Down
Loading

0 comments on commit 1a82052

Please sign in to comment.