| Properties | ||
| wwwroot | ||
| CiteLynq.WebSample.csproj | ||
| Program.cs | ||
| README.md | ||
CiteLynq Web Sample
A sample ASP.NET Core web application demonstrating how to integrate with the CiteLynq API for verified citations across multiple authoritative sources.
Features
| Feature | Description |
|---|---|
| ASP.NET Core 9.0 | Minimal API with modern C# patterns |
| Proxy Endpoints | Hide API keys from client-side code |
| Multi-Source Search | ArXiv, PubMed, CourtListener, and more |
| Citation Formats | APA, MLA, Chicago, Bluebook |
| Responsive UI | Clean, modern design for desktop and mobile |
| Local Storage | Persists API key in browser |
Quick Start
1. Clone the Repository
git clone https://git.marketally.com/citelynq/CiteLynq.WebSample.git
cd CiteLynq.WebSample
2. Get an API Key
- Visit citelynq.com/app/api-keys
- Create a new API key
- Copy the key (starts with
cl_)
3. Run
dotnet run
Open http://localhost:5100 in your browser.
Project Structure
CiteLynq.WebSample/
├── Program.cs # ASP.NET Core minimal API
├── CiteLynq.WebSample.csproj # Project file
├── Properties/
│ └── launchSettings.json # Launch configuration
└── wwwroot/
└── index.html # Single-page application
API Endpoints
Search Citations
GET /api/search?q=climate+change&sourceType=ArXiv&page=1&pageSize=20
X-API-Key: cl_your-api-key-here
Get Article Details
GET /api/articles/{id}
X-API-Key: cl_your-api-key-here
Example Response
{
"data": {
"results": [
{
"id": "arxiv-2301.12345",
"sourceType": "ArXiv",
"title": "Climate Change Research",
"authors": ["Dr. Jane Smith"],
"publishedDate": "2023-01-15",
"citations": {
"apa": "Smith, J. (2023)...",
"mla": "Smith, Jane..."
}
}
],
"totalCount": 145
}
}
Configuration
API Base URL
Edit Program.cs:
const string API_BASE_URL = "https://citelynq.com/api";
Port
Edit Properties/launchSettings.json:
{
"profiles": {
"http": {
"applicationUrl": "http://localhost:5100"
}
}
}
Development
Prerequisites
- .NET 9.0 SDK
Commands
dotnet build # Build
dotnet run # Run
dotnet publish -c Release # Publish
Security Notes
- API Keys: The proxy pattern keeps keys server-side
- CORS: Configure specific origins for production
- HTTPS: Required for production deployments
Troubleshooting
| Issue | Solution |
|---|---|
| Port in use | Change port in launchSettings.json |
| CORS errors | Check CORS configuration in Program.cs |
| API key invalid | Verify key starts with cl_ and is active |
Resources
License
MIT - Use freely in your own projects.