Skip to content

Commit

Permalink
Merge pull request #90 from ChrispyPeaches/develop
Browse files Browse the repository at this point in the history
Releases 0.0.3 - 0.0.5
  • Loading branch information
ChrispyPeaches authored Apr 9, 2024
2 parents bc542df + 6a162b5 commit 5a9a345
Show file tree
Hide file tree
Showing 259 changed files with 20,165 additions and 912 deletions.
9 changes: 9 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Problem
<!--Add a description and the userstory prompt-->

## Definition of Done

## Subtasks
- [x] Subtask 1
- [x] Subtask 2
- [x] etc.
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Fixes #ISSUE_NUMBER

## Problem

### Definition of Done

## Solution

## Documentation

## How was this tested?
6 changes: 3 additions & 3 deletions .github/workflows/build-focusapp.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: Build FocusApp
name: Build FocusApp.Client

on:
push:
Expand All @@ -22,8 +22,8 @@ jobs:
- name: Install .NET Maui
run: dotnet workload install maui
- name: Restore dependencies
run: dotnet restore src/FocusApp/FocusApp.csproj
run: dotnet restore src/FocusApp.Client/FocusApp.Client.csproj
- name: Build
run: dotnet build src/FocusApp/FocusApp.csproj --configuration Release --framework:net8.0-android --no-restore
run: dotnet build src/FocusApp.Client/FocusApp.Client.csproj --configuration Release --framework:net8.0-android --no-restore
# - name: Test
# run: dotnet test --no-build --verbosity normal
42 changes: 42 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and Push Docker Image

on:
push:
branches:
- test

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check Out Repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/focusapi

- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
file: src/FocusAPI/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
21 changes: 20 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# FocusFriends-specific files
*.db

# User-specific files
*.rsuser
*.suo
Expand Down Expand Up @@ -360,4 +363,20 @@ MigrationBackup/
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd
FodyWeavers.xsd

# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/contentModel.xml
/.idea.FocusFriends.iml
/modules.xml
/projectSettingsUpdater.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
.idea
*.DS_Store
13 changes: 13 additions & 0 deletions .idea/.idea.FocusFriends/.idea/.gitignore

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

