···11# Statusphere React
2233-A monorepo for the Statusphere application, which includes a React client and a Node.js backend.
33+A status sharing application built with React and the AT Protocol.
4455-This is a React refactoring of the [example application](https://atproto.com/guides/applications) covering:
55+This is a React implementation of the [example application](https://atproto.com/guides/applications) covering:
6677- Signin via OAuth
88- Fetch information about users (profiles)
···4242### Additional Commands
43434444```bash
4545-# Build both packages
4646-pnpm build
4545+# Build commands
4646+pnpm build # Build frontend first, then backend
4747+pnpm build:appview # Build only the backend
4848+pnpm build:client # Build only the frontend
4949+5050+# Start commands
5151+pnpm start # Start the server (serves API and frontend)
5252+pnpm start:client # Start frontend development server only
5353+pnpm start:dev # Start both backend and frontend separately (development only)
5454+5555+# Other utilities
5656+pnpm typecheck # Run type checking
5757+pnpm format # Format all code
5858+```
5959+6060+## Deployment
47614848-# Run typecheck on both packages
4949-pnpm typecheck
6262+For production deployment:
50635151-# Format all code
5252-pnpm format
6464+1. Build both packages:
6565+ ```bash
6666+ pnpm build
6767+ ```
6868+6969+ This will:
7070+ - Build the frontend (`packages/client`) first
7171+ - Then build the backend (`packages/appview`)
7272+7373+2. Start the server:
7474+ ```bash
7575+ pnpm start
7676+ ```
7777+7878+The backend server will:
7979+- Serve the API at `/api/*` endpoints
8080+- Serve the frontend static files from the client's build directory
8181+- Handle client-side routing by serving index.html for all non-API routes
8282+8383+This simplifies deployment to a single process that handles both the API and serves the frontend assets.
8484+8585+## Environment Variables
8686+8787+Create a `.env` file in the root directory with:
8888+8989+```
9090+# Required for AT Protocol authentication
9191+ATP_SERVICE_DID=did:plc:your-service-did
9292+ATP_CLIENT_ID=your-client-id
9393+ATP_CLIENT_SECRET=your-client-secret
9494+ATP_REDIRECT_URI=https://your-domain.com/oauth-callback
9595+9696+# Optional
9797+PORT=3001
9898+SESSION_SECRET=your-session-secret
5399```
5410055101## Requirements