Skip to content

Latest commit

 

History

History
46 lines (29 loc) · 1.48 KB

README.md

File metadata and controls

46 lines (29 loc) · 1.48 KB

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Inter, a custom Google Font.

Routes:

/ : Home (Hero, Buy Book and Magazines option)
/emagazines : All the magazines (descending order of created at)
/ebooks : All books
/dashboard : All books accessible by user
/dashboard/read : Reading Page.

API Routes:

/api/get-all-books : Fetching All Books
/api/get-all-mags : Fetching All Magazines
/api/book?bookId=XYZ : Fetching a Single Book
/api/mag?magId=XYZ: Fetching a Single Magazine
/api/add-to-dashboard?userId=XYZ&bookId=PQR : Adding a book/magazine to dashboard after purchasing.
/api/get-user-dashboard?userId=XYZ : Fetching user dashboard (accessible books).
/api/check-access : Checking if user has access to a book/magazine.

DB Models:

Book Schema:

{title, author, description, price fileLocation, coverImage. isbn, createdAt}

Magazine Schema:

{title, description, price, fileLocation, coverImage. issn, createdAt}

Razorpay