Files
member-console/README.md

85 lines
1.8 KiB
Markdown

# member-console
Member console application for users to create, acccess, and manage their accounts associated with the Wiki Cafe MSC (multi-stakeholder co-operative).
## Database Management
See [docs/database-management.md](docs/database-management.md) for migrations, per-module schema ownership, and sqlc code generation.
## Building and publishing container image
Building and publishing the container image is done using Docker Buildx. This allows us to build multi-platform images for both ARM64 and AMD64 architectures.
```bash
docker buildx build \
--platform linux/arm64,linux/amd64 \
-t git.coopcloud.tech/wiki-cafe/member-console:latest \
-t git.coopcloud.tech/wiki-cafe/member-console:$(date +%Y-%m-%d) \
--push \
.
```
## Deploying image to production
### Generating Secrets
To generate secure values for `session-secret` and `csrf-secret`, use the following commands:
For `session-secret` (a base64-encoded random string):
```bash
openssl rand -base64 32
```
Example output:
```
rJcniy2aWl3vwBcrMJfqsTL+Wys7EwDx/RC+DRrKcYg=
```
For `csrf-secret` (a 32-character hexadecimal string):
```bash
openssl rand -hex 16
```
Example output:
```
e157b42a5b608882179cb4ac69c12f84
```
Ensure these secrets are securely stored and persisted for application use.
## Development
### Building
Compile to ./member-console
```bash
make build
```
### Linting
Ensure no handler bypasses SafeTemplates by writing directly to ResponseWriter
```bash
make lint-templates
```
`lint-templates` scans `internal/server/` for `.ExecuteTemplate(w,` in any file. All template rendering must go through `h.Templates.Render()` — see `internal/server/render.go` for why.
### Database
Regenerate sqlc query code after schema changes
```bash
make sqlc-generate
```
## Development status
See [`status/`](status/) for the development roadmap, milestones, and notes.