|
| 1 | +# Ensemble Web |
| 2 | + |
| 3 | +[](https://github.com/holtschn/ensemble-web/actions/workflows/test.yml) |
| 4 | +[](LICENSE) |
| 5 | + |
| 6 | +A modern web application for brass ensemble management, featuring a public website and an internal "Notendatenbank" (sheet music database) system. |
| 7 | + |
| 8 | +## Features |
| 9 | + |
| 10 | +- 🎵 **Notendatenbank (NDB)** - Comprehensive sheet music management system |
| 11 | + - Score catalog with metadata (composer, arranger, instrumentation, difficulty) |
| 12 | + - File management (parts, full scores, audio samples) |
| 13 | + - Advanced filtering and column configuration |
| 14 | + - Setlist creation and management |
| 15 | + - Player allocations for performances |
| 16 | +- 📄 **Content Management** - Dynamic pages and content via PayloadCMS |
| 17 | +- 🔐 **Authentication** - User management and role-based access control |
| 18 | +- 📅 **Event Management** - Calendar and event information |
| 19 | +- 📱 **Responsive Design** - Mobile-first, fully responsive UI |
| 20 | +- ⚡ **Performance Optimized** - Server-side caching and static generation |
| 21 | + |
| 22 | +## Tech Stack |
| 23 | + |
| 24 | +- **Frontend:** [Next.js 15](https://nextjs.org/) (App Router) + [React 19](https://react.dev/) |
| 25 | +- **CMS:** [PayloadCMS 3](https://payloadcms.com/) |
| 26 | +- **Database:** [PostgreSQL](https://www.postgresql.org/) |
| 27 | +- **Styling:** [TailwindCSS 4](https://tailwindcss.com/) |
| 28 | +- **Storage:** [Vercel Blob Storage](https://vercel.com/docs/storage/vercel-blob) |
| 29 | +- **Email:** [Nodemailer](https://nodemailer.com/) |
| 30 | +- **Testing:** [Jest](https://jestjs.io/) + [React Testing Library](https://testing-library.com/react) + [MSW](https://mswjs.io/) |
| 31 | + |
| 32 | +## Prerequisites |
| 33 | + |
| 34 | +- **Node.js** 20.x or higher |
| 35 | +- **PostgreSQL** database |
| 36 | +- **npm** or **yarn** package manager |
| 37 | + |
| 38 | +## Installation |
| 39 | + |
| 40 | +1. **Clone the repository** |
| 41 | + |
| 42 | + ```bash |
| 43 | + git clone https://github.com/holtschn/ensemble-web.git |
| 44 | + cd ensemble-web |
| 45 | + ``` |
| 46 | + |
| 47 | +2. **Install dependencies** |
| 48 | + |
| 49 | + ```bash |
| 50 | + npm install |
| 51 | + ``` |
| 52 | + |
| 53 | +3. **Set up environment variables** |
| 54 | + |
| 55 | + Copy the example environment file and configure it: |
| 56 | + |
| 57 | + ```bash |
| 58 | + cp .env.example .env.local |
| 59 | + ``` |
| 60 | + |
| 61 | + Key environment variables to configure: |
| 62 | + |
| 63 | + - `POSTGRES_URL` - PostgreSQL connection string |
| 64 | + - `POSTGRES_SCHEMA` - Database schema name |
| 65 | + - `PAYLOAD_SECRET` - Secret for PayloadCMS sessions |
| 66 | + - `NDB_API_URL` - External NDB API base URL |
| 67 | + - `NDB_USERNAME` / `NDB_PASSWORD` - NDB API credentials |
| 68 | + - `BLOB_READ_WRITE_TOKEN` - Vercel Blob Storage token |
| 69 | + - `NODEMAILER_HOST` / `NODEMAILER_USER` / `NODEMAILER_PASS` - Email configuration |
| 70 | + |
| 71 | + See [`.env.example`](.env.example) for the complete list of required variables. |
| 72 | + |
| 73 | +4. **Run database migrations** (if needed) |
| 74 | + |
| 75 | + ```bash |
| 76 | + npm run payload migrate |
| 77 | + ``` |
| 78 | + |
| 79 | +5. **Generate TypeScript types** |
| 80 | + |
| 81 | + ```bash |
| 82 | + npm run generate:types |
| 83 | + ``` |
| 84 | + |
| 85 | +## Development |
| 86 | + |
| 87 | +Start the development server: |
| 88 | + |
| 89 | +```bash |
| 90 | +npm run dev |
| 91 | +``` |
| 92 | + |
| 93 | +The application will be available at: |
| 94 | +- **Main site:** http://localhost:3000 |
| 95 | +- **PayloadCMS admin:** http://localhost:3000/admin |
| 96 | + |
| 97 | +### Other Development Commands |
| 98 | + |
| 99 | +```bash |
| 100 | +# Development with cache clearing |
| 101 | +npm run devsafe |
| 102 | + |
| 103 | +# Code quality |
| 104 | +npm run lint # Run ESLint |
| 105 | +npm run format # Format code with Prettier |
| 106 | + |
| 107 | +# Build for production |
| 108 | +npm run build |
| 109 | + |
| 110 | +# Start production server |
| 111 | +npm start |
| 112 | +``` |
| 113 | + |
| 114 | +## Testing |
| 115 | + |
| 116 | +The project uses Jest with React Testing Library and MSW for API mocking. |
| 117 | + |
| 118 | +```bash |
| 119 | +# Run all tests |
| 120 | +npm test |
| 121 | + |
| 122 | +# Run tests in watch mode |
| 123 | +npm run test:watch |
| 124 | + |
| 125 | +# Run tests with coverage |
| 126 | +npm run test:coverage |
| 127 | + |
| 128 | +# Run NDB-specific tests |
| 129 | +npm run test:ndb |
| 130 | + |
| 131 | +# Run tests in CI mode |
| 132 | +npm run test:ci |
| 133 | +``` |
| 134 | + |
| 135 | +Current test coverage: |
| 136 | +- **162 tests** across 9 test suites |
| 137 | +- Comprehensive coverage of NDB utilities and components |
| 138 | +- MSW handlers for all API endpoints |
| 139 | + |
| 140 | +## Project Structure |
| 141 | + |
| 142 | +``` |
| 143 | +. |
| 144 | +├── src/ |
| 145 | +│ ├── app/ # Next.js App Router |
| 146 | +│ │ ├── (pages)/ # Public pages group |
| 147 | +│ │ │ ├── intern/ndb/ # Internal sheet music database |
| 148 | +│ │ │ └── api/ # API routes |
| 149 | +│ │ └── (payload)/ # PayloadCMS admin group |
| 150 | +│ │ |
| 151 | +│ ├── next/ # Next.js-specific code |
| 152 | +│ │ ├── ndb/ # Notendatenbank module |
| 153 | +│ │ │ ├── api/ # API client and proxy |
| 154 | +│ │ │ ├── components/ # UI components |
| 155 | +│ │ │ ├── hooks/ # React hooks |
| 156 | +│ │ │ └── utils/ # Utility functions |
| 157 | +│ │ ├── auth/ # Authentication |
| 158 | +│ │ └── components/ # Shared components |
| 159 | +│ │ |
| 160 | +│ └── payload/ # PayloadCMS configuration |
| 161 | +│ ├── collections/ # Data collections |
| 162 | +│ └── globals/ # Global configs |
| 163 | +│ |
| 164 | +├── old.gui/ # Legacy reference code (READ-ONLY) |
| 165 | +└── .github/workflows/ # CI/CD workflows |
| 166 | +``` |
| 167 | + |
| 168 | +## Deployment |
| 169 | + |
| 170 | +This application is designed to be deployed on [Vercel](https://vercel.com/): |
| 171 | + |
| 172 | +1. **Connect your repository** to Vercel |
| 173 | +2. **Configure environment variables** in Vercel dashboard |
| 174 | +3. **Deploy** - Vercel will automatically build and deploy |
| 175 | + |
| 176 | +### Build Command |
| 177 | +```bash |
| 178 | +npm run build |
| 179 | +``` |
| 180 | + |
| 181 | +### Environment Variables |
| 182 | +Ensure all variables from `.env.example` are configured in your Vercel project settings. |
| 183 | + |
| 184 | +## PayloadCMS |
| 185 | + |
| 186 | +Access the PayloadCMS admin panel at `/admin` to manage: |
| 187 | +- Users and authentication |
| 188 | +- Media files |
| 189 | +- Pages and content |
| 190 | +- Events |
| 191 | +- Site settings (header, footer) |
| 192 | + |
| 193 | +### Generate Types |
| 194 | + |
| 195 | +After modifying PayloadCMS collections or globals: |
| 196 | + |
| 197 | +```bash |
| 198 | +npm run generate:types |
| 199 | +``` |
| 200 | + |
| 201 | +This updates `src/payload-types.ts` with TypeScript type definitions. |
| 202 | + |
| 203 | +## Contributing |
| 204 | + |
| 205 | +For development guidance and architectural decisions, see [CLAUDE.md](CLAUDE.md). |
| 206 | + |
| 207 | +### Development Workflow |
| 208 | + |
| 209 | +1. Check the roadmap in [CLAUDE.md](CLAUDE.md) |
| 210 | +2. Create a feature branch from `develop` |
| 211 | +3. Implement changes with tests |
| 212 | +4. Run tests and linting |
| 213 | +5. Submit a pull request to `develop` |
| 214 | + |
| 215 | +## License |
| 216 | + |
| 217 | +This project is licensed under the **GNU General Public License v3.0** - see the [LICENSE](LICENSE) file for details. |
| 218 | + |
| 219 | +## Architecture Notes |
| 220 | + |
| 221 | +- **API Proxy Pattern:** All NDB API calls go through Next.js API routes for security (Basic Auth credentials hidden server-side) |
| 222 | +- **Server Components:** Leverages Next.js 15 Server Components for performance and SEO |
| 223 | +- **Data Cache:** Built-in caching with tag-based revalidation |
| 224 | +- **User Preferences:** Hybrid storage with Payload Preferences API + localStorage |
| 225 | + |
| 226 | +For detailed architecture documentation, see [CLAUDE.md](CLAUDE.md). |
| 227 | + |
| 228 | +## Known Issues |
| 229 | + |
| 230 | +See [CLAUDE.md - Known Issues](CLAUDE.md#known-issues) for current issues and planned fixes. |
| 231 | + |
| 232 | +## Support |
| 233 | + |
| 234 | +For bugs and feature requests, please [open an issue](https://github.com/holtschn/ensemble-web/issues). |
0 commit comments