ATlast — you'll never need to find your favorites on another platform again. Find your favs in the ATmosphere.
atproto
1# Contributing to ATlast
2
3Thank you for your interest in contributing! This guide will help you get started with local development.
4
5## Two Development Modes
6
7We support two development modes:
8
9🎨 **Mock Mode** (No backend required)
10**Best for:** Frontend development, UI/UX work, design changes
11
12🔧 **Full Mode** (Complete backend)
13**Best for:** Backend development, API work, OAuth testing, database changes
14
15**Requirements:**
16- PostgreSQL database (local or Neon)
17- OAuth keys
18- Environment configuration
19
20---
21
22## Mock Mode Starting Guide
23
24Perfect for frontend contributors who want to jump in quickly!
25
261. Clone and Install
27```bash
28git clone <repo-url>
29cd atlast
30npm install
31```
32
332. Create .env.local
34```bash
35# .env.mock
36VITE_LOCAL_MOCK=true
37VITE_ENABLE_OAUTH=false
38VITE_ENABLE_DATABASE=false
39```
40
413. Start Development
42```bash
43npm run dev:mock
44```
45
464. Open Your Browser
47Go to `http://localhost:5173`
48
495. "Login" with Mock User
50Enter any handle - it will create a mock session.
51
526. Upload Test Data
53Upload your TikTok or Instagram data file. The mock API will generate fake matches for testing the UI.
54
55---
56
57## Full Mode Starting Guide
58
59For contributors working on backend features, OAuth, or database operations.
60
61### Prerequisites
62
63- Node.js 18+
64- PostgreSQL (or Neon account)
65- OpenSSL (for key generation)
66
671. Clone and Install
68```bash
69git clone <repo-url>
70cd atlast
71npm install
72npm install -g netlify-cli
73```
74
752. Database Setup
76
77 **Option A: Neon (Recommended)**
78 1. Create account at https://neon.tech
79 2. Create project "atlast-dev"
80 3. Copy connection string
81
82 **Option B: Local PostgreSQL**
83 ```bash
84 # macOS
85 brew install postgresql@15
86 brew services start postgresql@15
87 createdb atlast_dev
88
89 # Ubuntu
90 sudo apt install postgresql
91 sudo systemctl start postgresql
92 sudo -u postgres createdb atlast_dev
93 ```
94
953. Generate OAuth Keys
96```bash
97# Generate private key
98openssl ecparam -name prime256v1 -genkey -noout -out private-key.pem
99
100# Extract public key
101openssl ec -in private-key.pem -pubout -out public-key.pem
102
103# View private key (copy for .env)
104cat private-key.pem
105```
106
1074. Extract Public Key JWK
108```bash
109node -e "
110const fs = require('fs');
111const jose = require('jose');
112const pem = fs.readFileSync('public-key.pem', 'utf8');
113jose.importSPKI(pem, 'ES256').then(key => {
114 return jose.exportJWK(key);
115}).then(jwk => {
116 console.log(JSON.stringify(jwk, null, 2));
117});
118"
119```
120
1215. Update netlify/functions/jwks.ts
122
123 Replace `PUBLIC_JWK` with the output from step 4.
124
1256. Create .env
126
127```bash
128VITE_LOCAL_MOCK=false
129VITE_API_BASE=/.netlify/functions
130
131# Database (choose one)
132NETLIFY_DATABASE_URL=postgresql://user:pass@host/db # Neon
133# NETLIFY_DATABASE_URL=postgresql://localhost/atlast_dev # Local
134
135# OAuth (paste your private key)
136OAUTH_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nYOUR_KEY_HERE\n-----END PRIVATE KEY-----"
137
138# Local URLs (MUST use 127.0.0.1 for OAuth)
139URL=http://127.0.0.1:8888
140DEPLOY_URL=http://127.0.0.1:8888
141DEPLOY_PRIME_URL=http://127.0.0.1:8888
142CONTEXT=dev
143```
144
1457. Initialize Database
146```bash
147npm run init-db
148```
149
1508. Start Development Server
151```bash
152npm run dev:full
153```
154
1559. Test OAuth
156
157 1. Open `http://127.0.0.1:8888` (NOT localhost)
158 2. Enter your real Bluesky handle
159 3. Authorize the app
160 4. You should be redirected back and logged in
161
162---
163
164## Project Structure
165
166```
167atlast/
168├── src/
169│ ├── assets/ # Logo
170│ ├── components/ # UI components (React)
171│ ├── constants/ #
172│ ├── pages/ # Page components
173│ ├── hooks/ # Custom hooks
174│ ├── lib/
175│ │ ├── apiClient/ # API client (real + mock)
176│ │ ├── fileExtractor.ts # Chooses parser, handles file upload and data extraction
177│ │ ├── parserLogic.ts # Parses file for usernames
178│ │ ├── platformDefinitions.ts # File types and username locations
179│ │ └── config.ts # Environment config
180│ └── types/ # TypeScript types
181├── netlify/
182│ └── functions/ # Backend API
183└── public/ #
184```
185
186### UI Color System
187
188| **Element** | **Light Mode** | **Dark Mode** | **Notes** |
189|:---:|:---:|:---:|:---:|
190| Text Primary | purple-950 | cyan-50 | Headings, labels |
191| Text Secondary | purple-750 | cyan-250 | Body text, descriptions |
192| Text Tertiary | purple-600 | cyan-400 | Metadata, hints, icons |
193| Borders (Rest) | cyan-500/30 | purple-500/30 | Cards, inputs default |
194| Borders (Hover) | cyan-400 | purple-400 | Interactive hover |
195| Borders (Active/Selected) | cyan-500 | purple-500 | Active tabs, selected items |
196| Backgrounds (Primary) | white | slate-900 | Modal/card base |
197| Backgrounds (Secondary) | purple-50 | slate-900 (nested sections) | Nested cards, sections |
198| Backgrounds (Selected) | cyan-50 | purple-950/30 | Selected platform cards |
199| Buttons Primary | orange-600 | orange-600 | CTAs |
200| Buttons Primary Hover | orange-500 | orange-500 | CTA hover |
201| Buttons Secondary | slate-600 | slate-700 | Cancel, secondary actions |
202| Buttons Secondary Hover | slate-700 | slate-600 | Secondary hover |
203| Interactive Selected | bg-cyan-50 border-cyan-500 | bg-purple-950/30 border-purple-500 | Platform selection cards |
204| Accent/Badge | orange-500 | orange-500 (or amber-500) | Match counts, checkmarks, progress |
205| Progress Complete | orange-500 | orange-500 | Completed progress bars |
206| Progress Incomplete | cyan-500/30 | purple-500/30 | Incomplete progress bars |
207| Success/Green | green-100/800 | green-900/300 | Followed status |
208| Error/Red | red-600 | red-400 | Logout, errors |
209
210### UI Color System: Patterns
211**Disabled States**:
212- Light: Reduce opacity to 50%, use purple-500/50
213- Dark: Reduce opacity to 50%, use cyan-500/50
214
215**Success/Match indicators**:
216Both modes: amber-* or orange-* backgrounds with accessible text contrast
217
218**Tab Navigation**:
219- Inactive: Use text secondary colors
220- Active border: orange-500 (light), amber-500 (dark)
221- Active text: orange-650 (light), amber-400 (dark)
222
223**Gradient Banners**:
224- Both modes: from-amber-* via-orange-* to-pink-* (keep dramatic, adjust shades for mode)
225
226---
227
228## Task Workflows
229
230### Adding a New Social Platform
231
2321. Create `src/lib/platforms/yourplatform.ts`
2332. Implement parser following `tiktok.ts` or `instagram.ts`
2343. Register in `src/lib/platforms/registry.ts`
2354. Update `src/constants/platforms.ts`
2365. Test with real data file
237
238### Adding a New API Endpoint
239
2401. Create `netlify/functions/your-endpoint.ts`
2412. Add authentication check (copy from existing)
2423. Update `src/lib/apiClient/realApiClient.ts`
2434. Update `src/lib/apiClient/mockApiClient.ts`
2445. Use in components via `apiClient.yourMethod()`
245
246### Styling Changes
247
248- Use Tailwind utility classes
249- Follow dark mode pattern: `class="bg-white dark:bg-gray-800"`
250- Test in both light and dark modes
251- Mobile-first responsive design
252- Check accessibility (if implemented) is retained
253
254---
255
256## Submitting Changes
257
258### Before Submitting
259
260- [ ] Test in mock mode: `npm run dev:mock`
261- [ ] Test in full mode (if backend changes): `npm run dev:full`
262- [ ] Check both light and dark themes
263- [ ] Test mobile responsiveness
264- [ ] No console errors
265- [ ] Code follows existing patterns
266
267### Pull Request Process
268
2691. Fork the repository
2702. Create a feature branch: `git checkout -b feature/your-feature`
2713. Make your changes
2724. Commit with clear messages
2735. Push to your fork
2746. Open a Pull Request
275
276### PR Description Should Include
277
278- What changes were made
279- Why these changes are needed
280- Screenshots (for UI changes)
281- Testing steps
282- Related issues
283
284---
285
286## Resources
287
288- [AT Protocol Docs](https://atproto.com)
289- [Bluesky API](https://docs.bsky.app)
290- [React Documentation](https://react.dev)
291- [Tailwind CSS](https://tailwindcss.com)
292- [Netlify Functions](https://docs.netlify.com/functions/overview)
293
294---
295
296Thank you for contributing to ATlast!