A modern book discovery and review platform inspired by Letterboxd. Discover, rate, and review books with a sleek, dark-themed interface.
This is a full-stack web application with a clear separation of concerns:
- Framework: Django 5.2 with Django REST Framework
- Authentication: JWT (JSON Web Tokens) via
djangorestframework-simplejwt - Database: SQLite (easily switchable to PostgreSQL/MySQL for production)
- CORS: Enabled for frontend communication
- Key Features:
- User registration and authentication
- Book and author management
- Review and rating system
- Reading diary functionality
- API endpoints for CRUD operations
- Framework: React 18 with React Router
- Styling: Bootstrap + Custom CSS (dark theme)
- HTTP Client: Axios for API calls
- State Management: React Context for authentication
- Key Features:
- Responsive book grid with hover popups
- Search and pagination
- User reviews and ratings
- Reading diary management
- Authentication forms
- Frontend makes API requests to backend endpoints
- Backend processes requests, interacts with database
- Responses sent back to frontend for rendering
- JWT tokens handle user sessions
- Backend: Python, Django, Django REST Framework, SQLite
- Frontend: JavaScript, React, Bootstrap, Axios
- Deployment: Heroku (backend), Vercel/Netlify (frontend)
- Version Control: Git
- Environment: Python virtualenv, Node.js
- Python 3.8+
- Node.js 16+
- Git
- GitHub account (for deployment)
-
Clone the repository:
git clone https://github.com/yourusername/letterbooked.git cd letterbooked/backend -
Create virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt pip install django-environ # For environment variables -
Set up environment variables:
- Copy
backend/.env.exampletobackend/.env(if provided) or create it:SECRET_KEY=your-secret-key-here DEBUG=True ALLOWED_HOSTS=localhost,127.0.0.1 DATABASE_URL=sqlite:///db.sqlite3 CORS_ALLOWED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000 - Generate a secure SECRET_KEY:
python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
- Copy
-
Run migrations:
python manage.py migrate
-
Populate database (optional):
python manage.py populate_db python manage.py populate_from_api
-
Start the server:
python manage.py runserver
Backend will run on
http://127.0.0.1:8000
-
Navigate to frontend directory:
cd ../frontend -
Install dependencies:
npm install
-
Set up environment variables:
- Create
frontend/.env:REACT_APP_API_BASE_URL=http://127.0.0.1:8000
- Create
-
Start the development server:
npm start
Frontend will run on
http://localhost:3000
- Open two terminals: one for backend, one for frontend.
- Ensure CORS is configured correctly in backend settings.
-
Install Heroku CLI and log in:
heroku login
-
Create Heroku app:
cd backend heroku create your-app-name -
Set environment variables:
heroku config:set SECRET_KEY=your-production-secret-key heroku config:set DEBUG=False heroku config:set ALLOWED_HOSTS=your-app-name.herokuapp.com heroku config:set DATABASE_URL=your-database-url # For production DB heroku config:set CORS_ALLOWED_ORIGINS=https://your-frontend-domain.com -
Deploy:
git push heroku main heroku run python manage.py migrate
-
Access your API at
https://your-app-name.herokuapp.com
-
Install Vercel CLI:
npm install -g vercel
-
Deploy from frontend directory:
cd frontend vercel -
Set environment variables in Vercel dashboard:
REACT_APP_API_BASE_URL=https://your-backend-url.herokuapp.com
-
Redeploy after changes.
- Drag & drop the
frontend/buildfolder afternpm run build. - Set environment variables in Netlify dashboard.
POST /api/token/- LoginPOST /api/register/- Register
GET /api/books/- List booksPOST /api/books/- Add bookGET /api/books/{id}/- Book details
GET /api/reviews/- List reviewsPOST /api/reviews/- Add reviewPATCH /api/reviews/{id}/- Update review
GET /api/authors/- List authorsPOST /api/authors/- Add author
GET /api/diary-entries/- List diary entriesPOST /api/diary-entries/- Add/update diary entry
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit changes:
git commit -am 'Add feature' - Push to branch:
git push origin feature-name - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
If you have questions or issues, open an issue on GitHub or contact the maintainers.