|
1 | | -albdev.al |
2 | | -========= |
| 1 | +# AlbDev - Albanian Developer Community |
3 | 2 |
|
4 | | -Official Web Site |
| 3 | +A Reddit-like platform for Albanian developers built with Nuxt 4, Nuxt UI 4, Firebase, and PostgreSQL. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- 🔥 **Nuxt 4** - Latest version with enhanced performance |
| 8 | +- 🎨 **Nuxt UI 4** - Beautiful, accessible components |
| 9 | +- 🔐 **Firebase Authentication** - Secure user authentication |
| 10 | +- 💾 **PostgreSQL** - Robust relational database with Drizzle ORM |
| 11 | +- 🚀 **Firebase Hosting** - Serverless deployment |
| 12 | +- 📱 **Responsive Design** - Works on all devices |
| 13 | +- ⚡ **Real-time Features** - Live updates and interactions |
| 14 | + |
| 15 | +## Reddit-like Features |
| 16 | + |
| 17 | +- Create and join communities |
| 18 | +- Post text, links, and images |
| 19 | +- Upvote/downvote system |
| 20 | +- Nested comments |
| 21 | +- User profiles with karma |
| 22 | +- Community moderation |
| 23 | +- Feed sorting (hot, new, top) |
| 24 | + |
| 25 | +## Setup |
| 26 | + |
| 27 | +### Prerequisites |
| 28 | + |
| 29 | +- Node.js 18+ and npm |
| 30 | +- Firebase project |
| 31 | +- PostgreSQL database (Cloud SQL or other) |
| 32 | + |
| 33 | +### Environment Variables |
| 34 | + |
| 35 | +Create a `.env` file with: |
| 36 | + |
| 37 | +```env |
| 38 | +# Firebase Client Config |
| 39 | +NUXT_PUBLIC_FIREBASE_API_KEY=your_api_key |
| 40 | +NUXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_auth_domain |
| 41 | +NUXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id |
| 42 | +NUXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_storage_bucket |
| 43 | +NUXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id |
| 44 | +NUXT_PUBLIC_FIREBASE_APP_ID=your_app_id |
| 45 | +
|
| 46 | +# Firebase Admin (Server-side) |
| 47 | +FIREBASE_PRIVATE_KEY=your_private_key |
| 48 | +FIREBASE_CLIENT_EMAIL=your_client_email |
| 49 | +
|
| 50 | +# Database |
| 51 | +DATABASE_URL=postgresql://user:password@host:port/database |
| 52 | +
|
| 53 | +# Session |
| 54 | +SESSION_SECRET=your_session_secret_min_32_chars |
| 55 | +``` |
| 56 | + |
| 57 | +### Installation |
| 58 | + |
| 59 | +```bash |
| 60 | +# Install dependencies |
| 61 | +npm install |
| 62 | + |
| 63 | +# Generate database migrations |
| 64 | +npm run db:generate |
| 65 | + |
| 66 | +# Run migrations |
| 67 | +npm run db:migrate |
| 68 | + |
| 69 | +# Start development server |
| 70 | +npm run dev |
| 71 | +``` |
| 72 | + |
| 73 | +### Database Setup |
| 74 | + |
| 75 | +The project uses Drizzle ORM with PostgreSQL. Run migrations to set up the schema: |
| 76 | + |
| 77 | +```bash |
| 78 | +npm run db:push |
| 79 | +``` |
| 80 | + |
| 81 | +To view your database in Drizzle Studio: |
| 82 | + |
| 83 | +```bash |
| 84 | +npm run db:studio |
| 85 | +``` |
| 86 | + |
| 87 | +## Deployment |
| 88 | + |
| 89 | +### Firebase Deployment |
| 90 | + |
| 91 | +```bash |
| 92 | +# Build for production |
| 93 | +npm run build |
| 94 | + |
| 95 | +# Deploy to Firebase |
| 96 | +firebase deploy |
| 97 | +``` |
| 98 | + |
| 99 | +### Required Firebase Services |
| 100 | + |
| 101 | +1. **Authentication** - Enable Email/Password provider |
| 102 | +2. **Cloud Functions** - For server-side rendering |
| 103 | +3. **Hosting** - For static assets |
| 104 | +4. **Storage** (optional) - For image uploads |
| 105 | + |
| 106 | +### Cloud SQL Setup |
| 107 | + |
| 108 | +1. Create a Cloud SQL PostgreSQL instance |
| 109 | +2. Create a database |
| 110 | +3. Add connection string to `.env` |
| 111 | +4. Run migrations |
| 112 | + |
| 113 | +## Project Structure |
| 114 | + |
| 115 | +``` |
| 116 | +├── components/ # Vue components |
| 117 | +├── composables/ # Composable functions |
| 118 | +├── layouts/ # App layouts |
| 119 | +├── middleware/ # Route middleware |
| 120 | +├── pages/ # App pages/routes |
| 121 | +├── plugins/ # Nuxt plugins |
| 122 | +├── server/ # Server-side code |
| 123 | +│ ├── api/ # API endpoints |
| 124 | +│ ├── database/ # Database schema |
| 125 | +│ ├── middleware/ # Server middleware |
| 126 | +│ └── utils/ # Server utilities |
| 127 | +├── drizzle.config.ts # Drizzle ORM config |
| 128 | +├── nuxt.config.ts # Nuxt configuration |
| 129 | +└── firebase.json # Firebase config |
| 130 | +``` |
| 131 | + |
| 132 | +## Development |
| 133 | + |
| 134 | +```bash |
| 135 | +# Run dev server |
| 136 | +npm run dev |
| 137 | + |
| 138 | +# Type checking |
| 139 | +npm run typecheck |
| 140 | + |
| 141 | +# Lint code |
| 142 | +npm run lint |
| 143 | + |
| 144 | +# Generate types |
| 145 | +npm run postinstall |
| 146 | +``` |
| 147 | + |
| 148 | +## Tech Stack |
| 149 | + |
| 150 | +- **Framework**: Nuxt 4 |
| 151 | +- **UI Library**: Nuxt UI 4 (Tailwind CSS) |
| 152 | +- **Authentication**: Firebase Auth |
| 153 | +- **Database**: PostgreSQL with Drizzle ORM |
| 154 | +- **Hosting**: Firebase Hosting + Cloud Functions |
| 155 | +- **Language**: TypeScript |
| 156 | + |
| 157 | +## License |
| 158 | + |
| 159 | +MIT |
0 commit comments