LuminaPress-BackEnd is the backend infrastructure for the LuminaPress platform, built using ExpressJS and hosted on Azure. This repository is responsible for handling various server-side operations, including user authentication, personalized news feed algorithms, and integration with AI and blockchain-based fact-checking systems.
Follow these steps to get the backend up and running locally:
Ensure you have the following installed:
- Node.js (LTS version recommended): Install Node.js
- npm (Node Package Manager): Comes with Node.js.
- Azure Account (For deploying on Azure)
-
Clone the repository:
git clone https://github.com/LuminaPress/LuminaPress-BackEnd.git cd LuminaPress-BackEnd -
Install dependencies:
npm install
-
Set up environment variables for your local environment (e.g., database credentials, API keys). Create a
.envfile based on the provided.env.exampletemplate. -
Install Azure CLI and log in to your Azure account if deploying to Azure.
Create a .env file in the root directory and define the following variables:
PORT=3000
DB_CONNECTION_STRING=your_database_connection_string
JWT_SECRET=your_jwt_secret_key
AI_SERVICE_API_KEY=your_ai_service_api_key
BLOCKCHAIN_API_KEY=your_blockchain_service_api_keyMake sure to replace placeholders with actual values based on your environment.
After setting up your environment, start the server:
npm startThis will run the server locally on the port defined by PORT in your .env file (default: 3000).
This backend exposes various endpoints for managing user accounts, news feeds, and other services:
- POST
/api/auth/register: Register a new user - POST
/api/auth/login: Login an existing user - POST
/api/auth/logout: Logout a user
- GET
/api/news: Get the personalized news feed for a user - POST
/api/news/recommend: Recommend personalized news articles based on user preferences
- POST
/api/articles: Create a new article - GET
/api/articles/:id: Get a specific article by ID - GET
/api/articles/fact-check/:articleId: Get the fact-checking status of an article using AI and Blockchain
- Node.js: JavaScript runtime for building scalable applications.
- ExpressJS: Web framework for building RESTful APIs.
- Azure Cosmos DB: Database for storing user data, articles, and news feed preferences.
- Azure: Cloud hosting platform.
- AI Service: For personalized news recommendations and fact-checking.
- Blockchain: For integrating decentralized fact-checking systems.
We welcome contributions from the community! If you'd like to contribute, follow the steps below:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Implement your changes.
- Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Create a pull request with a description of the changes.
Please make sure your code adheres to the project's style guidelines and that all tests pass.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
For any questions, feel free to open an issue or contact us via the LuminaPress Community.