35 changes: 25 additions & 10 deletions FocusFriends.sln
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FocusCore", "src\FocusCore\FocusCore.csproj", "{996C25C7-AF52-4F70-9735-93147E6BF53D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FocusApp", "src\FocusApp\FocusApp.csproj", "{58ED35D7-3C08-42AC-81A0-DC4B8B086E8A}"
ProjectSection(ProjectDependencies) = postProject
{996C25C7-AF52-4F70-9735-93147E6BF53D} = {996C25C7-AF52-4F70-9735-93147E6BF53D}
EndProjectSection
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FocusApp.Shared", "src\FocusApp.Shared\FocusApp.Shared.csproj", "{2DE49CAB-17F0-4B69-972D-97B69BCDFA1B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FocusApp.Client", "src\FocusApp.Client\FocusApp.Client.csproj", "{E2AAFAC3-08C3-4C6C-AE93-95B95300B72E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FocusApp.Tools", "src\FocusApp.Tools\FocusApp.Tools.csproj", "{C37B9511-E73B-4E1D-BBA4-6D160872381C}"
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{47A7CE9C-83C5-4EB4-AD59-6931446410E6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -37,12 +40,24 @@ Global
{996C25C7-AF52-4F70-9735-93147E6BF53D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{996C25C7-AF52-4F70-9735-93147E6BF53D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{996C25C7-AF52-4F70-9735-93147E6BF53D}.Release|Any CPU.Build.0 = Release|Any CPU
{58ED35D7-3C08-42AC-81A0-DC4B8B086E8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{58ED35D7-3C08-42AC-81A0-DC4B8B086E8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58ED35D7-3C08-42AC-81A0-DC4B8B086E8A}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{58ED35D7-3C08-42AC-81A0-DC4B8B086E8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58ED35D7-3C08-42AC-81A0-DC4B8B086E8A}.Release|Any CPU.Build.0 = Release|Any CPU
{58ED35D7-3C08-42AC-81A0-DC4B8B086E8A}.Release|Any CPU.Deploy.0 = Release|Any CPU
{2DE49CAB-17F0-4B69-972D-97B69BCDFA1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2DE49CAB-17F0-4B69-972D-97B69BCDFA1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2DE49CAB-17F0-4B69-972D-97B69BCDFA1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2DE49CAB-17F0-4B69-972D-97B69BCDFA1B}.Release|Any CPU.Build.0 = Release|Any CPU
{E2AAFAC3-08C3-4C6C-AE93-95B95300B72E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E2AAFAC3-08C3-4C6C-AE93-95B95300B72E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E2AAFAC3-08C3-4C6C-AE93-95B95300B72E}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{E2AAFAC3-08C3-4C6C-AE93-95B95300B72E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E2AAFAC3-08C3-4C6C-AE93-95B95300B72E}.Release|Any CPU.Build.0 = Release|Any CPU
{E2AAFAC3-08C3-4C6C-AE93-95B95300B72E}.Release|Any CPU.Deploy.0 = Release|Any CPU
{C37B9511-E73B-4E1D-BBA4-6D160872381C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C37B9511-E73B-4E1D-BBA4-6D160872381C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C37B9511-E73B-4E1D-BBA4-6D160872381C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C37B9511-E73B-4E1D-BBA4-6D160872381C}.Release|Any CPU.Build.0 = Release|Any CPU
{47A7CE9C-83C5-4EB4-AD59-6931446410E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{47A7CE9C-83C5-4EB4-AD59-6931446410E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{47A7CE9C-83C5-4EB4-AD59-6931446410E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{47A7CE9C-83C5-4EB4-AD59-6931446410E6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# FocusFriends

### Description
Focus Friends is a mobile app that uses a timer to track and record user focus sessions. Users can procure in-app currency from completing focus sessions, and can use this currency to buy items to decorate their digital island. Additionally, users can add friends within the app, and can view their islands as well as compete on daily and weekly focus point leaderboards.

### Useful Links
[Github Project Task Board](https://github.com/users/ChrispyPeaches/projects/1)

[Sprint planning spreadsheet](https://docs.google.com/spreadsheets/d/1yJxfEH3qCUB0c4kXND5IroIexPQezzHdEeYYtUN7NIc/edit?usp=sharing)
[Sprint planning spreadsheet](https://docs.google.com/spreadsheets/d/17KuePYD55K4Jvs0dNnzJrx7JADw_CWJ8gCb0m-1L0Fg/edit?usp=sharing)

[Visual Mockup](https://www.figma.com/file/HG8eqMzI47otQWYFIv5iK7/Focus-Timer-App-MockUp?type=design&node-id=0%3A1&mode=design&t=gdzpRvpkRlAWQJPb-1)

19 changes: 19 additions & 0 deletions docker-compose.dcproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk">
<PropertyGroup Label="Globals">
<ProjectVersion>2.1</ProjectVersion>
<DockerTargetOS>Linux</DockerTargetOS>
<DockerPublishLocally>False</DockerPublishLocally>
<ProjectGuid>86154e51-9282-4e60-92ef-598eb64d9bd1</ProjectGuid>
<DockerLaunchAction>LaunchBrowser</DockerLaunchAction>
<DockerServiceUrl>{Scheme}://localhost:{ServicePort}/swagger</DockerServiceUrl>
<DockerServiceName>focusapi</DockerServiceName>
</PropertyGroup>
<ItemGroup>
<None Include="docker-compose.override.yml">
<DependentUpon>docker-compose.yml</DependentUpon>
</None>
<None Include="docker-compose.yml" />
<None Include=".dockerignore" />
</ItemGroup>
</Project>
7 changes: 7 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: '3.4'

services:
FocusApi:
volumes:
- ${APPDATA}/Microsoft/UserSecrets:/home/app/.microsoft/usersecrets:ro
- ${APPDATA}/ASP.NET/Https:/home/app/.aspnet/https:ro
43 changes: 43 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
version: '3.4'

networks:
FocusApiNetwork:

services:
FocusApi:
container_name: FocusApiContainer
image: ghcr.io/chrispypeaches/focusfriends/focusapi:test
ports:
- 25565:8080
- 25566:8081
build:
context: .
dockerfile: src/FocusAPI/Dockerfile
depends_on:
- FocusApiDb
environment:
ASPNETCORE_URLS: "http://+:8080"
ASPNETCORE_ENVIRONMENT: Test
ASPNETCORE_HTTP_PORTS: 8080
ASPNETCORE_HTTPS_PORTS: 8081
env_file:
- stack.env
FocusApiDb:
container_name: focusapidb
hostname: focusapidb
user: root
image: mcr.microsoft.com/mssql/server:2022-latest
ports:
- 8002:1433
environment:
- ACCEPT_EULA=Y
env_file:
- stack.env
volumes:
- focusapidb_data:/var/opt/mssql:rw

volumes:
focusapidb_data:
name: focusapidb_data
external: false

11 changes: 11 additions & 0 deletions launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"profiles": {
"Docker Compose": {
"commandName": "DockerCompose",
"commandVersion": "1.0",
"serviceActions": {
"focusapi": "StartDebugging"
}
}
}
}
58 changes: 58 additions & 0 deletions src/FocusAPI/Controllers/LeaderboardController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
using Microsoft.AspNetCore.Mvc;
using MediatR;
using FocusCore.Queries.Leaderboard;
using FocusCore.Models;
using FocusCore.Responses.Leaderboard;

namespace FocusAPI.Controllers
{
[ApiController]
[Route("[controller]")]
public class LeaderboardController : ControllerBase
{
private readonly ILogger<UserController> _logger;
private IMediator _mediator;

public LeaderboardController(ILogger<UserController> logger, IMediator mediator)
{
_logger = logger;
_mediator = mediator;
}

[HttpGet]
[Route("Daily")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<ActionResult<LeaderboardResponse>> GetDailyLeaderboard([FromQuery] GetDailyLeaderboardQuery query, CancellationToken cancellationToken)
{
try
{
LeaderboardResponse result = await _mediator.Send(query, cancellationToken);
return Ok(result);
}
catch (Exception ex)
{
_logger.Log(LogLevel.Debug, "Error retreiving daily leaderboards. Message: " + ex.Message);
return StatusCode(500);
}
}

[HttpGet]
[Route("Weekly")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<ActionResult<LeaderboardResponse>> GetWeeklyLeaderboard([FromQuery] GetWeeklyLeaderboardQuery query, CancellationToken cancellationToken)
{
try
{
LeaderboardResponse result = await _mediator.Send(query, cancellationToken);
return Ok(result);
}
catch (Exception ex)
{
_logger.Log(LogLevel.Debug, "Error retreiving weekly leaderboards. Message: " + ex.Message);
return StatusCode(500);
}
}
}
}
28 changes: 28 additions & 0 deletions src/FocusAPI/Controllers/ShopController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Microsoft.AspNetCore.Mvc;
using MediatR;
using FocusAPI.Models;
using FocusCore.Queries.Shop;
using FocusCore.Models;

namespace FocusAPI.Controllers
{
[ApiController]
[Route("[controller]")]
public class ShopController : ControllerBase
{
private readonly ILogger<ShopController> _logger;
private IMediator _mediator;

public ShopController(ILogger<ShopController> logger, IMediator mediator)
{
_logger = logger;
_mediator = mediator;
}

[HttpGet]
public async Task<List<ShopItem>> GetAllShopItems(CancellationToken cancellationToken)
{
return await _mediator.Send(new GetAllShopItemsQuery());
}
}
}
Loading

0 comments on commit 5a9a345

Please sign in to comment.