Skip to content

Commit 8a32d87

Browse files
committed
moved readme to separate docs
1 parent a9744dd commit 8a32d87

File tree

6 files changed

+306
-0
lines changed

6 files changed

+306
-0
lines changed

docs/CONTRIBUTING.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Contributing
2+
3+
Thanks for wanting to contribute to Cinema Plot. This guide explains how to contribute and what we expect.
4+
5+
Workflow
6+
7+
1. Fork the repository
8+
2. Create a feature branch
9+
10+
```bash
11+
git checkout -b feature/your-feature
12+
```
13+
14+
3. Make changes, run tests and linters
15+
4. Commit and push
16+
17+
```bash
18+
git add .
19+
git commit -m "Describe change"
20+
git push origin feature/your-feature
21+
```
22+
23+
5. Open a Pull Request
24+
25+
Guidelines
26+
27+
- Follow Next.js and React best practices with TypeScript.
28+
- Keep changes small and focused.
29+
- Add tests for new functionality.
30+
- Run `npm run lint` and `npm run type-check`.
31+
- Use the Context API pattern for global state when appropriate.
32+
33+
Support
34+
35+
- Create an issue for larger discussions or proposals.
36+
- Use PRs for code changes and assign reviewers.

docs/DEPLOYMENT.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Deployment
2+
3+
This project can be deployed to Vercel, Firebase Hosting, or Netlify.
4+
5+
Vercel (recommended)
6+
7+
1. Push your repo to GitHub
8+
2. Import the repo into Vercel
9+
3. Add the environment variables in the Vercel dashboard
10+
4. Deploy (Vercel will build automatically)
11+
12+
Firebase Hosting
13+
14+
1. Install Firebase CLI:
15+
16+
```bash
17+
npm install -g firebase-tools
18+
```
19+
20+
2. Login and initialize hosting:
21+
22+
```bash
23+
firebase login
24+
firebase init hosting
25+
```
26+
27+
3. Build and deploy:
28+
29+
```bash
30+
npm run build
31+
firebase deploy
32+
```
33+
34+
Netlify
35+
36+
- Build the project with `npm run build` and deploy the output as appropriate (drag-and-drop or Netlify CLI).
37+
38+
Environment variables
39+
40+
Ensure these variables are present in your hosting provider:
41+
42+
- `NEXT_PUBLIC_FIREBASE_API_KEY`
43+
- `NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN`
44+
- `NEXT_PUBLIC_FIREBASE_PROJECT_ID`
45+
- `NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET`
46+
- `NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID`
47+
- `NEXT_PUBLIC_FIREBASE_APP_ID`
48+
- `NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID`

docs/DEVELOPMENT.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Development & Local Run
2+
3+
This document covers how to run and develop the application locally.
4+
5+
Available scripts
6+
7+
- `npm run dev` - Start development server
8+
- `npm run build` - Build production bundle
9+
- `npm run start` - Start production server
10+
- `npm run lint` - Run ESLint
11+
- `npm run type-check` - Run TypeScript type checking
12+
13+
Run development server
14+
15+
```bash
16+
npm run dev
17+
# or
18+
# yarn dev
19+
# or
20+
# pnpm dev
21+
```
22+
23+
Open http://localhost:3000
24+
25+
Project layout
26+
27+
- `app/` - Next.js App Router (pages & routes)
28+
- `components/` - Reusable React components
29+
- `lib/` - Utilities, Firebase setup, helpers
30+
- `public/` - Static assets
31+
- `styles/` - Global styles
32+
33+
Tips
34+
35+
- Keep `.env.local` out of commits. Use `.env.example` as a template.
36+
- Use the Firebase emulators for safe local testing of authentication and Firestore.
37+
- Run `npm run lint` and `npm run type-check` before opening PRs.
38+
39+
Quick contract of key modules
40+
41+
- `lib/firebase.ts` — initializes Firebase client
42+
- `lib/firebase-admin.ts` — server/admin utilities (if used in functions)
43+
- `lib/auth-context.tsx` — React Context for auth state
44+
45+
Edge cases to consider while developing
46+
47+
- Missing or invalid environment variables
48+
- Unavailable Firebase services during local dev
49+
- Timezone differences for event dates
50+
- Mobile/responsive breakpoints
51+
52+
Small improvements included in repo
53+
54+
- Pre-configured ESLint and TypeScript
55+
- Jest and Playwright configs for tests
56+
57+
What's next
58+
59+
- See `docs/TESTING.md` for tests and `docs/DEPLOYMENT.md` for deployment instructions.

