mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-04-05 07:14:02 -04:00
Update docs
This commit is contained in:
@@ -1,34 +1,26 @@
|
||||
# Dev tasks
|
||||
# Development tasks
|
||||
|
||||
## P1
|
||||
See also the tasks in the [README](../README.md).
|
||||
|
||||
- [x] Emails
|
||||
- [ ] Unsubscribe and manage notifications
|
||||
- [ ] Dev setup docs
|
||||
- [ ] yarn precommit function for basic formatting (lint and type checks)
|
||||
- [x] Analytics (posthog)
|
||||
- [ ] Grafana
|
||||
- [x] Share profile to anyone with link
|
||||
- [ ] Relationships
|
||||
- [x] Settings flow
|
||||
|
||||
## P2
|
||||
|
||||
- [ ] Search questions
|
||||
- [ ] Profile form validation on client (tanstack form?)
|
||||
- [ ] Dense list of users
|
||||
- [ ] init_db.ts for new db
|
||||
- [ ] seed_data.sql
|
||||
|
||||
## P3
|
||||
|
||||
- [ ] Google One Tap
|
||||
- [ ] Update base og image - we don't have the rights to Bet On Love
|
||||
- [ ] db migrations and schema updates in CI
|
||||
- [ ] MCP server
|
||||
- [ ] Migrate tiptap json to markdown
|
||||
- [ ] tiptap -> markdown
|
||||
- [ ] markdown -> react
|
||||
- [ ] markdown -> editor component
|
||||
- [ ] migrate mesages
|
||||
- [ ] migrate messages
|
||||
- [ ] migrate comments
|
||||
- [ ] migrate profiles
|
||||
@@ -1,5 +1,8 @@
|
||||
# Documentation for development
|
||||
|
||||
> [!WARNING]
|
||||
> TODO: This document is a work in progress. Please help us improve it by contributing!
|
||||
|
||||
### Adding a new profile variable
|
||||
|
||||
To add a profile variable (personality type, etc.), make modifications here:
|
||||
|
||||
@@ -1,37 +1,31 @@
|
||||
# Project Knowledge
|
||||
|
||||
This is a dating app. It has questions and profiles.
|
||||
> [!WARNING]
|
||||
> TODO: This document is a work in progress. Please help us improve it by contributing!
|
||||
|
||||
## Development Workflow
|
||||
|
||||
- Current progress in todos.md
|
||||
- Current progress in [TODO.md](TODO.md)
|
||||
- Global packages should be installed with `bun`, not npm or yarn.
|
||||
- Do not run build commands after each change unless specifically requested by me. Mostly, I'm typically already running a dev server.
|
||||
- HUMAN TODO: create a yarn precommit function that does basic formatting that normally happens on save, as well as lint and type checks.
|
||||
|
||||
## Project Structure
|
||||
|
||||
- next.js react tailwind frontend `/web`
|
||||
|
||||
- broken down into pages, components, hooks, lib
|
||||
|
||||
- express node api server `/backend/api`
|
||||
- one off scripts, like migrations `/backend/scripts`
|
||||
- supabase postgres. schema in `/backend/supabase`
|
||||
- generated by `/backend/scripts/regen-schema.ts`
|
||||
- supbase-generated types in `/backend/supabase/schema.ts`
|
||||
- supabase-generated types in `/backend/supabase/schema.ts`
|
||||
- files shared between backend directories `/backend/shared`
|
||||
|
||||
- anything in backend can import from shared, but not vice versa
|
||||
|
||||
- files shared between the frontend and backend `/common`
|
||||
- common has lots of type definitions for our data structures, like Contract and User. It also contains many useful utility functions. We try not to add package dependencies to common. web and backend are allowed to import from common, but not vice versa
|
||||
- anything in `/backend` can import from `shared`, but not vice versa
|
||||
- files shared between the frontend and backend in `/common`
|
||||
- `/common` has lots of type definitions for our data structures, like User. It also contains many useful utility functions. We try not to add package dependencies to common. `/web` and `/backend` are allowed to import from `/common`, but not vice versa.
|
||||
|
||||
## Deployment
|
||||
|
||||
- The project has both dev and prod environments
|
||||
- Project is on GCP (Google Cloud Platform). Deployment handled by terraform
|
||||
- Project ID is `compass-130ba`
|
||||
- The project has both dev and prod environments.
|
||||
- Backend is on GCP (Google Cloud Platform). Deployment handled by terraform.
|
||||
- Project ID is `compass-130ba`.
|
||||
|
||||
## Code Guidelines
|
||||
|
||||
@@ -141,7 +135,7 @@ This stores the result in memory, and allows you to call refresh() to get an upd
|
||||
|
||||
---
|
||||
|
||||
We frequently use `usePersistentInMemoryState` or `usePersistentLocalState` as an alternative to `useState`. These cache data. Most of the time you want in memory caching so that navigating back to a page will preserve the same state and appear to load instantly.
|
||||
We frequently use `usePersistentInMemoryState` or `usePersistentLocalState` as an alternative to `useState`. These cache data. Most of the time you want in-memory caching so that navigating back to a page will preserve the same state and appear to load instantly.
|
||||
|
||||
Here's the definition of usePersistentInMemoryState:
|
||||
|
||||
@@ -257,11 +251,11 @@ export function broadcastUpdatedComment(comment: Comment) {
|
||||
|
||||
---
|
||||
|
||||
We have our scripts in the directory `backend/scripts`.
|
||||
We have our scripts in the directory `/backend/scripts`.
|
||||
|
||||
To write a script, run it inside the helper function called `runScript` that automatically fetches any secret keys and loads them into process.env.
|
||||
|
||||
Example from `backend/scripts/manicode.ts`
|
||||
Example from `/backend/scripts/manicode.ts`
|
||||
|
||||
```ts
|
||||
import { runScript } from 'run-script'
|
||||
@@ -294,7 +288,7 @@ bun x ts-node manicode.ts "Generate a page called cowp, which has cows that make
|
||||
|
||||
---
|
||||
|
||||
Our backend is mostly a set of endpoints. We create new endpoints by adding to the schema in `common/src/api/schema.ts`.
|
||||
Our backend is mostly a set of endpoints. We create new endpoints by adding to the schema in `/common/src/api/schema.ts`.
|
||||
|
||||
E.g. Here is a hypothetical bet schema:
|
||||
|
||||
@@ -317,7 +311,7 @@ E.g. Here is a hypothetical bet schema:
|
||||
dryRun: z.boolean().optional(),
|
||||
})
|
||||
.strict(),
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
Then, we define the bet endpoint in `backend/api/src/place-bet.ts`
|
||||
|
||||
Reference in New Issue
Block a user