A modern ASP.NET Core Web API for tracking user activities and sessions across multiple devices. Built with .NET 10.0 and Entity Framework Core with PostgreSQL.
- Cross-Device Tracking: Monitor user sessions across multiple devices
- RESTful API: Clean and intuitive API endpoints
- Entity Framework Core: Database-first approach with PostgreSQL
- Swagger/OpenAPI: Built-in API documentation and testing interface
- Modern Architecture: Clean separation of concerns with Controllers, Models, Services, and Data layers
- Framework: .NET 10.0
- Database: PostgreSQL with Npgsql.EntityFrameworkCore.PostgreSQL 10.0.0
- ORM: Entity Framework Core 10.0.1
- API Documentation: Swashbuckle.AspNetCore 10.1.0
- API Specification: Microsoft.AspNetCore.OpenAPI 10.0.1
CrossDeviceTracker.Api/
├── Controllers/ # API Controllers
│ └── AuthController.cs
├── Models/ # Data models
│ ├── DTOs/ # Data Transfer Objects
│ └── Entities/ # Database entities
├── Data/ # Database context and migrations
│ └── AppDbContext.cs
├── Services/ # Business logic layer
├── Properties/ # Project properties
├── Program.cs # Application entry point
└── appsettings.json # Configuration
- .NET 10.0 SDK
- PostgreSQL (version 12 or higher recommended)
- IDE: Visual Studio 2025, Visual Studio Code, or JetBrains Rider
-
Clone the repository
git clone https://github.com/Harshit4847/CrossDeviceTracker.Api.git cd CrossDeviceTracker.Api -
Configure the database connection
Update the connection string in
appsettings.jsonorappsettings.Development.json:{ "ConnectionStrings": { "DefaultConnection": "Host=localhost;Database=crossdevicetracker;Username=your_username;Password=your_password" } } -
Restore NuGet packages
dotnet restore
-
Apply database migrations
dotnet ef database update
-
Run the application
dotnet run
The API will be available at:
- HTTPS:
https://localhost:7xxx - HTTP:
http://localhost:5xxx
(Port numbers will be displayed in the console when the application starts)
Once the application is running, access the Swagger UI documentation at:
https://localhost:7xxx/swagger
This interactive interface allows you to:
- View all available endpoints
- Test API calls directly from the browser
- See request/response schemas
- Review API authentication requirements
The API includes an AuthController for handling authentication. Details will be added as the authentication implementation progresses.
The project uses Entity Framework Core with PostgreSQL. The AppDbContext class manages the database context and entity configurations.
Create a new migration:
dotnet ef migrations add MigrationNameUpdate the database:
dotnet ef database updateRevert the last migration:
dotnet ef database update PreviousMigrationNameThe application is configured to run Swagger in all environments. Development-specific settings can be found in appsettings.Development.json.
Using Visual Studio:
- Press F5 to start debugging
Using VS Code:
- Use the configured launch settings
- Or run:
dotnet run --launch-profile https
(Coming soon - Unit tests and integration tests will be added)
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is currently unlicensed. Please contact the repository owner for usage rights.
Harshit Yadav
- GitHub: @Harshit4847
- Email: official.harshit@outlook.com
For support, please open an issue in the GitHub repository.
- Initial project setup with basic structure
- Added Entity Framework Core with PostgreSQL support
- Integrated Swagger/OpenAPI documentation
- Set up AuthController foundation
- Configured DbContext and project architecture
⭐ If you find this project useful, please consider giving it a star on GitHub!