docs/INSTALLATION.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Installation & Firebase setup
2+
3+
This document explains how to get the project running locally and how to configure Firebase.
4+
5+
Prerequisites
6+
- Node.js (version 18 or higher)
7+
- npm, yarn, or pnpm package manager
8+
- Firebase project with Firestore, Authentication, and Storage enabled
9+
10+
Clone the repository
11+
12+
```bash
13+
git clone https://github.com/xkmato/cinemaplot.git
14+
cd cinemaplot
15+
```
16+
17+
Install dependencies
18+
19+
```bash
20+
npm install
21+
# or
22+
# yarn install
23+
# or
24+
# pnpm install
25+
```
26+
27+
Environment variables
28+
29+
Copy the example environment file and update with your Firebase credentials:
30+
31+
```bash
32+
cp .env.example .env.local
33+
```
34+
35+
Update `.env.local` with your Firebase configuration (values from your Firebase console):
36+
37+
```
38+
NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key
39+
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
40+
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
41+
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.firebasestorage.app
42+
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
43+
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
44+
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=your_measurement_id
45+
```
46+
47+
Firebase configuration checklist
48+
49+
- Create a new Firebase project at https://console.firebase.google.com
50+
- Enable Authentication with Google and Email Link providers
51+
- Enable Firestore Database
52+
- Enable Storage
53+
- (Optional) Enable Analytics
54+
55+
Firestore rules (example)
56+
57+
```javascript
58+
rules_version = '2';
59+
service cloud.firestore {
60+
match /databases/{database}/documents {
61+
match /events/{eventId} {
62+
allow read: if true;
63+
allow write: if request.auth != null;
64+
}
65+
match /users/{userId} {
66+
allow read, write: if request.auth != null && request.auth.uid == userId;
67+
}
68+
}
69+
}
70+
```
71+
72+
Storage rules (example)
73+
74+
```javascript
75+
rules_version = '2';
76+
service firebase.storage {
77+
match /b/{bucket}/o {
78+
match /event-images/{allPaths=**} {
79+
allow read: if true;
80+
allow write: if request.auth != null;
81+
}
82+
}
83+
}
84+
```
85+
86+
Local emulators (optional)
87+
88+
If you'd like to work against Firebase emulators rather than production:
89+
90+
1. Install Firebase CLI:
91+
92+
```bash
93+
npm install -g firebase-tools
94+
```
95+
96+
2. Login:
97+
98+
```bash
99+
firebase login
100+
```
101+
102+
3. Start emulators:
103+
104+
```bash
105+
firebase emulators:start
106+
```
107+
108+
This will run local emulators for Firestore, Authentication, Storage, and Functions (if configured).

docs/TECH_STACK.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Overview & Tech Stack
2+
3+
Cinema Plot is built with modern web technologies to provide a fast, type-safe developer experience.
4+
5+
Frontend
6+
7+
- Next.js (App Router)
8+
- React 19 + TypeScript
9+
- Tailwind CSS and shadcn/ui for components
10+
11+
Backend
12+
13+
- Firebase (Firestore, Auth, Storage)
14+
- Mailgun for transactional email (notification emails)
15+
16+
Testing & Tooling
17+
18+
- Jest for unit tests
19+
- Playwright for end-to-end tests
20+
- ESLint and TypeScript for code quality
21+
22+
Project structure
23+
24+
See repository top-level directories (`app/`, `components/`, `lib/`, `__tests__/`, etc.) for details.
25+
26+
Notes
27+
28+
- Use the `docs/` folder for operational and contributor-facing documentation.
29+
- Keep `README.md` concise and link to the docs for details.

docs/TESTING.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Testing
2+
3+
This project uses Jest for unit/integration tests and Playwright for end-to-end tests.
4+
5+
Jest
6+
7+
- `npm test` - Run unit tests
8+
- `npm run test:watch` - Run tests in watch mode
9+
- `npm run test:coverage` - Generate coverage report
10+
11+
Playwright
12+
13+
- `npm run test:e2e` - Run E2E tests headless
14+
- `npm run test:e2e:ui` - Run Playwright in headed interactive mode
15+
16+
Notes
17+
18+
- Tests and test utilities live under `__tests__/`
19+
- Use the provided `jest.setup.ts` and `jest.setup.js` for mocks and DOM setup
20+
- Playwright configuration is at `playwright.config.ts`
21+
22+
Quick checklist for test runs
23+
24+
- Ensure environment variables required by tests are set
25+
- Prefer Firebase emulators for tests that touch Firestore/Auth
26+
- Run `npm run test:coverage` to verify thresholds before merging

0 commit comments

Comments
 (0)