This project is a .NET Core-based API designed to manage stock data, user portfolios, and comments related to various stocks. The API provides a secure, scalable, and efficient solution to handle stock-related information, including user authentication and authorization using JWT.
- User Authentication & Authorization: Implements JWT (JSON Web Tokens) for secure user authentication and role-based access control.
- Stock Management: Allows CRUD operations on stock data, including symbol, company name, industry, market cap, and more.
- Portfolio Management: Enables users to manage their stock portfolios.
- Comment System: Users can leave comments on specific stocks.
- Database Integration: Utilizes SQL Server and Entity Framework Core for database management.
- Swagger Integration: API documentation and testing using Swagger with JWT token support.
- JSON Serialization: Uses Newtonsoft.Json for handling JSON serialization, ensuring no reference loops.
- .NET Core: The core framework used to build the API.
- Entity Framework Core: ORM used to interact with SQL Server.
- SQL Server: Database management system for storing data.
- ASP.NET Identity: For handling user authentication and authorization.
- JWT (JSON Web Tokens): Used for secure user authentication and authorization.
- Swagger: API documentation and testing.
- Newtonsoft.Json: For JSON serialization and deserialization.
- Clone the repository:
git clone [email protected]:mohamedhassan218/stock-api.git
- Navigate to the project directory:
cd API
- Restore the dependencies:
dotnet restore
- Update the
appsettings.json
with your SQL Server connection string:"ConnectionStrings": { "DefaultConnection": "Your SQL Server connection string here" }
- Apply the migrations to set up the database:
dotnet ef database update
- Run the application:
dotnet run
Once the application is running, you can access the Swagger UI for API documentation and testing at:
http://localhost:5111/swagger/index.html
Special thanks to Teddy Smith for his excellent playlist which guided me throughout this project. His teachings on .NET Core and building RESTful APIs were invaluable.