This project is part of Code Savanna’s internship evaluation. It is designed to assess your ability to build a basic full-stack application using Django (backend) and React (frontend).
The goal is to create a web application where users can manage a personal collection of books, including adding, viewing, updating, and deleting books. Additionally, users should be able to filter books based on certain criteria (e.g., genre or read status).
- Backend: Django REST Framework to create APIs for managing books.
- Frontend: React for building a dynamic and interactive user interface.
- Database: SQLite (default with Django), but feel free to use PostgreSQL if you’re comfortable with it.
- Styling: Bootstrap 5 for responsive design and a professional layout.
- Version Control: GitHub for tracking progress and collaboration.
Note: Basic setup for both Django and React has been provided in this repository to get you started.
By the end of this project, you will demonstrate the following:
- Setting up and structuring a Django backend with API endpoints.
- Building a React frontend to interact with these endpoints.
- Managing data across a full-stack application.
- Writing clear, professional code following best practices.
- Applying Bootstrap for styling and responsiveness.
-
Fork the Repository
Fork this repository to your GitHub account, then clone it to your local machine:git clone https://github.com/your-username/book-collection-tracker.git
-
Navigate to the Project Directory
cd book-collection-tracker
-
Navigate to the backend directory:
cd backend -
Create a virtual environment:
python3 -m venv env source env/bin/activate # On Windows, use `env\Scripts\activate`
-
Install required dependencies:
pip install -r requirements.txt
-
Run initial migrations:
python manage.py migrate
-
Start the development server:
python manage.py runserver
-
Ensure Node.js and npm are installed:
Before proceeding with the React setup, ensure you have Node.js and npm installed. If not, follow these instructions:-
For Windows and macOS:
- Download the LTS version from the Node.js download page.
- Run the installer and follow the instructions.
- Verify installation by running:
node -v npm -v
-
For Linux:
sudo apt update sudo apt install nodejs npm
Verify the installation using the same commands as above.
-
-
Navigate to the frontend directory:
Open a new terminal window and run:cd frontend -
Install frontend dependencies:
npm install
-
Add Bootstrap to your React application:
npm install bootstrap
-
Import Bootstrap CSS in your index.js or App.js file:
Add the following line:import 'bootstrap/dist/css/bootstrap.min.css';
-
Start the React development server:
npm start
The frontend should now be available at http://localhost:3000, and the backend at http://localhost:8000.
e.g intern/joseph
Below is a list of tasks to guide you through the project. Each task can be tackled one at a time and marked off as you complete it.
Backend (Django)
-
Set up the Book Model and Migrations
- Create a model
Bookwith fields like title, author, genre, and read_status (boolean). - Make migrations and apply them.
- Create a model
-
Create REST API Endpoints
- Add API endpoints for:
- Listing all books (GET)
- Adding a new book (POST)
- Updating a book (PUT)
- Deleting a book (DELETE)
- Include filtering functionality for genre and read_status.
- Add API endpoints for:
-
Implement API Documentation
- Add documentation for each endpoint. Use a simple format like Django Rest Framework’s browsable API or Swagger.
Frontend (React)
-
Design the UI for Book List and Filters
- Utilize Bootstrap components to create a responsive layout.
- Create a navigation bar using Bootstrap's Navbar component for easy navigation.
- Build a list view of books using Bootstrap's Card component, displaying title, author, genre, and read_status.
Example:
<div className="card mb-3"> <div className="card-body"> <h5 className="card-title">{book.title}</h5> <h6 className="card-subtitle mb-2 text-muted">{book.author}</h6> <p className="card-text">Genre: {book.genre}</p> <p className="card-text">Read: {book.read_status ? "Yes" : "No"}</p> </div> </div>
-
Implement Book Management Functionality
- Build forms for adding and editing books using Bootstrap's Form components.
- Create delete functionality with a Bootstrap modal confirmation dialog.
Example:
<button className="btn btn-danger" onClick={handleDelete}>Delete</button>
-
Connect Frontend to Backend API
- Use Axios to handle HTTP requests between the frontend and backend.
- Test that all frontend interactions (CRUD operations) work as expected.
Code Quality
- Write clean, readable code following best practices. Use comments where necessary to explain complex logic or decisions.
Git Workflow
- Commit frequently with clear, descriptive messages.
- Push your changes to your forked repository on GitHub.
Pull Request
When you have completed all tasks, submit a pull request (PR) to the original repository with the following details:
- A summary of the features you implemented.
- Any challenges you encountered and how you overcame them.
- Areas for improvement or additional features you would add with more time.
- Testing: While not required, we encourage you to write basic unit tests to verify the core functionality of your API endpoints.
- Documentation: Ensure your code is well-documented. You may also create a simple
API_Documentation.mdfor additional clarity on endpoints. - Time Management: This project is designed to be completed within a period of 10 days. Prioritize core functionalities before adding optional features or refinements.
Here are some resources to help you get started if you’re new to any of these technologies:
- Django Documentation
- Django REST Framework
- React Documentation
- Axios for Handling HTTP Requests
- Bootstrap Documentation
Attention Developers:
As part of the Code Savanna internship evaluation, it is imperative to maintain the integrity and originality of your work. Therefore, the use of AI tools or automated coding solutions is strictly prohibited. Engaging with such tools not only undermines the purpose of this project but may also lead to disqualification from the evaluation process.
Please note the following:
-
Originality is Key: Your submission should reflect your individual skills and understanding of the technologies involved. Use of AI-generated code or assistance will be considered a violation of the guidelines.
-
Detection: There are mechanisms in place to identify the use of AI tools. Any detected usage will result in immediate penalties, including disqualification.
-
Professional Development: This project is an opportunity for you to grow as a developer. Embrace the challenge, seek guidance when needed, and focus on honing your skills.
If you have any questions or encounter any issues, please reach out to your Code Savanna point of contact or open an issue in this repository.
Good luck, and we look forward to seeing your work!