Before you begin, ensure that you have the following installed:
-
Node.js (LTS version recommended):
Download here -
Visual Studio (for API Server setup):
Download here -
SQL Server Express (or any SQL Server instance):
Download SQL Server Express here -
.NET SDK (for the backend API):
Download .NET SDK here
- Begin by cloning the repository to your local machine using Git.
git clone https://github.com/Viraj5903/book-review-app.git
-
Open the Book Reviews API Project in Visual Studio
- Launch Visual Studio and open the BookReviewsAPI project.
-
Install Required NuGet Packages
-
Open the Package Manager Console in Visual Studio by navigating to Tools > NuGet Package Manager > Package Manager Console.
-
Run the following commands to install necessary packages for Entity Framework Core and SQL Server support:
Install-Package Microsoft.EntityFrameworkCore.Tools Install-Package Microsoft.EntityFrameworkCore.SqlServer
-
-
Update the Database
-
In the Package Manager Console, run the following command to apply any pending migrations and update your local database (LocalDB) schema:
Update-Database
-
-
(Optional) Use a SQL Server Instance Instead of LocalDB
-
By default, the backend API is configured to use LocalDB. If you'd like to use a SQL Server instance instead, update the connection string in the
appsettings.json
file. -
Open
appsettings.json
and modify theConnectionStrings
section as shown below:"ConnectionStrings": { "BookReviewDb": "Server=your-server-name;Database=your-database-name;User Id=your-username;Password=your-password;" }
-
Replace
your-server-name
,your-database-name
,your-username
, andyour-password
with your actual SQL Server instance details. -
Run again the
Update-Database
command to apply the migrations to your SQL Server instance.
-
-
Build and Run the Backend API
- After updating the database, build the project in Visual Studio and run the backend API.
- To verify that the API is working correctly, open your browser and navigate to
http://localhost:5000
(or the appropriate URL).
-
Open the Book Review Project in Visual Studio Code
- Navigate to the book-review-app folder (frontend folder) and open it in Visual Studio Code.
-
Install Project Dependencies
-
Open the terminal in Visual Studio Code and run the following command to install the project dependencies:
npm install
-
-
Start the React Development Server
-
Once the dependencies are installed, start the React development server by running:
npm start
-
-
Access the React Application
- The React application should now be running and accessible at
http://localhost:3000
in your web browser.
- The React application should now be running and accessible at
-
Backend: Ensure the API Server is Running
- Verify that the API Server is running and accessible at its designated endpoint (typically
http://localhost:5000
). - If the backend is not running, ensure you have followed the steps to set it up correctly in Step 2.
- Verify that the API Server is running and accessible at its designated endpoint (typically
-
Frontend: Run the React Application
- The React frontend should now be running at
http://localhost:3000
. - Open a web browser and go to
http://localhost:3000
to interact with the application and test its functionality. - Make sure the frontend can communicate with the backend and that all features work as expected.
- The React frontend should now be running at