Welcome to MyLink, a LinkedIn-inspired social network for professionals. This project is a full-stack web application developed using ASP.NET Core for the backend and React for the frontend.
Ξere is a short demo π―π’πππ¨ showcasing the app's functionalities.
To set up the project locally, first clone this repository:
git clone https://github.com/drammos/LinkedIn.git
cd MyLink
Make sure you have the following installed:
.NET Core SDK (8.0.401): Install .NET SDK Node.js & npm: Install Node.js SQL Server: Install SQL Server and SQL Server Management Studio (SSMS) for managing your database.
cd LinkedIn/WebAppBackEnd
Then, restore the .NET dependencies using:
dotnet restore
"ConnectionStrings": {
"DefaultConnection": "Server=YOUR_SERVER;Database=MyLinkDB;Trusted_Connection=True;MultipleActiveResultSets=true"
}
update-database
dotnet ef database update
dotnet run
The API will be accessible at https://localhost:5001/ (or the IIS Express port if running from Visual Studio).
bash
cd LinkedIn/MyLinkFrontEnd
Install the necessary packages:
npm install
npm start
The React app will be accessible at http://localhost:4173/.
Once the database is set up and migrations have been applied, your tables will be automatically created.
Once both the backend and frontend are running:
Make sure both applications are running concurrently.
The backend API provides several endpoints for interacting with the platform's functionality. You can access and explore the API documentation through Swagger once the backend is running:
https://localhost:44329/swagger/index.html
The project utilizes pagination with IQueryable in order to efficiently handle large datasets. Instead of fetching all records at once, only a subset of records, based on the page size and current page number, is fetched from the database, reducing memory usage and improving performance. This ensures that users interacting with large datasets (like 1,000,000+ posts or users) only load the necessary data.
For example, the backend code implements this with PagedList
public async Task<PagedList<UserDTO>> GetAllUsers([FromQuery] Params paginationParams)
{
var users = _userManager.Users;
var userListPaged = await PagedList<User>.ToPagedList(users, paginationParams.PageNumber, paginationParams.PageSize);
List<UserDTO> userDTOList = new List<UserDTO>();
foreach (var user in userListPaged)
{
UserDTO userDTO = _mapper.Map<UserDTO>(user);
var listfromroles = await _userManager.GetRolesAsync(user);
List<string> roles = new List<string>(listfromroles);
userDTO.Role = roles[0];
userDTOList.Add(userDTO);
}
var userDTOPaginationList = new PagedList<UserDTO>(userDTOList, userListPaged.Metadata.TotalCount, userListPaged.Metadata.CurrentPage, userListPaged.Metadata.PageSize);
Response.AddPaginationHeader(userDTOPaginationList.Metadata);
return userDTOPaginationList;
}
This approach ensures only the required data for each page is loaded from the database, improving application performance.
This project is licensed under the MIT License. See the LICENSE file for details.