|
1 | | -# Cloud Markdown |
| 1 | +# Puffnotes |
2 | 2 |
|
3 | | -A simple markdown notes app with: |
| 3 | +Puffnotes is a simple markdown notes app for writing, editing, and managing notes in one place. |
4 | 4 |
|
5 | | -- React + Vite frontend |
6 | | -- Go backend |
7 | | -- PostgreSQL for storage |
8 | | -- Clerk for authentication |
| 5 | +The app is hosted on Railway: https://puffnotes.up.railway.app |
9 | 6 |
|
10 | | -## Project Structure |
| 7 | +## Tech Stack |
11 | 8 |
|
12 | | -- `frontend/` - React app |
13 | | -- `backend/` - Go API |
| 9 | +- React 19 |
| 10 | +- TypeScript |
| 11 | +- Vite |
| 12 | +- Tailwind CSS |
| 13 | +- TipTap editor |
| 14 | +- Clerk authentication |
| 15 | +- Go |
| 16 | +- PostgreSQL |
| 17 | +- Railway |
14 | 18 |
|
15 | | -## Environment |
| 19 | +## Running Locally |
16 | 20 |
|
17 | | -Copy `.env.example` to `.env` and fill in the Clerk values: |
| 21 | +### 1. Add your environment variables |
| 22 | + |
| 23 | +Copy `.env.example` to `.env` and update the values. |
18 | 24 |
|
19 | 25 | ```env |
20 | 26 | CLERK_SECRET_KEY= |
21 | 27 | VITE_CLERK_PUBLISHABLE_KEY= |
22 | | -VITE_API_BASE_URL= |
| 28 | +VITE_API_BASE_URL=http://localhost:8080 |
| 29 | +DB_URL=postgres://postgres:postgres@localhost:5432/puffnotes |
| 30 | +HTTP_PORT=:8080 |
23 | 31 | ``` |
24 | 32 |
|
25 | | -Notes: |
26 | | - |
27 | | -- The frontend uses Clerk in the browser. |
28 | | -- The backend reads `CLERK_SECRET_KEY` from the repo root `.env`. |
29 | | -- The backend database URL is currently hardcoded in `backend/cmd/main.go`. |
30 | | - |
31 | | -## Run the Frontend |
| 33 | +### 2. Start the frontend |
32 | 34 |
|
33 | 35 | ```bash |
34 | 36 | cd frontend |
35 | 37 | npm install |
36 | 38 | npm run dev |
37 | 39 | ``` |
38 | 40 |
|
39 | | -Default dev URL: |
| 41 | +The frontend runs on `http://localhost:5173`. |
40 | 42 |
|
41 | | -```text |
42 | | -http://localhost:5173 |
43 | | -``` |
| 43 | +### 3. Start the backend |
44 | 44 |
|
45 | | -## Run the Backend |
46 | | - |
47 | | -Make sure PostgreSQL is running and the `puffnotes` database exists. |
48 | | - |
49 | | -Current hardcoded database connection: |
50 | | - |
51 | | -```text |
52 | | -postgres://oshan:123@localhost:5432/puffnotes |
53 | | -``` |
54 | | - |
55 | | -Then start the API: |
| 45 | +Make sure PostgreSQL is running first, then run: |
56 | 46 |
|
57 | 47 | ```bash |
58 | 48 | cd backend |
59 | | -go run ./cmd |
60 | | -``` |
61 | | - |
62 | | -Default API URL: |
63 | | - |
64 | | -```text |
65 | | -http://localhost:8080 |
| 49 | +go run ./cmd/server |
66 | 50 | ``` |
67 | 51 |
|
68 | | -## Auth Flow |
69 | | - |
70 | | -- Clerk handles sign-in in the frontend. |
71 | | -- The frontend sends the Clerk token in the `Authorization` header. |
72 | | -- The Go backend verifies the token with Clerk middleware before serving `/notes` routes. |
| 52 | +The API runs on `http://localhost:8080`. |
73 | 53 |
|
74 | | -## Current Status |
| 54 | +## Notes |
75 | 55 |
|
76 | | -- Auth is wired for signed-in access. |
| 56 | +- Clerk is used for authentication. |
77 | 57 | - Notes are stored in PostgreSQL. |
78 | | -- The app is still early-stage and some API behavior is still being cleaned up. |
| 58 | +- The frontend talks to the Go API using `VITE_API_BASE_URL`. |
0 commit comments