241 Commits

Author SHA1 Message Date
Aaron Po
0bd115eccb Update S3FileStorageProvider.cs 2026-10-11 23:08:59 -04:00
Aaron Po
b41ae73e93 Show the stored avatar on the public profile page 2026-10-11 22:20:31 -04:00
Aaron Po
43eb3a1ddb Cover the avatar read path in the public profile specs 2026-10-11 22:20:31 -04:00
Aaron Po
fb0b1748aa Serve the current avatar URL on the public user payload 2026-10-11 22:20:31 -04:00
Aaron Po
071b5fcc3c Swap in an in-memory file storage provider for the API specs 2026-10-11 22:20:31 -04:00
Aaron Po
9afab64f67 Sign avatar download URLs against a browser-reachable endpoint 2026-10-11 22:20:25 -04:00
Aaron Po
dfe248ea5f Create pull_request_template.md 2026-10-11 21:40:41 -04:00
Aaron Po
ff775e3b8a Raise frontend contrast, unify the page frame, and add browser identity (#328) 2026-10-08 00:17:45 -04:00
Aaron Po
0e51630439 Make the production compose stack deployable and disclose the AI-generated catalogue (#329) 2026-10-08 00:17:45 -04:00
Aaron Po
bd0e9e4a20 Create landing page (#321) 2026-10-03 18:46:32 -04:00
Aaron Po
c5972b9f04 Features/public biography endpoint (#316) 2026-09-26 19:51:10 -04:00
Aaron Po
e1b6cba1d4 Upgrade MediatR to 12.5.0 and forward cancellation tokens through pipeline behaviors (#320) 2026-09-26 19:50:44 -04:00
Aaron Po
0ff42c3c70 Add authenticated user profile page with locked-down account endpoint (#315) 2026-09-23 00:58:54 -04:00
Aaron Po
a6a9046457 Fix CA1873 warning and consolidate test fixtures (#313) 2026-09-12 22:14:55 -04:00
Aaron Po
40ae75808c Add ValidationBehavior test coverage (#311) 2026-09-12 21:08:24 -04:00
Aaron Po
fbede956e9 Fix seed pipeline crash and make seeding failures fail CI (#309) 2026-09-12 17:11:02 -04:00
Aaron Po
3793fca65e Features/exceptions pipeline integration (#308) 2026-09-12 16:24:14 -04:00
Aaron Po
78d0eaa739 Move Infrastructure.Configuration into Configuration (#291) 2026-09-12 15:59:37 -04:00
Aaron Po
180ed41e68 Move Infrastructure.FileUpload into Features.PhotoUpload (#290) 2026-09-12 00:22:19 -04:00
Aaron Po
ce2c90070e Update web docs for Infrastructure.Email move (#289) 2026-09-11 23:59:47 -04:00
Aaron Po
de63e9f216 Move Infrastructure.Email into Features.Emails (#288) 2026-09-11 23:46:04 -04:00
Aaron Po
7187631ebc Move Infrastructure.Jwt into Features.Users (#287) 2026-09-11 23:14:30 -04:00
Aaron Po
5fa78fbdf6 Move Infrastructure.PasswordHashing into Features.Users (#286) 2026-09-11 22:21:22 -04:00
Aaron Po
f85ff79a2c Move email templates into Features.Emails (#283) 2026-09-11 02:11:50 -04:00
Aaron Po
a3ec7d63f2 Add validator tests for brewery and user commands (#282) 2026-09-06 17:48:03 -04:00
Aaron Po
9d5a463d93 Rename auth feature to Features.Users (#281) 2026-09-06 01:23:51 -04:00
Aaron Po
d958933250 Replace shared email commands with MediatR notifications (#280) 2026-09-05 22:37:00 -04:00
Aaron Po
4aa7ba5d9b Update doc comments in Features.Breweries source (#279) 2026-09-05 14:57:39 -04:00
Aaron Po
272a25fb05 docs(database): update City dbml doc to reflect composite unique constraint (#278) 2026-09-05 00:44:59 -04:00
Aaron Po
d9411eb00e refactor(database): update seed pipeline to use dapper (#277) 2026-09-05 00:37:14 -04:00
Aaron Po
78ad32e93a refactor(api-core): move service registration (#275) 2026-09-03 05:19:20 -04:00
Aaron Po
d6e176bcd9 Split dbo schema into per-domain SQL schemas (#274) 2026-09-02 22:23:30 -04:00
Aaron Po
8d59f09cb2 chore/update layouts in diagrams (#273) 2026-09-02 21:28:23 -04:00
Aaron Po
30317326ce Refactor documentation and diagrams for web/pipeline. (#272)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> for assistance with diagram creation and documentation prose updates.
2026-09-02 01:58:40 -04:00
Aaron Po
1fe35a2ea6 Use compose wait for CI test containers (#270) 2026-08-31 15:58:45 -04:00
Aaron Po
cd0f33f603 Ci cd/test runner (#268) 2026-08-31 14:16:33 -04:00
Aaron Po
8b429be857 Enforce brewery ownership on update and delete (#267) 2026-08-31 13:37:17 -04:00
Aaron Po
49d7f860de Fix RZ10012 razor warnings in email templates (#266) 2026-08-31 03:32:52 -04:00
Aaron Po
39c5a89ca7 Add user avatar and profile feature, consolidate Auth and UserManagement features (#257) 2026-08-31 00:11:48 -04:00
Aaron Po
ade2128a73 Switch Argon2 hashes to PHC string format (#256) 2026-08-30 03:53:54 -04:00
Aaron Po
e5b354e322 Update outdated documentation (#255) 2026-08-29 23:50:05 -04:00
Aaron Po
be672b6ca9 Integrate SeaweedFS for S3-compatible file storage and photo upload (#254) 2026-08-29 23:37:11 -04:00
Aaron Po
a580314583 Add brewery discovery & detail pages with location-based search (#253) 2026-08-29 00:44:33 -04:00
92a30b11db Update docs to reflect per-table DDL scripts and schema.dbml from #251 (#252) 2026-08-27 01:02:58 -04:00
fcee0f9213 Organise ddl statements into separate files per create table (#251) 2026-08-26 22:16:56 -04:00
4ca35de7ef Integrate NetTopologySuite and create CoordinateData mapping (#250) 2026-08-26 01:10:09 -04:00
ad1c09f139 Move brewery reverse geocoding from C# seeding to C++ pipeline (#249) 2026-08-25 22:24:11 -04:00
2b82d1918b Extract shared configuration helpers into Infrastructure.Configuration library (#248) 2026-08-25 14:16:57 -04:00
8a047e8d9f Update database handling code (#247) 2026-08-25 13:42:51 -04:00
Aaron Po
03ca966708 C++ code formatting 2026-08-24 01:13:41 -04:00
Aaron Po
b64c42ebde formatting 2026-08-24 01:09:48 -04:00
c825d99b0a Refactor comments and update documentation for backend and pipeline (#246)
* Remove restating comments in backend

* Remove restating comments in frontend stories

* Remove restating comments in pipeline

* Remove restating comments in pipeline scripts

* Restore location-clear comment in BreweryRepository

* Remove stale/restating comments found in second pass

* Restore mock curated-data branch comment in main.cc

* Remove more restating/filler comments in backend

* Document account-management endpoints, compose files, and env generator

* Squashed commit of the following:

commit a8a5b8abd9969859c695092fae6990d03b2135ed
Author: Aaron Po <aaron.po97@gmail.com>
Date:   Sun Aug 23 23:53:56 2026 -0400

    Add reverse geocoding for brewery street addresses (#245)

    * Add geocoding to seed application, remove postal codes from generator

    Update comments

* Update pipeline class diagram for OpenAI generator

* Update pipeline activity diagram for brewery coordinates and OpenAI backend

* Add mailpit, production, db-only, and minimal environments to deployment diagram

* Fix authentication flow diagram for Identity migration

* Add account-management flows to authentication diagram

* Fix database schema diagram note referencing removed AuthRepository
2026-08-24 01:09:48 -04:00
cd5fd2d998 Add reverse geocoding for brewery street addresses (#245)
* Add geocoding to seed application, remove postal codes from generator

Update comments
2026-08-24 01:09:48 -04:00
e738fe484a Update generate pipeline to add OpenAI api as an additional backend (for comparison testing), add brewery coordinates (#244)
* add brewery coordinates

* Add openai mode

* Add coordinates to schema

* Fix C++ review findings in pipeline: k-prefixed enum values, include ordering, populated validation error messages, conventional const notation, and endl replaced with newline
2026-08-24 01:09:48 -04:00
31da1d557c Handle fetch fail in client app, fix data binding in location data (#243)
* Improve error handling for server rendered routes

* Fix data binding issue for country/state codes (use alias in sql)
2026-08-24 01:09:48 -04:00
bfd45842fe Refactor authentication and account management with modular UI components (#242) 2026-08-24 01:09:48 -04:00
Aaron Po
6a44afd6b6 Replace raw environment variable reads with IConfiguration in backend 2026-08-24 01:09:48 -04:00
Aaron Po
c380bebdd6 Add self-service account management commands (delete, update username/email/password/profile) 2026-08-24 01:09:48 -04:00
Aaron Po
93e0d089f9 Remove obsolete AuthRepository/IAuthRepository 2026-08-24 01:09:47 -04:00
Aaron Po
77c3407792 Migrate Database.Seed to UserManager<ApplicationUser> 2026-08-24 01:09:47 -04:00
Aaron Po
fe83c47e37 Migrate TokenService.RefreshTokenAsync to UserManager
Last remaining IAuthRepository call site; RefreshTokenResult now
carries a plain (Guid, string) instead of UserAccount.
2026-08-24 01:09:47 -04:00
Aaron Po
63d195ddf7 Migrate handlers to UserManager<> 2026-08-24 01:09:47 -04:00
Aaron Po
f06f4bf3a9 Wire ASP.NET Core Identity DI alongside existing AuthRepository
Both stacks coexist until handlers are migrated one by one.
2026-08-24 01:09:47 -04:00
Aaron Po
3c0ca485b8 Decouple ITokenService from UserAccount entity
Token generation only ever needed the id/username, not the full UserAccount.
2026-08-24 01:09:47 -04:00
Aaron Po
1a7267ca4a Add ApplicationUser, DapperUserStore, Argon2PasswordHasher scaffolding
Unwired Identity store/hasher adapters, ahead of wiring them into DI.
2026-08-24 01:09:47 -04:00
Aaron Po
b61a440994 Delete report.sarif 2026-08-24 01:09:47 -04:00
Aaron Po
f433b21bc1 Fix code analysis warnings 2026-08-24 01:09:47 -04:00
1031a76099 Create launchSettings.json (#239) 2026-08-24 01:09:47 -04:00
df160f1f72 Web/backend/solution rename (#238)
* Rename solution

* Remove unused item group in API.Core
2026-08-24 01:09:47 -04:00
de1e9ac02b Migrate Auth/Brewery/Location repositories to pure Dapper; rename Timer to RowVersion (#237)
* Integrate Spectre.Console into seed application, use async data loading

* Replace stored-procedure repositories with Dapper-based repositories

Removes the USP_* stored procedures for Auth, Location, and Brewery
data access in favour of services built with Dapper.

Adds a new Features.Locations slice and optimistic concurrency support
for the Brewery slice.

* Add new documentation for Dapper migration/database schema

* Update FluentAssertions to most recent open source ver

* Update XML doc comment in backend projects

* Modify brewery location dto to include denormalized data

* - Updated column names from 'Timer' to 'RowVersion' in schema.sql for
- Introduced new BeerPost entity and updated BreweryPost and BreweryPostLocation entities to use 'RowVersion' for concurrency.
- Modified UserAccount, UserCredential, UserVerification, City, StateProvince, and Country entities to use 'RowVersion' instead of 'Timer'.
- Updated tests and command handlers to reflect changes in concurrency token from 'Timer' to 'RowVersion'.
- Adjusted BreweryDto and BreweryDtoMapper to include 'RowVersion' and updated mapping logic accordingly.
- Ensured all repository methods and interfaces are aligned with the new concurrency handling approach.

* updates

* Add BeerStyle entity and related properties; refactor BreweryDto to remove BeerPosts

* Fix Api.Specs test failures: stale Timer column refs and missing test.user fixture

* Remove repository tests, usages of registration dto used in repo

* archive old stored procs/functions

* update stale docs

* Add instructions for generating cryptographically secure base64 secrets on macOS/Linux and Windows
2026-08-24 01:09:47 -04:00
Aaron Po
b27b5bdb40 Documentation updates (#236)
Remove vague or flowery language, use Simplified Technical English whenever possible
2026-08-24 01:09:47 -04:00
Aaron Po
30cdb48491 remove comment 2026-08-24 01:09:47 -04:00
Aaron Po
37667db2f6 Format 2026-08-24 01:09:47 -04:00
Aaron Po
f665df578c update backend/shared docs 2026-08-24 01:09:47 -04:00
Aaron Po
f9acdc8ada update infra docs 2026-08-24 01:09:47 -04:00
Aaron Po
19dfad5ab5 update features docs 2026-08-24 01:09:47 -04:00
Aaron Po
633550f808 update domain docs 2026-08-24 01:09:47 -04:00
Aaron Po
2b69c99d54 update api docs 2026-08-24 01:09:47 -04:00
Aaron Po
1f43f48276 Add navigation properties to entity types 2026-08-24 01:09:47 -04:00
Aaron Po
9862d1cff4 format sql 2026-08-24 01:09:47 -04:00
Aaron Po
c9a02dbedf Refactor user registration process to use UserRegistrationDto;
implement user registration in seed app
2026-08-24 01:09:47 -04:00
Aaron Po
d469c07250 Update database migration and seeding logic; adjust Docker port mapping 2026-08-24 01:09:47 -04:00
Aaron Po
76380d32c3 add wiring 2026-08-24 01:09:47 -04:00
Aaron Po
7162244454 Update viewer 2026-08-24 01:09:47 -04:00
Aaron Po
b2095e7bdd Create biergarten_seed_2026-07-20T05-46-02.993511Z.sqlite 2026-08-24 01:09:47 -04:00
Aaron Po
5fd60b33f7 Add sqlite load into Database.Seed 2026-08-24 01:09:47 -04:00
Aaron Po
ec770aa724 Formatting 2026-08-24 01:09:47 -04:00
Aaron Po
8e7ecf2fc3 Pipeline: City rename, add address/postal-code generation, add xeger generation (#232) 2026-08-24 01:09:47 -04:00
Aaron Po
901f30ffd8 Fix mock-only builds (#231) 2026-08-24 01:09:47 -04:00
b20852bcd4 Pipeline: Add LLM and mocked user generation to the pipeline (#230) 2026-08-24 01:09:47 -04:00
Aaron Po
08a75d6ed0 update pipeline docs 2026-08-24 01:09:47 -04:00
Aaron Po
10aed47def commit csharpier config update 2026-08-24 01:09:47 -04:00
Aaron Po
1699da6b74 update mailkit 2026-08-24 01:09:47 -04:00
Aaron Po
cd99c1fbc3 formatting 2026-08-24 01:09:47 -04:00
Aaron Po
254431928f code style cleanup 2026-06-20 15:54:53 -04:00
Aaron Po
07aedcb866 Update documentation to reflect new architecture and previous refactors 2026-06-20 15:54:53 -04:00
Aaron Po
fd341e332c Migrate Auth and Emails to vertical slices (Features.Auth, Features.Emails)
Auth and Emails land together since Auth's registration/resend flows need
Emails to exist first. Service.Auth's four services (Register, Login,
Confirmation, Token) collapse into MediatR commands/queries in
Features.Auth; TokenService stays as a slice-internal service since
multiple handlers call it. Auth no longer references Emails directly —
it sends SendRegistrationEmailCommand/SendResendConfirmationEmailCommand
(defined in Shared.Application) which Features.Emails handles, so neither
slice has a project reference on the other.

Service.Emails' IEmailService becomes Features.Emails' IEmailDispatcher,
simplified to take (firstName, email, token) instead of a full UserAccount
since that's all it ever used. API.Specs' TestApiFactory/MockEmailService
are updated to swap in the relocated interface.

Also deletes Infrastructure.Repository now that Breweries, UserManagement,
and Auth have all moved their repos out of it, and replaces the two
now-dead docker-compose test services (repository.tests, service.auth.tests,
both pointing at deleted Dockerfiles) with a single unit.tests service that
runs every Features.*.Tests project via Dockerfile.tests.
2026-06-20 15:54:53 -04:00
Aaron Po
5cf4df1fd8 Migrate UserManagement to a vertical slice (Features.UserManagement)
Same pattern as the Breweries migration: Service.UserManagement and the
UserAccount repository fold into Features.UserManagement, with MediatR
queries replacing UserService. UpdateUserCommand/Handler carry forward
IUserService.UpdateAsync as-is (it has no HTTP route today, and adding one
is a separate decision from this migration). Adds handler/repository test
coverage that didn't exist before, since Service.UserManagement had no
test project.
2026-06-20 15:54:53 -04:00
Aaron Po
34ba7e8271 Migrate Breweries to a vertical slice (Features.Breweries)
Moves brewery CRUD from the Service.Breweries/Infrastructure.Repository
layered split into a single Features.Breweries project: MediatR
commands/queries replace BreweryService, and the repository moves in
alongside its own controller. Extracts Infrastructure.Sql out of
Infrastructure.Repository (just the generic ADO.NET connection/base-repo
plumbing) since Breweries no longer needs the rest of that project, while
Auth and UserAccount repos still do until their own migration.

Also fixes the API.Core and Infrastructure.Repository.Tests Dockerfiles,
which were restoring against COPY destinations that didn't match the
projects' actual relative paths (silently working only because of the
COPY . . that followed); both now restore against Core.slnx with correctly
nested paths, verified with a real docker build.
2026-06-20 15:54:53 -04:00
Aaron Po
60a7b790d4 Scaffold vertical-slice migration: Shared.Contracts, Shared.Application, MediatR
Begins the move to vertical-slice architecture. ResponseBody moves out of
API.Core into Shared.Contracts so slices won't have to depend on the API
host project for it. Shared.Application adds the MediatR pipeline's
ValidationBehavior plus the cross-slice email commands that Features.Auth
will send and Features.Emails will handle, keeping slices decoupled from
each other.
2026-06-20 15:54:53 -04:00
Aaron Po
4554fff534 add tests 2026-06-20 15:54:53 -04:00
Aaron Po
86a0c50f6e finish brewery feature set 2026-06-20 15:54:53 -04:00
Aaron Po
3034020d56 add xmldoc comments 2026-06-20 15:54:53 -04:00
6a66619c70 Add multithreaded logging infrastructure for preparation for future designs (#225)
* Update class diagrams

* Implement BoundedChannel and multithreaded logging infra

* Integrate logging channel system

* Update string concatenations to use std::format

* Add pretty print log
2026-05-22 22:00:38 -04:00
2ee7b3d2a2 Add timeout to wikipedia enrichment to avoid breaking rate limits, add mock enrichment (#224)
* Add timeout for enrichment, refactor json deserialization

* Add location count to application options and as a cli arg

* Add mock enrichment process
2026-05-14 19:15:51 -04:00
b7c0b1c8d4 Fix mistake in .gitattributes
archive/* is incorrect as it will ignore sub-dirs
2026-05-12 01:05:07 -04:00
b8ebe03921 Pipeline: Add Runpod docker configuration (#222)
* Begin work on Runpod docker config

* Reduce docker image size

* Create .dockerignore
2026-05-12 00:44:09 -04:00
26635ace84 Organize and consolidate header files (#220) 2026-05-03 21:44:37 -04:00
031be8ad5d Pipeline: Remove CURL as a dependency, add new HTTP module (#219)
Rationale: 

HTTP is a supporting concern in the pipeline, used only for Wikipedia enrichment calls. libcurl's C API required significant boilerplate to wrap safely. cpp-httplib is a header-only library that covers the same functionality with far less overhead and no manual resource management.
2026-05-03 13:35:58 -04:00
f316fabcb0 Update CMakeLists.txt (#218) 2026-05-02 19:27:44 -04:00
b1dc8e0b5d refactor(pipeline): restructure config, add PromptDirectory, consolidate SQLite layer (#217)
* Refactor ApplicationOptions to separate config concerns

* add prompt dir app option

* readability updates: remove magic numbers, update comments

* codebase formatting

* Update docs

* Extract argument parsing, timer out of
2026-05-02 18:27:14 -04:00
641a479b6a Refactor SQLite Export Service and ProcessRecord Method Signatures (#216)
* Helper cleanup

update bind to use dto for params
consolidate translation units


* Update planned class diagram
2026-04-30 19:03:45 -04:00
d80e15b55e Add docs symlink to top level docs/pipeline (#214) 2026-04-30 18:35:46 -04:00
Aaron Po
1fcaf6e174 misc deletions 2026-04-27 18:47:39 -04:00
Aaron Po
ef97bf0a75 remove misc directory 2026-04-27 18:47:39 -04:00
Aaron Po
4c8a8e43ed update readmes 2026-04-27 18:47:39 -04:00
Aaron Po
8db6992296 move diagrams and documentation 2026-04-27 18:47:39 -04:00
Aaron Po
7925fc6caf Format all markdown files in active directories 2026-04-27 18:47:39 -04:00
Aaron Po
b1f4ff2641 remove legacy doc 2026-04-27 18:47:39 -04:00
Aaron Po
a852beff21 add git attributes to ignore archive dir 2026-04-27 18:47:39 -04:00
Aaron Po
e17afe909f move docker compose files 2026-04-27 18:47:39 -04:00
Aaron Po
9ed37806dd Move pipeline directory 2026-04-27 18:47:39 -04:00
Aaron Po
5a21589029 Move website directory 2026-04-27 18:47:39 -04:00
Aaron Po
189bce040b Move dotnet api into new directory 2026-04-27 18:47:39 -04:00
e8c5b8a80c Add future plans, new design, and ethics document updates to Pipeline (#212) 2026-04-27 15:41:28 -04:00
Aaron Po
d47e3ed7f0 Move next js project to archive (#207) 2026-04-20 02:30:25 -04:00
Aaron Po
92ec16ce93 Feat/add sqllite to cpp pipeline (#206) 2026-04-20 01:59:52 -04:00
Aaron Po
c2db65d9b1 Add brewery stored procedures, repository and service (#204)
* Add create brewery to brewery repository

* Implement brewery repo, SQL procs and tests

* Implement CRUD operations for Brewery, including service and repository layers

* Test updates

* DTO updates
2026-04-20 00:15:39 -04:00
Aaron Po
1f008f1237 Add formatting script for c++ (#203) 2026-04-19 15:46:30 -04:00
Aaron Po
898cc8971b Create biergarten brewery pipeline project (#199) 2026-04-18 19:19:14 -04:00
Aaron Po
fd3c172e35 Schema updates (#191) 2026-03-28 20:35:50 -04:00
Aaron Po
581863d69b Website updates: add new app scaffold, archive legacy site, and refresh docs/tooling (#173) 2026-03-15 22:56:14 -04:00
Aaron Po
9238036042 Add resend confirmation email feature (#166) 2026-03-07 23:03:31 -05:00
Aaron Po
431e11e052 Add WEBSITE_BASE_URL environment variable and update email confirmation link (#165) 2026-03-07 20:11:50 -05:00
Aaron Po
f1194d3da8 Feature: Add token validation, basic confirmation workflow (#164) 2026-03-06 23:23:43 -05:00
Aaron Po
17eb04e20c Update diagrams 2026-02-21 05:04:04 -05:00
Aaron Po
50c2f5dfda Update documentation (#156) 2026-02-21 05:02:22 -05:00
Aaron Po
c5683df4b6 add IEmailService to the DI container (#154) 2026-02-19 22:04:30 -05:00
Aaron Po
2cad88e3f6 Service refactor (#153)
* remove email out of register service

* Update auth service, move JWT handling out of controller

* add docker config for service auth test

* Update mock email system

* Format: ./src/Core/Service

* Refactor authentication payloads and services for registration and login processes

* Format: src/Core/API, src/Core/Service
2026-02-16 15:12:59 -05:00
Aaron Po
0d52c937ce Adding service layer testing (#151) 2026-02-14 21:17:39 -05:00
Aaron Po
6b66f5680f Add user registration emails + email infrastructure (#150)
* Add email functionality

* Add email template project and rendering service

* Update email template dir structure

* Add email header and footer components for user registration template

* update example env

* Refactor email templates namespace and components

* Format email dir
2026-02-13 21:46:19 -05:00
Aaron Po
82f0d26200 Fix ISO country code references in database scripts and seeder (#148) 2026-02-12 23:29:42 -05:00
Aaron Po
7129e5679e Update exception handling (#146) 2026-02-12 21:06:07 -05:00
Aaron Po
584fe6282f Merge pull request #145 from aaronpo97/fix-test-config
fix config
2026-02-12 19:37:59 -05:00
Aaron Po
8c61069b7d fix config 2026-02-12 19:37:20 -05:00
Aaron Po
674f91cbdf Merge pull request #144 from aaronpo97/fix-test-config
Refactor auth/user services
2026-02-12 19:30:40 -05:00
Aaron Po
a54d2a6da0 Merge pull request #143 from aaronpo97/service-refactor
Refactor auth/user services
2026-02-12 19:29:56 -05:00
Aaron Po
954c9c389c Refactor auth/user services 2026-02-12 19:28:48 -05:00
Aaron Po
d942d92db5 Refactor auth/user services 2026-02-12 19:28:40 -05:00
Aaron Po
c80eae694f Merge pull request #142 from aaronpo97/fix-test-config
Fix test namespaces and Dockerfile project paths
2026-02-12 18:39:58 -05:00
Aaron Po
94061c6d84 Fix test namespaces and Dockerfile project paths 2026-02-12 18:37:28 -05:00
Aaron Po
caf13de36e Merge pull request #141 from aaronpo97/refactor/add-infrastructure-project-dir
Refactor/add infrastructure project dir
2026-02-12 18:26:17 -05:00
Aaron Po
2cb8f1d918 Update ISeeder.cs 2026-02-12 18:05:44 -05:00
Aaron Po
f728514a7c Update namespaces 2026-02-12 18:05:35 -05:00
Aaron Po
4f92741b4f Refactor repository structure 2026-02-12 17:14:32 -05:00
Aaron Po
a038a12fca Update root namespaces 2026-02-12 09:54:39 -05:00
Aaron Po
74c5528ea2 Format infrastructure dir 2026-02-12 01:13:59 -05:00
Aaron Po
f48b8452d3 Update tests 2026-02-12 01:13:59 -05:00
Aaron Po
2411841bdc create Infrastructure directory 2026-02-12 00:56:52 -05:00
Aaron Po
215824d4b6 Merge pull request #140 from aaronpo97/remove-domain.validation-project
Refactor domain project structure and remove Domain.Validation project
2026-02-11 21:02:44 -05:00
Aaron Po
99b13e2742 Refactor domain project structure and remove Domain.Validation project 2026-02-11 21:02:16 -05:00
Aaron Po
3a32f326bf Merge pull request #139 from aaronpo97/request-validation
Add request validation and DTOs
2026-02-11 20:01:50 -05:00
Aaron Po
b2cf21399b Update request validation 2026-02-11 19:59:54 -05:00
Aaron Po
109ade474c Add validation and dtos 2026-02-11 17:36:27 -05:00
Aaron Po
07a62a0c99 Merge pull request #138 from aaronpo97/add-domain-project
Add domain project
2026-02-11 13:31:49 -05:00
Aaron Po
31e67ebad8 Update namespace from WebAPI to API.Core 2026-02-11 13:25:22 -05:00
Aaron Po
c74b20079b Add domain project and update references 2026-02-11 00:23:13 -05:00
Aaron Po
2b0f9876bc Merge pull request #136 from aaronpo97/user-registration
User registration
2026-02-10 23:29:19 -05:00
Aaron Po
8a4b833943 Add user registration bdd tests 2026-02-10 23:09:00 -05:00
Aaron Po
656981003b Update service namespace/directory structure 2026-02-09 23:23:41 -05:00
Aaron Po
ff1ce15419 Consolidate auth logic, update password service, and update namespaces 2026-02-08 23:25:31 -05:00
Aaron Po
881a94893f add registration steps 2026-02-08 21:38:27 -05:00
Aaron Po
8abacb5572 Merge pull request #134 from aaronpo97/133-update-env-handling
refactor/update docker compose env configuration
2026-02-08 21:03:13 -05:00
Aaron Po
027e130fcd Add example env 2026-02-08 21:02:07 -05:00
Aaron Po
243931eb6a Refactor database connection handling and update environment variable usage across Docker configurations 2026-02-08 14:57:45 -05:00
Aaron Po
b22e1e5702 Merge branch 'main-2.0' of https://github.com/aaronpo97/the-biergarten-app into main-2.0 2026-02-08 00:07:43 -05:00
Aaron Po
b07cec8c7e Update README.md 2026-02-08 00:07:17 -05:00
Aaron Po
92628290da Merge pull request #132 from aaronpo97/feat/add-database-container-compose
Add database only docker compose file
2026-02-08 00:05:58 -05:00
Aaron Po
ca2d7c453f Add database only docker compose file 2026-02-08 00:04:31 -05:00
Aaron Po
2076935ee2 Merge pull request #131 from aaronpo97/130-feature-docker-configuration-for-testing
130 - Add docker configuration for testing
2026-02-07 23:06:05 -05:00
Aaron Po
5c49611bff Remove unused publish step 2026-02-07 23:03:23 -05:00
Aaron Po
ae6002bbe0 Implement retry logic for database connection in seeding process 2026-02-07 20:21:40 -05:00
Aaron Po
a1ea6391bc Add JWT_SECRET environment variable to Docker configurations and update JwtService to use it 2026-02-07 20:04:19 -05:00
Aaron Po
6d812638ba Add docker run of repository tests 2026-02-07 19:07:55 -05:00
Aaron Po
17bf29700a Add database seeding to dev env 2026-02-07 18:32:50 -05:00
Aaron Po
393e57af7f Merge pull request #128 from aaronpo97/127-api-container-production-db
127: Add docker configuration for a production/development database and an API container
2026-02-07 17:26:24 -05:00
Aaron Po
e0af25f17c Change dir name for migrations, update docker config to seed db 2026-02-07 17:11:39 -05:00
Aaron Po
9bfbed9b92 add docker config 2026-02-03 23:02:16 -05:00
Aaron Po
2ae99d5224 Merge pull request #123 from aaronpo97/116-add-loginauth-token-feature-to-net-api
116: Add login/auth token feature to API
2026-02-01 12:53:32 -05:00
Aaron Po
b994201a18 Merge branch '2.0' into 116-add-loginauth-token-feature-to-net-api 2026-02-01 12:46:15 -05:00
Aaron Po
e4560f8d80 Merge pull request #124 from aaronpo97/delete-workflows
Delete .github/workflows/github-actions-demo.ymlw
2026-02-01 12:42:51 -05:00
Aaron Po
dbd3b6ce0a Delete .github/workflows/github-actions-demo.ymlw 2026-02-01 12:40:40 -05:00
Aaron Po
ee53cc60d8 Edit auth bdd tests 2026-02-01 12:33:24 -05:00
Aaron Po
954e224c34 update tests 2026-01-31 15:41:00 -05:00
Aaron Po
9474fb7811 add tests for login behaviour 2026-01-31 13:54:02 -05:00
Aaron Po
77bb1f6733 auth updates 2026-01-31 11:34:55 -05:00
Aaron Po
1af3d6f987 Merge branch '2.0' into 116-add-loginauth-token-feature-to-net-api 2026-01-29 23:07:53 -05:00
Aaron Po
2332f9f9b5 Merge pull request #122 from aaronpo97/121-database-seed-enhancement
Initiate db drop/recreation in seed application, update broken procs
2026-01-29 23:06:47 -05:00
Aaron Po
0053d84de8 Initiate db drop/recreation in seed application, update broken procs 2026-01-29 23:05:08 -05:00
Aaron Po
754578c84c Merge branch '2.0' into 116-add-loginauth-token-feature-to-net-api 2026-01-29 22:57:39 -05:00
Aaron Po
ca49d19bf7 Merge pull request #120 from aaronpo97/117-feature-reqnroll-setup-for-bdd-testing
Add TestApiFactory for BDD testing setup and include API.Specs project
2026-01-29 22:55:10 -05:00
Aaron Po
cf9f048daa Add TestApiFactory for BDD testing setup and include API.Specs project in solution 2026-01-29 22:48:35 -05:00
Aaron Po
a8c0ae6358 Merge branch '2.0' into 116-add-loginauth-token-feature-to-net-api 2026-01-29 20:34:04 -05:00
Aaron Po
52643c1173 Merge pull request #118 from aaronpo97/117-feature-reqnroll-setup-for-bdd-testing
Set up Reqnroll for BDD testing
2026-01-29 20:30:22 -05:00
Aaron Po
24b059ea3d Set up Reqnroll for BDD testing 2026-01-29 20:28:50 -05:00
Aaron Po
97c093c4bc Update namespace organization in service layer 2026-01-29 18:13:34 -05:00
Aaron Po
45f64f613d Repo restructuring 2026-01-26 19:52:27 -05:00
Aaron Po
084f68da7a update documentation 2026-01-26 19:13:18 -05:00
Aaron Po
ea92735146 Merge remote-tracking branch 'dotnet/auth-updates' into integrate-dotnet-backend-repo 2026-01-26 18:59:30 -05:00
Aaron Po
54788b1a6d Merge remote-tracking branch 'dotnet/main' into integrate-dotnet-backend-repo 2026-01-26 18:58:40 -05:00
Aaron Po
7dc7ef4b1a Begin integration of dotnet backend with biergarten nextjs code 2026-01-26 18:52:16 -05:00
Aaron Po
a6702c89fd add issue template 2026-01-26 18:29:00 -05:00
Aaron Po
68ff549635 Refactor repository and SQL procedures; add repo tests 2026-01-25 23:26:40 -05:00
Aaron Po
a56ea77861 Add auth service 2026-01-25 21:58:40 -05:00
Aaron Po
14cb05e992 Update user credential stored procs 2026-01-24 19:11:49 -05:00
Aaron Po
53a7569ed5 Remove architecture overview from README
Removed the architecture overview and related details from the README.
2026-01-22 22:37:44 -05:00
Aaron Po
82db763951 Refactor repository methods to async and update credential logic 2026-01-22 11:14:23 -05:00
Aaron Po
fd544dbd34 Start stored procs for user credentials 2026-01-19 22:57:24 -05:00
Aaron Po
89da531c48 Restructure project 2026-01-15 21:48:20 -05:00
Aaron Po
c5aaf8cd05 Update repository, seed and service layers 2026-01-15 20:53:27 -05:00
Aaron Po
b8cd855916 Refactor user entities and repositories, update seeders
Standardized property naming in user-related entities to use 'Id' suffix (e.g., UserAccountId). Moved and updated repository interfaces and implementations to the DataAccessLayer.Repositories namespace. Refactored DBSeed seeders to use repository classes and improved structure. Updated .gitignore and project references
2026-01-15 13:23:41 -05:00
Aaron Po
60ef65ec52 Update AddUserCredential script 2026-01-13 23:44:48 -05:00
Aaron Po
da84492aa4 Update seeds 2026-01-13 23:18:03 -05:00
Aaron Po
b5ab6f6893 restructure seed 2026-01-13 20:10:39 -05:00
Aaron Po
7fbdfbf542 Add dbup for sql script handling 2026-01-13 00:25:30 -05:00
Aaron Po
43dcf0844d Refactor data layer, add business layer 2026-01-13 00:13:39 -05:00
Aaron Po
c928ddecb5 update seed application 2026-01-12 00:14:42 -05:00
Aaron Po
372aac897a Restructure data access layer/data layer 2026-01-11 23:36:26 -05:00
Aaron Po
8d6b903aa7 Refactor UserAccount repository methods and add stored procedures for user account management 2025-12-06 23:06:13 -05:00
Aaron Po
00a0f6c4ef update projects to dotnet 10 2025-12-06 22:59:22 -05:00
Aaron Po
afefdb9e3d Add WebAPI controllers for beers, breweries, and users; update Docker configuration and .gitignore 2025-12-06 22:15:00 -05:00
Aaron Po
fc2e8c9b6d Update data access layer, begin acquiring raw data 2025-11-17 02:39:40 -05:00
Aaron Po
b86607e37a Update stored procs/udf and update docker config 2025-11-13 10:18:03 +00:00
Aaron Po
a200164609 Initialize solution structure and add WebAPI project 2025-11-12 18:36:51 -05:00
Aaron Po
4e2c9836c9 update docker compose 2025-11-12 01:38:34 -05:00
Aaron Po
b7f22fcc66 Add seed db c# project 2025-11-12 00:41:27 -05:00
Aaron Po
f0c9cff8be update data testing 2025-11-11 06:02:45 -05:00
Aaron Po
33db1368ec Refactor schema and test data; remove DAL code
Removed all DataAccessLayer C# code and related test project files. Updated schema.sql to add Country, StateProvince, and City tables, refactored brewery and beer post tables to include location and concurrency columns, and replaced the old comment/rating system with BeerPostComment. Updated test-data.sql to seed new location tables and refactored brewery data to use city and coordinates.
2025-11-11 03:45:01 -05:00
Aaron Po
8975044034 add test data 2025-10-28 18:30:48 -04:00
Aaron Po
738c055bf7 begin scaffolding data access layer 2025-10-28 18:28:30 -04:00
Aaron Po
2f0bfd90b2 first commit 2025-10-23 02:27:20 -04:00
1025 changed files with 106471 additions and 11460 deletions

View File

@@ -0,0 +1,52 @@
---
name: doc-drift-pipeline
description: Checks whether recent changes under tooling/pipeline/ have made docs/pipeline/ stale. Use when the user asks to check for doc drift on the pipeline, before committing changes to tooling/pipeline, or when asked "does this need a doc update" for the C++ seed-data pipeline.
---
# Doc Drift Check — Pipeline
Given a diff scoped to `tooling/pipeline/` (uncommitted changes, a range of
commits, or a specific PR), determine whether it invalidates any factual
claim in `docs/pipeline/`.
## Steps
1. Run `git diff -- tooling/pipeline/` (or
`git diff <base>...<head> -- tooling/pipeline/` if a range is given) to
see what changed. If the diff also touches `web/**`, note that it's out of
scope here — use the `doc-drift-web` skill for that half.
2. Based on which files changed, identify the relevant doc(s):
- `tooling/pipeline/src/**`, `includes/**` (implemented behavior) →
`docs/pipeline/README.md`, `docs/pipeline/diagrams/current/*.mmd`
(activity, class)
- Work that's scaffolded/flagged but not wired into the default run path
(roadmap-only) → `docs/pipeline/ROADMAP.md`,
`docs/pipeline/diagrams/planned/*.mmd` — do not touch `current/` for
planned work that hasn't landed
- Changes to pipeline bias/hallucination handling, model prompts, sampling
logic, or known-limitation workarounds →
`docs/pipeline/ETHICS-AND-KNOWN-ISSUES.md`
- `tooling/pipeline/runpod/Dockerfile`, build/run scripts →
`docs/pipeline/README.md` (setup/usage sections)
- `docs/pipeline/french-cities.example` — check it still matches the input
schema the pipeline actually reads
- A new file added under `docs/pipeline/**` → also check `docs/index.md`
and `mkdocs.yml` nav are updated to reference it
3. Read the relevant doc section(s) and check each specific factual claim
(tables, "currently X", "not yet implemented", roadmap checkboxes) against
the diff. For diagrams, this means reading the `.mmd` source (not just the
wrapping `.md`) and checking nodes/edges/labels against the diff — a
pipeline stage or control-flow change can invalidate a diagram without
touching any prose.
4. When a diff adds real behavior that was previously only in
`diagrams/planned/`, check whether that planned diagram/roadmap entry
should now move to `current/`/README rather than just adding a duplicate
claim in both places.
5. Report only what's actually stale — do not rewrite unrelated prose, do not
invent claims not grounded in the diff.
6. If nothing is affected, say so plainly and make no edits.
7. For confirmed drift, propose the exact edit (old text → new text, or the
changed `.mmd` node/edge) rather than committing directly, unless
explicitly told to apply it. Flag `.mmd` changes separately since they may
need a re-render (`docs/rendered-diagrams/pipeline/**`) via
`docs/makefile`.

View File

@@ -0,0 +1,55 @@
---
name: doc-drift-web
description: Checks whether recent changes under web/ have made docs/web/ stale. Use when the user asks to check for doc drift on the web app, before committing changes to web/backend or web/frontend, or when asked "does this need a doc update" for web/API/frontend work.
---
# Doc Drift Check — Web
Given a diff scoped to `web/` (uncommitted changes, a range of commits, or a
specific PR), determine whether it invalidates any factual claim in
`docs/web/`.
## Steps
1. Run `git diff -- web/` (or `git diff <base>...<head> -- web/` if a range is
given) to see what changed. If the diff also touches `tooling/pipeline/**`,
note that it's out of scope here — use the `doc-drift-pipeline` skill for
that half.
2. Based on which files changed, identify the relevant doc(s):
- `web/backend/API/**`, `Features.*/**` (general) → `docs/web/architecture.md`
- `web/backend/Features/Features.Users/**/Authentication/**`,
identity/token code (`ITokenService`, `RefreshToken*`, `ConfirmEmail*`,
login/registration handlers) → `docs/web/token-validation.md`,
`docs/web/diagrams/auth/*.mmd` (pick the matching flow: login,
registration, refresh-token, confirm-user, delete-account,
update-email/password/profile/username, resend-confirmation,
error-handling)
- `web/backend/Database/**` (entities, `Database.Migrations/scripts/**`) →
`docs/web/database.md`, `docs/web/diagrams/database-schema/*.mmd` (pick
the matching schema: beer, brewery, identity, location, media)
- Host wiring / DI registration (`API/**Program.cs`,
`Database.Seed/**Program.cs`) → `docs/web/diagrams/vertical-slice/host-wiring.mmd`
- New project references between `Features.*`/`Shared.*`/`Domain.*`
projects (new `.csproj` `<ProjectReference>`) →
`docs/web/diagrams/vertical-slice/project-references.mmd`
- `web/backend/Dockerfile*`, `web/frontend/Dockerfile*`, compose/deploy
config → `docs/web/docker.md`, `docs/web/diagrams/deployment/*.mmd`
(dev, test, minimal, db-only, prod), `docs/web/diagrams/deployment.md`
- `web/.env.example`, `web/.env.test`, appsettings → `docs/web/environment-variables.md`
- `web/backend/API/API.Specs/**`, test infra/fixtures → `docs/web/testing.md`
- New backend project setup, dev tooling → `docs/web/getting-started.md`
- `web/frontend/**` → `docs/web/architecture.md` (Frontend architecture section)
- A new file added under `docs/web/**` → also check `docs/index.md` and
`mkdocs.yml` nav are updated to reference it
3. Read the relevant doc section(s) and check each specific factual claim
(tables, "currently X", "not yet implemented", roadmap checkboxes) against
the diff. For diagrams, this means reading the `.mmd` source (not just the
wrapping `.md`) and checking nodes/edges/labels against the diff — a
schema or flow change can invalidate a diagram without touching any prose.
4. Report only what's actually stale — do not rewrite unrelated prose, do not
invent claims not grounded in the diff.
5. If nothing is affected, say so plainly and make no edits.
6. For confirmed drift, propose the exact edit (old text → new text, or the
changed `.mmd` node/edge) rather than committing directly, unless
explicitly told to apply it. Flag `.mmd` changes separately since they may
need a re-render (`docs/rendered-diagrams/web/**`) via `docs/makefile`.

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
archive/** linguist-vendored

View File

@@ -0,0 +1,33 @@
---
name: Feature Request (BDD)
about: Create a new feature using user story + BDD acceptance criteria
title: "[Feature] "
labels: ["feature", "BDD"]
assignees: []
---
## User Story
**As a** (who wants to accomplish something)
**I want to** (what they want to accomplish)
**So that** (why they want to accomplish that thing)
## Acceptance Criteria (BDD)
### Scenario 1
Given ... When ... Then ...
### Scenario 2
Given ... When ... Then ...
### Scenario 3
Given ... When ... Then ...
## Subtasks
- [ ] Task 1
- [ ] Task 2
- [ ] Task 3

101
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,101 @@
## Summary
<!--
State WHAT is changing and WHY, in two to five sentences.
A reader should understand the change without opening the diff.
Describe the problem first, then the outcome.
-->
## Type of change
<!-- Tick the one option that best describes this PR. -->
- [ ] Bug fix
- [ ] New feature
- [ ] Refactor (no change in behaviour)
- [ ] Performance improvement
- [ ] Documentation
- [ ] Tests only
- [ ] Build, CI or dependency update
- [ ] Other (please specify):
## Related issues
<!--
Link the issue(s) this PR relates to. Use one keyword per issue so that each is closed on merge:
Fixes #123
Fixes #124, fixes #125
Fixes owner/other-repo#456
Closing keywords only take effect when the PR targets the repository's default branch.
Use "Related to #123" if the PR should not close the issue.
If there is no issue, write "N/A" and explain the motivation in the Summary.
-->
## Approach and context
<!--
Explain how the change works and why this approach was chosen.
Include, where relevant:
- The decisions you made that are not obvious from the code.
- Alternatives you considered and why you rejected them.
- Known limitations or shortcomings, and any planned follow-up work.
- Background such as benchmark results or design documents.
Summarise the key points of any external link. Links may be inaccessible to future readers.
-->
## How this was tested
<!--
Describe what you ran and what you observed. Be specific, and state only what you actually did.
For example: the automated tests added or changed, manual steps and their outcome,
environments or platforms covered, and anything you were unable to test.
For a bug fix, note the test that fails without the fix.
-->
## Compatibility and risk
- [ ] This change is backwards compatible.
- [ ] This change is **breaking** (complete the details below).
- [ ] This change deprecates existing behaviour (complete the details below).
<!--
If breaking or deprecating, describe: what changes, who is affected,
and the migration path or recommended alternative.
Also note any deployment, configuration, data migration or rollback considerations.
-->
## User-facing change
<!--
Does this PR change behaviour that users, operators or API consumers will notice?
If not, write "None".
If so, write one or two sentences suitable for release notes, in plain language and from the
user's point of view. If users must take action when upgrading, state clearly that action is required.
-->
```release-note
```
## Notes for reviewers
<!--
Help reviewers focus. For example:
- Where to start, or a suggested order in which to read the files.
- Areas where you would particularly value scrutiny, or where you are uncertain.
- How any mechanical, generated or bulk changes were produced (for example a search-and-replace
or a code generator), so that reviewers can reproduce the steps.
- Screenshots or recordings for visual changes (include before and after where useful).
-->
## Checklist
- [ ] The PR has a single, focused purpose and contains no unrelated changes.
- [ ] The title is a clear, imperative summary of the change (for example, "Add retry to payment client").
- [ ] I have added or updated tests that cover this change.
- [ ] The build succeeds and the tests pass locally.
- [ ] The code follows the existing patterns and style of this repository.
- [ ] I have updated documentation, changelogs or API references where required.
- [ ] I have reviewed my own diff, and this description reflects the final state of the change.

51
.github/workflows/deploy-docs.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
name: Deploy Docs to GitHub Pages
on:
push:
branches:
- main
- docs
paths:
- "docs/**"
- "mkdocs.yml"
- ".github/workflows/deploy-docs.yml"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: pip install mkdocs mkdocs-material mkdocs-glightbox mkdocs-panzoom-plugin mkdocs-minify-plugin
- name: Build site
run: mkdocs build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "site"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

View File

@@ -1,19 +0,0 @@
name: Node.js CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci

61
.github/workflows/tests.yml vendored Normal file
View File

@@ -0,0 +1,61 @@
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
containerized-tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: web
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Generate test environment file
run: ./generate-env.sh .env.test
- name: Build test images
run:
docker compose --env-file .env.test -f docker-compose.test.yaml build
- name: Run tests
run: |
docker compose --env-file .env.test -f docker-compose.test.yaml up -d
docker compose --env-file .env.test -f docker-compose.test.yaml wait api.specs unit.tests frontend.tests || true
- name: Check test container exit codes
if: always()
run: |
status=0
for name in test-env-database-migrations test-env-database-seed test-env-api-specs test-env-unit-tests test-env-frontend-tests; do
code="$(docker inspect -f '{{.State.ExitCode}}' "$name" 2>/dev/null || echo 1)"
echo "$name exited with $code"
if [ "$code" != "0" ]; then
status=1
fi
done
exit $status
- name: Show service logs on failure
if: failure()
run:
docker compose --env-file .env.test -f docker-compose.test.yaml logs
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: web/test-results
- name: Tear down
if: always()
run:
docker compose --env-file .env.test -f docker-compose.test.yaml down
-v

465
.gitignore vendored
View File

@@ -1,5 +1,5 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
scratchpad.txt
# dependencies
/node_modules
/.pnp
@@ -15,6 +15,15 @@
# production
/build
# project-specific build artifacts
/web/frontend/build/
/web/frontend/storybook-static/
/web/frontend/.react-router/
/web/frontend/playwright-report/
/web/frontend/test-results/
/test-results/
/docs/rendered-diagrams/
# misc
.DS_Store
*.pem
@@ -42,7 +51,459 @@ next-env.d.ts
# vscode
.vscode
.idea/
*.swp
*.swo
/cloudinary-images
.obsidian
.obsidian
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
*.env
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
[Dd]ebug/x64/
[Dd]ebugPublic/x64/
[Rr]elease/x64/
[Rr]eleases/x64/
bin/x64/
obj/x64/
[Dd]ebug/x86/
[Dd]ebugPublic/x86/
[Rr]elease/x86/
[Rr]eleases/x86/
bin/x86/
obj/x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
[Aa][Rr][Mm]64[Ee][Cc]/
bld/
[Oo]bj/
[Oo]ut/
[Ll]og/
[Ll]ogs/
# Build results on 'Bin' directories
**/[Bb]in/*
# Uncomment if you have tasks that rely on *.refresh files to move binaries
# (https://github.com/github/gitignore/pull/3736)
#!**/[Bb]in/*.refresh
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
*.trx
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Approval Tests result files
*.received.*
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.idb
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
# but not Directory.Build.rsp, as it configures directory-level build defaults
!Directory.Build.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
*.ncb
*.aps
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
**/.paket/paket.exe
paket-files/
# FAKE - F# Make
**/.fake/
# CodeRush personal settings
**/.cr/personal
# Python Tools for Visual Studio (PTVS)
**/__pycache__/
*.pyc
# Cake - Uncomment if you are using it
#tools/**
#!tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
MSBuild_Logs/
# AWS SAM Build and Temporary Artifacts folder
.aws-sam
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
**/.mfractor/
# Local History for Visual Studio
**/.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
**/.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
# Local History for Visual Studio Code
.history/
# Built Visual Studio Code Extensions
*.vsix
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
.DS_Store
*/data_source/other
.fake
.idea
*.feature.cs
.env
.env.dev
.env.test
.env.prod
*storybook.log
storybook-static
web/test-results/frontend/vitest-storybook.xml
web/test-results/frontend/playwright-storybook.xml
# mkdocs build output
/site

File diff suppressed because it is too large Load Diff

299
README.md
View File

@@ -1,219 +1,182 @@
# The Biergarten App
## About
The Biergarten App is a full-stack directory and discovery platform for
breweries. It provides:
The Biergarten App is a web application designed for beer lovers to share their favorite
brews and breweries with like-minded people online.
- JWT-based user authentication, with email confirmation and refresh-token
reissue
- A searchable database of brewery locations
- An offline data-generation pipeline that uses large language models (LLMs)
via Llama.cpp and Wikipedia to synthesize realistic seed data
This application's stack consists of Next.js, Prisma and Neon Postgres. I'm motivated to
learn more about these technologies while exploring my passion for beer.
The repository is organized into:
I've also incorporated different APIs into the application, such as the Cloudinary API for
image uploading, the SparkPost API for email services as well as Mapbox for geolocation
and map data.
- A .NET backend (Web API + database migrations/seed) under `web/backend/`
- A server-rendered React website (React Router + Vite) under `web/frontend/`
- A C++20 data-generation CLI under `tooling/pipeline/`
To handle serverless functions (API routes), I use the next-connect package.
Specialized documentation (setup, architecture, docker, testing, diagrams, and
pipeline notes) lives under `docs/`.
On the client-side, I use Tailwind CSS, Headless UI and Daisy UI for styling to create a
visually appealing and user-friendly interface.
## Documentation
I'm sharing my code publicly so that others can learn from it and use it as a reference
for their own projects.
Website + backend (active stack):
### Some beer terminology
- [Getting Started](docs/web/getting-started.md)
- [Architecture](docs/web/architecture.md)
- [Database](docs/web/database.md)
- [Docker Guide](docs/web/docker.md)
- [Testing](docs/web/testing.md)
- [Environment Variables](docs/web/environment-variables.md)
- [Token Validation](docs/web/token-validation.md)
In this app you will encounter various beer related terms. Here is a list of terms used in
this app and their definitions.
Data generation pipeline (C++):
#### ABV
- [Pipeline README](docs/pipeline/README.md)
- [Ethics & Known Issues](docs/pipeline/ETHICS-AND-KNOWN-ISSUES.md)
[Alcohol by volume](https://en.wikipedia.org/wiki/Alcohol_by_volume) (abbreviated as ABV)
is a standard measure of how much alcohol (ethanol) is contained in a given volume of an
alcoholic beverage (expressed as a volume percent).
## Current status
#### IBU
Active areas in the repository:
The
[International Bitterness Units](https://en.wikipedia.org/wiki/Beer_measurement#Bitterness)
scale, or IBU, is used to approximately quantify the bitterness of beer. This scale is not
measured on the perceived bitterness of the beer, but rather the amount of a component of
beer known as iso-alpha acids.
- .NET 10 backend (vertical-slice architecture with MediatR) + SQL Server
- React 19 website (React Router 8 + Vite)
- Shared Biergarten theme system + Storybook coverage
- Auth flows and account/email integration (local Mailpit in dev compose)
- Photo upload to S3-compatible object storage (local SeaweedFS in dev compose)
- Data generation pipeline with C++ and Llama.cpp
## Database Schema
Archived/reference areas:
![Schema](./schema.svg)
- `archive/next-js-web-app/` contains an older Next.js frontend retained for
reference
## Technologies
## Tech stack
### General
- **Backend**: .NET 10, ASP.NET Core, SQL Server 2022, DbUp
- **Frontend**: React 19, React Router 8, Vite 7, Tailwind CSS 4, DaisyUI 5,
Leaflet/React Leaflet (brewery maps)
- **UI Documentation**: Storybook 10, Vitest browser mode, Playwright
- **Testing**: xUnit, Reqnroll (BDD), FluentAssertions, Moq
- **Infrastructure**: Docker, Docker Compose
- **Security**: Argon2id password hashing, JSON Web Tokens (JWT) for
access/refresh/confirmation
- **Data Pipeline**: C++20, CMake, Boost, libcurl, SQLite, llama.cpp
- [Next.js](https://nextjs.org/)
- A React based framework for building web applications offering several features such
as server side rendering, static site generation and API routes.
## Requirements
### Client
- .NET SDK 10 or later
- Node.js 22 or later
- Docker Desktop, or an equivalent Docker Engine setup
- [SWR](https://swr.vercel.app/)
- A React Hooks library for fetching data with support for caching, revalidation and
error handling.
- [Tailwind CSS](https://tailwindcss.com/)
- A popular open-source utility-first CSS framework that provides pre-defined classes to
style HTML elements.
- [Headless UI](https://headlessui.dev/)
- A set of completely unstyled, fully accessible UI components, designed to integrate
beautifully with Tailwind CSS.
- [Daisy UI](https://daisyui.com/)
- A component library for Tailwind CSS that provides ready-to-use components for
building user interfaces.
See [Getting Started](docs/web/getting-started.md) for the full
prerequisite list, including the pipeline's C++ toolchain.
### Server
## Quick start
- [Prisma](https://www.prisma.io/)
- An open-source ORM for Node.js and TypeScript applications.
- [Neon Postgres](https://neon.tech/)
- A managed PostgreSQL database service powered by Neon.
- [Cloudinary](https://cloudinary.com/)
- A cloud-based image and video management service that provides developers with an easy
way to upload, store, and manipulate media assets.
- [SparkPost](https://www.sparkpost.com/)
- A cloud-based email delivery service that provides developers with an easy way to send
transactional and marketing emails.
- [Mapbox](https://www.mapbox.com/)
- A suite of open-source mapping tools that allows developers to add custom maps,
search, and navigation into their applications.
- [next-connect](https://github.com/hoangvvo/next-connect#readme)
- A promise-based method routing and middleware layer for Next.js.
For full setup details, use [Getting Started](docs/web/getting-started.md).
This section is the shortest path to a working dev environment.
## How to run locally
### Prerequisites
Before you can run this application locally, you will need to have the following installed
on your machine:
- [Node.js](https://nodejs.org/en/)
- [npm (version 8 or higher)](https://www.npmjs.com/get-npm)
You will also need to create a free account with the following services:
- [Cloudinary](https://cloudinary.com/users/register/free)
- [SparkPost](https://www.sparkpost.com/)
- [Neon Postgres](https://neon.tech/)
- [Mapbox](https://account.mapbox.com/auth/signup/)
### Setup
1. Clone this repository and navigate to the project directory.
### Full stack (Docker)
```bash
git clone https://github.com/aaronpo97/the-biergarten-app
cd the-biergarten-app
cd web && ./generate-env.sh .env.dev && cd ..
docker compose --env-file web/.env.dev -f web/docker-compose.dev.yaml up --build -d
```
2. Run the following command to install the dependencies.
`generate-env.sh` copies `.env.example` and replaces the secret-bearing values
with freshly randomized ones; a plain `cp` leaves placeholder secrets in
place. See [Environment Variables](docs/web/environment-variables.md#generating-an-env-file)
for details.
Access:
- Website: http://localhost:3000
- API Swagger: http://localhost:8080/swagger
- Health Check: http://localhost:8080/health
- Mailpit UI (dev SMTP): http://localhost:8025
- SeaweedFS S3 API (dev object storage): http://localhost:8333
### Frontend (Node, outside Docker)
```bash
cd web/frontend
npm install
API_BASE_URL=http://localhost:8080 SESSION_SECRET=dev-secret-change-me npm run dev
```
3. Run the following script to create a `.env` file in the root directory of the project
and add the following environment variables. Update these variables with your own
values.
Optional frontend tools:
```bash
echo "BASE_URL=
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=
CLOUDINARY_KEY=
CLOUDINARY_SECRET=
CONFIRMATION_TOKEN_SECRET=
RESET_PASSWORD_TOKEN_SECRET=
SESSION_SECRET=
SESSION_TOKEN_NAME=
SESSION_MAX_AGE=
NODE_ENV=
POSTGRES_PRISMA_URL=
POSTGRES_URL_NON_POOLING=
SHADOW_DATABASE_URL=
ADMIN_PASSWORD=
MAPBOX_ACCESS_TOKEN=
SPARKPOST_API_KEY=
SPARKPOST_SENDER_ADDRESS=" > .env
cd web/frontend
npm run storybook
npm run test:storybook
npm run test:storybook:playwright
```
### Explanation of environment variables
## Repository structure
- `BASE_URL` is the base URL of the application.
- For example, if you are running the application locally, you can set this to
`http://localhost:3000`.
- `NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME`, `CLOUDINARY_KEY`, and `CLOUDINARY_SECRET` are the
credentials for your Cloudinary account.
- You can create a free account [here](https://cloudinary.com/users/register/free).
- `CONFIRMATION_TOKEN_SECRET` is the secret used to sign the confirmation token used for
email confirmation.
- You can generate a random string using the`openssl rand -base64 127` command.
- `RESET_PASSWORD_TOKEN_SECRET` is the secret used to sign the reset password token.
- You can generate a random string using the `openssl rand -base64 127` command.
- `SESSION_SECRET` is the secret used to sign the session cookie.
- Use the same command as above to generate a random string.
- `SESSION_TOKEN_NAME` is the name of the session cookie.
- You can set this to `biergarten`.
- `SESSION_MAX_AGE` is the maximum age of the session cookie in seconds.
- You can set this to `604800` (1 week).
- `POSTGRES_PRISMA_URL`is a pooled connection string for your Neon Postgres database.
- `POSTGRES_URL_NON_POOLING` is a non-pooled connection string for your Neon Postgres
database used for migrations.
- `SHADOW_DATABASE_URL` is a connection string for a secondary database used for
migrations to detect schema drift.
- You can create a free account [here](https://neon.tech).
- Consult the [docs](https://neon.tech/docs/guides/prisma) for more information.
- `MAPBOX_ACCESS_TOKEN` is the access token for your Mapbox account.
- You can create a free account [here](https://account.mapbox.com/auth/signup/).
- `NODE_ENV` is the environment in which the application is running.
- You can set this to `development` or `production`.
- `SPARKPOST_API_KEY` is the API key for your SparkPost account.
- You can create a free account [here](https://www.sparkpost.com/).
- `SPARKPOST_SENDER_ADDRESS` is the email address that will be used to send emails.
- `ADMIN_PASSWORD` is the password for the admin account created when seeding the
database.
```text
web/
backend/ .NET API: API.Core (host), Features.* (vertical slices),
Shared.*, Domain.*, Infrastructure.*, Database.* projects
frontend/ React Router website + Storybook + Playwright/Vitest
1. Initialize the database and run the migrations.
tooling/
pipeline/ C++20 seed-data generation CLI (CMake)
docs/
web/ Architecture, setup, docker, testing, diagrams
pipeline/ Pipeline docs, ethics notes, diagrams
archive/
next-js-web-app/ Older Next.js frontend (reference only)
```
## Testing
Create a test environment file, then run the full test stack (backend and
frontend) with Docker:
```bash
npx prisma generate
npx prisma migrate dev
cd web && ./generate-env.sh .env.test && cd ..
docker compose --env-file web/.env.test -f web/docker-compose.test.yaml up --abort-on-container-exit
```
5. Seed the database with some initial data.
The same command runs in CI via
[`.github/workflows/tests.yml`](.github/workflows/tests.yml) on every push
and pull request to `main`. See [Testing](docs/web/testing.md) for the
full command list.
```bash
npm run seed
```
## Configuration
6. Start the application.
Common active variables:
```bash
npm run dev
```
- Backend/Docker: `DB_SERVER`, `DB_NAME`, `DB_USER`, `DB_PASSWORD`,
`ACCESS_TOKEN_SECRET`, `REFRESH_TOKEN_SECRET`, `CONFIRMATION_TOKEN_SECRET`,
`WEBSITE_BASE_URL`
- Frontend runtime: `API_BASE_URL`, `SESSION_SECRET`, `NODE_ENV`
See [Environment Variables](docs/web/environment-variables.md) for details.
## Contributing
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Run the checks in [Testing](docs/web/testing.md) (backend tests,
`npm run lint`, `npm run typecheck`)
5. Push to the branch (`git push origin feature/amazing-feature`)
6. Open a Pull Request
## Support
Report bugs and request features via
[GitHub Issues](https://github.com/aaronpo97/the-biergarten-app/issues).
## License
The Biergarten App is licensed under the GNU General Public License v3.0. This means that
anyone is free to use, modify, and distribute the code as long as they also distribute
their modifications under the same license.
I encourage anyone who uses this code for educational purposes to attribute me as the
original author, and to provide a link to this repository.
By contributing to this repository, you agree to license your contributions under the same
license as the project.
If you have any questions or concerns about the license, please feel free to submit an
issue to this repository.
I hope that this project will be useful to other developers and beer enthusiasts who are
interested in learning about web development with Next.js, Prisma, Postgres, and other
technologies.
GPL-3.0. See [LICENSE.md](LICENSE.md).

219
archive/next-js-web-app/README.old.md vendored Normal file
View File

@@ -0,0 +1,219 @@
# The Biergarten App
## About
The Biergarten App is a web application designed for beer lovers to share their favorite
brews and breweries with like-minded people online.
This application's stack consists of Next.js, Prisma and Neon Postgres. I'm motivated to
learn more about these technologies while exploring my passion for beer.
I've also incorporated different APIs into the application, such as the Cloudinary API for
image uploading, the SparkPost API for email services as well as Mapbox for geolocation
and map data.
To handle serverless functions (API routes), I use the next-connect package.
On the client-side, I use Tailwind CSS, Headless UI and Daisy UI for styling to create a
visually appealing and user-friendly interface.
I'm sharing my code publicly so that others can learn from it and use it as a reference
for their own projects.
### Some beer terminology
In this app you will encounter various beer related terms. Here is a list of terms used in
this app and their definitions.
#### ABV
[Alcohol by volume](https://en.wikipedia.org/wiki/Alcohol_by_volume) (abbreviated as ABV)
is a standard measure of how much alcohol (ethanol) is contained in a given volume of an
alcoholic beverage (expressed as a volume percent).
#### IBU
The
[International Bitterness Units](https://en.wikipedia.org/wiki/Beer_measurement#Bitterness)
scale, or IBU, is used to approximately quantify the bitterness of beer. This scale is not
measured on the perceived bitterness of the beer, but rather the amount of a component of
beer known as iso-alpha acids.
## Database Schema
![Schema](./schema.svg)
## Technologies
### General
- [Next.js](https://nextjs.org/)
- A React based framework for building web applications offering several features such
as server side rendering, static site generation and API routes.
### Client
- [SWR](https://swr.vercel.app/)
- A React Hooks library for fetching data with support for caching, revalidation and
error handling.
- [Tailwind CSS](https://tailwindcss.com/)
- A popular open-source utility-first CSS framework that provides pre-defined classes to
style HTML elements.
- [Headless UI](https://headlessui.dev/)
- A set of completely unstyled, fully accessible UI components, designed to integrate
beautifully with Tailwind CSS.
- [Daisy UI](https://daisyui.com/)
- A component library for Tailwind CSS that provides ready-to-use components for
building user interfaces.
### Server
- [Prisma](https://www.prisma.io/)
- An open-source ORM for Node.js and TypeScript applications.
- [Neon Postgres](https://neon.tech/)
- A managed PostgreSQL database service powered by Neon.
- [Cloudinary](https://cloudinary.com/)
- A cloud-based image and video management service that provides developers with an easy
way to upload, store, and manipulate media assets.
- [SparkPost](https://www.sparkpost.com/)
- A cloud-based email delivery service that provides developers with an easy way to send
transactional and marketing emails.
- [Mapbox](https://www.mapbox.com/)
- A suite of open-source mapping tools that allows developers to add custom maps,
search, and navigation into their applications.
- [next-connect](https://github.com/hoangvvo/next-connect#readme)
- A promise-based method routing and middleware layer for Next.js.
## How to run locally
### Prerequisites
Before you can run this application locally, you will need to have the following installed
on your machine:
- [Node.js](https://nodejs.org/en/)
- [npm (version 8 or higher)](https://www.npmjs.com/get-npm)
You will also need to create a free account with the following services:
- [Cloudinary](https://cloudinary.com/users/register/free)
- [SparkPost](https://www.sparkpost.com/)
- [Neon Postgres](https://neon.tech/)
- [Mapbox](https://account.mapbox.com/auth/signup/)
### Setup
1. Clone this repository and navigate to the project directory.
```bash
git clone https://github.com/aaronpo97/the-biergarten-app
cd the-biergarten-app
```
2. Run the following command to install the dependencies.
```bash
npm install
```
3. Run the following script to create a `.env` file in the root directory of the project
and add the following environment variables. Update these variables with your own
values.
```bash
echo "BASE_URL=
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=
CLOUDINARY_KEY=
CLOUDINARY_SECRET=
CONFIRMATION_TOKEN_SECRET=
RESET_PASSWORD_TOKEN_SECRET=
SESSION_SECRET=
SESSION_TOKEN_NAME=
SESSION_MAX_AGE=
NODE_ENV=
POSTGRES_PRISMA_URL=
POSTGRES_URL_NON_POOLING=
SHADOW_DATABASE_URL=
ADMIN_PASSWORD=
MAPBOX_ACCESS_TOKEN=
SPARKPOST_API_KEY=
SPARKPOST_SENDER_ADDRESS=" > .env
```
### Explanation of environment variables
- `BASE_URL` is the base URL of the application.
- For example, if you are running the application locally, you can set this to
`http://localhost:3000`.
- `NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME`, `CLOUDINARY_KEY`, and `CLOUDINARY_SECRET` are the
credentials for your Cloudinary account.
- You can create a free account [here](https://cloudinary.com/users/register/free).
- `CONFIRMATION_TOKEN_SECRET` is the secret used to sign the confirmation token used for
email confirmation.
- You can generate a random string using the`openssl rand -base64 127` command.
- `RESET_PASSWORD_TOKEN_SECRET` is the secret used to sign the reset password token.
- You can generate a random string using the `openssl rand -base64 127` command.
- `SESSION_SECRET` is the secret used to sign the session cookie.
- Use the same command as above to generate a random string.
- `SESSION_TOKEN_NAME` is the name of the session cookie.
- You can set this to `biergarten`.
- `SESSION_MAX_AGE` is the maximum age of the session cookie in seconds.
- You can set this to `604800` (1 week).
- `POSTGRES_PRISMA_URL`is a pooled connection string for your Neon Postgres database.
- `POSTGRES_URL_NON_POOLING` is a non-pooled connection string for your Neon Postgres
database used for migrations.
- `SHADOW_DATABASE_URL` is a connection string for a secondary database used for
migrations to detect schema drift.
- You can create a free account [here](https://neon.tech).
- Consult the [docs](https://neon.tech/docs/guides/prisma) for more information.
- `MAPBOX_ACCESS_TOKEN` is the access token for your Mapbox account.
- You can create a free account [here](https://account.mapbox.com/auth/signup/).
- `NODE_ENV` is the environment in which the application is running.
- You can set this to `development` or `production`.
- `SPARKPOST_API_KEY` is the API key for your SparkPost account.
- You can create a free account [here](https://www.sparkpost.com/).
- `SPARKPOST_SENDER_ADDRESS` is the email address that will be used to send emails.
- `ADMIN_PASSWORD` is the password for the admin account created when seeding the
database.
1. Initialize the database and run the migrations.
```bash
npx prisma generate
npx prisma migrate dev
```
5. Seed the database with some initial data.
```bash
npm run seed
```
6. Start the application.
```bash
npm run dev
```
## License
The Biergarten App is licensed under the GNU General Public License v3.0. This means that
anyone is free to use, modify, and distribute the code as long as they also distribute
their modifications under the same license.
I encourage anyone who uses this code for educational purposes to attribute me as the
original author, and to provide a link to this repository.
By contributing to this repository, you agree to license your contributions under the same
license as the project.
If you have any questions or concerns about the license, please feel free to submit an
issue to this repository.
I hope that this project will be useful to other developers and beer enthusiasts who are
interested in learning about web development with Next.js, Prisma, Postgres, and other
technologies.

10881
archive/next-js-web-app/package-lock.json generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

Before

Width:  |  Height:  |  Size: 203 KiB

After

Width:  |  Height:  |  Size: 203 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

Before

Width:  |  Height:  |  Size: 515 B

After

Width:  |  Height:  |  Size: 515 B

View File

Before

Width:  |  Height:  |  Size: 961 B

After

Width:  |  Height:  |  Size: 961 B

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 256 KiB

After

Width:  |  Height:  |  Size: 256 KiB

Some files were not shown because too many files have changed in this diff Show More