A Node.js/Express-based REST API for a social media application with AI-powered post description generation.
- Overview
- Features
- Tech Stack
- Project Structure
- Installation & Setup
- Environment Variables
- API Endpoints
- Usage
- Google Gemini Integration
- Example Responses
- Future Enhancements
- License
This project is a Node.js/Express-based REST API that provides core functionalities for a social media application, including user authentication, post creation with image upload, and AI-powered description generation using Google Gemini.
β
User Registration & Login
β
JWT-based Authentication
β
Image Upload (Multer)
β
AI Description Generation (Google Gemini)
β
Create & Manage Posts
Backend: Node.js, Express.js
Database: MySQL (or MongoDB, if used)
Authentication: JWT (JSON Web Token)
File Upload: Multer
AI Integration: Google Gemini API
Environment Variables: dotenv
project-name/
βββ src/
β βββ controllers/ # All controllers (auth, posts)
β βββ routes/ # Routes for auth & posts
β βββ middleware/ # Authentication middleware
β βββ config/ # DB & Gemini config
β βββ app.js # Main entry point
βββ uploads/ # Uploaded images
βββ .env # Environment variables
βββ package.json
βββ README.md
1οΈβ£ Clone the repository
git clone https://github.com/your-username/your-repo.git
cd your-repo
2οΈβ£ Install dependencies
bassh npm install
3οΈβ£ Create .env file
bash PORT=5000 DB_HOST=localhost DB_USER=root DB_PASS=yourpassword DB_NAME=yourdbname JWT_SECRET=your_jwt_secret GEMINI_API_KEY=your_gemini_api_key