A Next.js frontend for an online library platform where users can discover books, view book details, and manage their own uploaded books from a personal dashboard.
- Public home page with server-rendered book listing
- Single-book detail page with metadata and download action
- Authentication flow (register, login, logout)
- Protected dashboard for authenticated users
- Book management in dashboard:
- upload new books
- edit existing books
- delete books
- Persistent auth state using browser storage
- Next.js 16 (App Router)
- React 19
- TypeScript
- Tailwind CSS 4
- Lucide React icons
- Node.js 18+ (recommended: latest LTS)
- npm 9+
- Running eLib backend API
Create a .env file in the project root:
BACKEND_URL=http://localhost:5000/api/v1
NEXT_PUBLIC_BACKEND_URL=http://localhost:5000/api/v1Variable usage:
BACKEND_URL: used by server-side data fetching (home page book list)NEXT_PUBLIC_BACKEND_URL: used by client-side API calls (auth, dashboard CRUD, book details)
- Install dependencies:
npm install- Start the development server:
npm run devnpm run dev- run in development modenpm run build- create production buildnpm run start- start production servernpm run lint- run ESLint
src/
app/
(home)/ # Home page and public book list
book/[bookId]/ # Single book page
login/ # Login page
register/ # Registration page
dashboard/ # Protected user dashboard
components/ # Shared UI (navbar, footer, loading)
hooks/ # Custom hooks (auth state)
lib/ # API client helpers
types/ # Shared TypeScript types
The UI expects backend routes under:
/users/register/users/login/books/books/:bookId
Authenticated routes use a bearer token stored in localStorage as authToken.
Add screenshots to public/screenshots and reference them here:


Suggested capture list:
- Home page (book grid)
- Login / Register pages
- Single book details page
- Dashboard (book list)
- Upload and Edit book modals
- The app depends on both server-side and client-side API access:
- server components use
BACKEND_URL - client components use
NEXT_PUBLIC_BACKEND_URL
- server components use
- If books are not loading on home page, verify the backend is reachable from server-side rendering context.
- If login/dashboard actions fail, confirm browser-accessible
NEXT_PUBLIC_BACKEND_URLis correct. - Auth token is stored in
localStorageand sent asAuthorization: Bearer <token>for protected book routes. - For production, configure CORS on the backend to allow your deployed frontend domain.
Contributions are welcome.
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m "feat: add your feature") - Push your branch (
git push origin feature/your-feature) - Open a pull request
Please keep changes focused, run lint locally, and include clear PR descriptions.
This project is licensed under the MIT License. See the LICENSE file for details.
Deploy this app to Vercel or any Node-compatible hosting provider.
For production, make sure both BACKEND_URL and NEXT_PUBLIC_BACKEND_URL point to your deployed backend API.