Skip to content

Commit e554891

Browse files
authored
Merge branch 'main' into scripture-encouragement
2 parents 5e93d9e + 1b0cdd4 commit e554891

File tree

9 files changed

+386
-99
lines changed

9 files changed

+386
-99
lines changed

.github/workflows/greetings.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Greetings
2+
3+
on: [pull_request_target, issues]
4+
5+
jobs:
6+
greeting:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
issues: write
10+
pull-requests: write
11+
steps:
12+
- uses: actions/first-interaction@v1
13+
with:
14+
repo-token: ${{ secrets.GITHUB_TOKEN }}
15+
issue-message: "Welcome to the repo! Thanks for stopping by 🚀🚀🚀"
16+
pr-message: "Almost at your first merged PR here! Super exciting 🥳🥳🥳"

README.md

Lines changed: 129 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,132 @@
1+
2+
13
# PurePath
24

3-
This project is built with .
5+
PurePath is a web application designed to help users break free from unwanted habits like PMO and build a life of purpose through community support, guided meditations, and progress tracking.
6+
7+
8+
9+
## Tech Stack
10+
11+
This project is built with modern web technologies:
12+
13+
- [Vite](https://vitejs.dev/) - Fast, opinionated frontend build tool
14+
- [React](https://reactjs.org/) - UI component library
15+
- [TypeScript](https://www.typescriptlang.org/) - Type-safe JavaScript
16+
- [React Router](https://reactrouter.com/) - Client-side routing
17+
- [Tailwind CSS](https://tailwindcss.com/) - Utility-first CSS framework
18+
- [shadcn/ui](https://ui.shadcn.com/) - Accessible UI components
19+
- [Firebase](https://firebase.google.com/) - Authentication and backend services
20+
- [Framer Motion](https://www.framer.com/motion/) - Animation library
21+
- [Tanstack Query](https://tanstack.com/query) - Data fetching and state management
22+
- [Recharts](https://recharts.org/) - Composable charting library
23+
24+
## Features
25+
26+
- 🔒 **Secure Authentication**: User account creation and login
27+
- 📊 **Progress Analytics**: Track your journey with visual analytics
28+
- 🧘 **Guided Meditations**: Access specialized meditations
29+
- 🆘 **Emergency Support**: Panic button for immediate help
30+
- 🌍 **Global Community**: Connect with others on the same journey
31+
- 🔐 **Privacy-Focused**: All data is private and anonymized
32+
33+
## Getting Started
34+
35+
### Prerequisites
36+
37+
- Node.js (v16 or higher)
38+
- npm, yarn, or pnpm
39+
40+
### Installation
41+
42+
1. Clone the repository:
43+
```bash
44+
git clone https://github.com/yourusername/purepath.git
45+
cd purepath
46+
```
47+
48+
2. Install dependencies:
49+
```bash
50+
npm install
51+
# or
52+
yarn install
53+
# or
54+
pnpm install
55+
```
56+
57+
3. Configure Firebase:
58+
- Create a Firebase project at [Firebase Console](https://console.firebase.google.com/)
59+
- Enable Authentication and Firestore
60+
- Create a web app in your Firebase project
61+
- Copy the configuration values from your Firebase project settings
62+
63+
4. Create a `.env` file in the root directory with your Firebase configuration:
64+
```
65+
VITE_FIREBASE_API_KEY=your-firebase-api-key
66+
VITE_FIREBASE_AUTH_DOMAIN=your-firebase-auth-domain
67+
VITE_FIREBASE_PROJECT_ID=your-firebase-project-id
68+
VITE_FIREBASE_STORAGE_BUCKET=your-firebase-storage-bucket
69+
VITE_FIREBASE_MESSAGING_SENDER_ID=your-firebase-messaging-sender-id
70+
VITE_FIREBASE_APP_ID=your-firebase-app-id
71+
VITE_FIREBASE_MEASUREMENT_ID=your-firebase-measurement-id
72+
```
73+
74+
You can use the `.env.sample` file as a template.
75+
**Note: Enable email/pwd authentication in your firebase console.**
76+
77+
6. Start the development server:
78+
```bash
79+
npm run dev
80+
# or
81+
yarn dev
82+
# or
83+
pnpm dev
84+
```
85+
86+
7. Open your browser and navigate to `http://localhost:8080`
87+
88+
### Building for Production
89+
90+
```bash
91+
npm run build
92+
# or
93+
yarn build
94+
# or
95+
pnpm build
96+
```
97+
98+
## Project Structure
99+
100+
```
101+
purepath/
102+
├── public/ # Static assets
103+
├── src/
104+
│ ├── components/ # Reusable UI components
105+
│ │ └── ui/ # shadcn/ui components
106+
│ ├── hooks/ # Custom React hooks
107+
│ ├── lib/ # Utility functions
108+
│ ├── pages/ # Page components
109+
│ ├── utils/ # Helper functions and Firebase setup
110+
│ ├── App.tsx # Main App component with routing
111+
│ └── main.tsx # Entry point
112+
├── .env.sample # Sample environment variables
113+
└── README.md # Project documentation
114+
```
115+
116+
## Authentication
117+
118+
This application uses Firebase Authentication for user management. Users can:
119+
- Register with email and password
120+
- Log in with existing credentials
121+
- Access protected routes (dashboard, profile, etc.)
122+
- Admin users have access to additional
123+
124+
## Contributing
125+
126+
Contributions are welcome! Please feel free to submit a Pull Request.
4127

5-
- Vite
6-
- TypeScript
7-
- React
8-
- shadcn-ui
9-
- Tailwind CSS
128+
1. Fork the repository
129+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
130+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
131+
4. Push to the branch (`git push origin feature/amazing-feature`)
132+
5. Open a Pull Request

src/App.tsx

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
21
import { Toaster } from "@/components/ui/toaster";
32
import { Toaster as Sonner } from "@/components/ui/sonner";
43
import { TooltipProvider } from "@/components/ui/tooltip";
54
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
6-
import { BrowserRouter, Routes, Route, Navigate } from "react-router-dom";
5+
import { BrowserRouter, Routes, Route } from "react-router-dom";
76
import { AuthProvider } from "./utils/auth";
87
import AuthWrapper from "./components/AuthWrapper";
98

@@ -41,74 +40,74 @@ const App = () => (
4140
<Route path="/register" element={<Register />} />
4241

4342
{/* Protected member routes */}
44-
<Route
45-
path="/dashboard"
43+
<Route
44+
path="/dashboard"
4645
element={
4746
<AuthWrapper requireAuth>
4847
<Dashboard />
4948
</AuthWrapper>
50-
}
49+
}
5150
/>
52-
<Route
53-
path="/profile"
51+
<Route
52+
path="/profile"
5453
element={
5554
<AuthWrapper requireAuth>
5655
<Profile />
5756
</AuthWrapper>
58-
}
57+
}
5958
/>
60-
<Route
61-
path="/community"
59+
<Route
60+
path="/community"
6261
element={
6362
<AuthWrapper requireAuth>
6463
<Community />
6564
</AuthWrapper>
66-
}
65+
}
6766
/>
68-
<Route
69-
path="/meditations"
67+
<Route
68+
path="/meditations"
7069
element={
7170
<AuthWrapper requireAuth>
7271
<Meditations />
7372
</AuthWrapper>
74-
}
73+
}
7574
/>
76-
<Route
77-
path="/analytics"
75+
<Route
76+
path="/analytics"
7877
element={
7978
<AuthWrapper requireAuth>
8079
<Analytics />
8180
</AuthWrapper>
82-
}
81+
}
8382
/>
84-
<Route
85-
path="/map"
83+
<Route
84+
path="/map"
8685
element={
8786
<AuthWrapper requireAuth>
8887
<Map />
8988
</AuthWrapper>
90-
}
89+
}
9190
/>
9291

9392
{/* Admin routes */}
94-
<Route
95-
path="/admin"
93+
<Route
94+
path="/admin"
9695
element={
9796
<AuthWrapper requireAuth requireAdmin>
9897
<Admin />
9998
</AuthWrapper>
100-
}
99+
}
101100
/>
102101

103-
<Route
104-
path="/goodbye"
102+
<Route
103+
path="/goodbye"
105104
element={
106105
<AuthWrapper requireAuth>
107106
<Goodbye />
108107
</AuthWrapper>
109-
}
108+
}
110109
/>
111-
110+
112111
{/* Catch-all route */}
113112
<Route path="*" element={<NotFound />} />
114113
</Routes>
@@ -120,4 +119,4 @@ const App = () => (
120119
</QueryClientProvider>
121120
);
122121

123-
export default App;
122+
export default App;

src/components/AuthWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const AuthWrapper: React.FC<AuthWrapperProps> = ({
3939

4040
// Check admin role
4141
if (requireAdmin && !isAdmin) {
42-
return <Navigate to="/dashboard" replace />;
42+
return <Navigate to="/unauthorized" replace />;
4343
}
4444

4545
return <>{children}</>;

0 commit comments

Comments
 (0)