A modern library application for sharing and discovering books.
LibraShare is a full-stack web application built with Next.js and Express that enables users to browse, share, and manage book collections. Connect with other book enthusiasts and build your personal library.
- Book Discovery - Browse and search a collection of shared books
- User Authentication - Secure sign-up and login functionality
- Book Management - Add, edit, and manage your personal book collection
- Social Sharing - Share your favorite books with the community
- Modern UI - Clean, responsive interface built with Next.js and Tailwind CSS
- Real-time Updates - Instant synchronization with the backend
- Next.js - React framework for production applications
- JavaScript (ES6+) - Core frontend language
- Tailwind CSS - Utility-first CSS framework
- React - UI library for building interactive components
- Node.js - JavaScript runtime
- Express.js - Web application framework
- MongoDB - NoSQL database for data persistence
- CORS - Cross-origin resource sharing for frontend-backend communication
LibraShare/
├── frontend/ # Next.js frontend application
│ ├── app/
│ │ ├── components/ # Reusable React components
│ │ │ └── Header.js # Main header component
│ │ ├── styles/ # Global stylesheets
│ │ │ └── globals.css
│ │ ├── layout.js # Root layout
│ │ ├── page.js # Home page
│ │ └── Providers.js # Context/provider setup
│ ├── package.json
│ └── README.md
├── backend/ # Express.js backend server
│ ├── routes/
│ │ ├── auth.js # Authentication endpoints
│ │ └── books.js # Book management endpoints
│ ├── config/
│ │ └── db.js # MongoDB connection
│ ├── server.js # Main Express app
│ ├── package.json
│ └── .env # Environment variables
└── README.md # This file
- Node.js 16+ and npm
- MongoDB (local or cloud instance)
- Git
git clone https://github.com/webdevyn/LibraShare.git
cd LibraSharecd backend
npm installCreate a .env file in the backend directory:
PORT=5000
MONGODB_URI=mongodb://localhost:27017/librashare
NODE_ENV=developmentStart the backend server:
npm run devThe backend will run on http://localhost:5000
Open a new terminal and navigate to the frontend directory:
cd frontend
npm installStart the development server:
npm run devOpen your browser and visit http://localhost:3000
| Method | Endpoint | Description |
|---|---|---|
POST |
/signup |
Create a new user account |
POST |
/login |
User login |
POST |
/logout |
User logout |
GET |
/verify |
Verify authentication token |
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Get all books |
GET |
/:id |
Get a specific book |
POST |
/ |
Add a new book (authenticated) |
PUT |
/:id |
Update a book (authenticated) |
DELETE |
/:id |
Delete a book (authenticated) |
GET |
/search?q=query |
Search books by title or author |
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Verify backend is running |
LibraShare uses JWT (JSON Web Tokens) for secure authentication:
- Users register with email and password
- Upon login, a JWT token is issued
- Token is stored in localStorage on the client
- All authenticated requests include the token in the Authorization header
- Backend validates token before processing requests
The main header displays the LibraShare logo and navigation menu with a modern gradient background.
Root layout includes global styles, font optimization, and provider setup for context management.
- Home - Main landing page with book listings
- Additional pages for book details, user profile, etc.
express- Web frameworkcors- Enable CORSdotenv- Environment variable managementmongoose- MongoDB ODM (typically used for DB operations)- Additional authentication and validation middleware
next- React frameworkreact- UI librarytailwindcss- Styling frameworkaxiosorfetch- HTTP client for API calls
To run tests (if configured):
npm testThe easiest way to deploy the Next.js frontend:
npm install -g vercel
vercelFollow the prompts to connect your GitHub repository and deploy.
- Set up environment variables on your hosting platform
- Connect your GitHub repository
- Configure build and start commands
- Deploy
# Check if port 5000 is already in use
lsof -i :5000 # macOS/Linux
netstat -ano | findstr :5000 # Windows
# Use a different port
PORT=5001 npm run dev- Ensure MongoDB is running locally or connection string is correct
- Check
.envfile forMONGODB_URI - Verify network access for cloud MongoDB instances
- Verify backend is running on the correct port
- Check CORS configuration in Express
- Ensure API calls use the correct backend URL
CORS is enabled in the backend. If issues persist:
- Check backend console for error details
- Verify frontend and backend URLs in CORS configuration
- Ensure requests include proper headers
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source and available under the MIT License.
Devyn Weir
- GitHub: @webdevyn
For issues, questions, or suggestions, please open a GitHub Issue.
Last Updated: July 16, 2026
Status: In Development