Welcome to the backend repository of Synapse, a personalized AI tutor designed to provide high-quality educational support to students. This document outlines how to set up, run, and contribute to the backend of Synapse.
The Synapse Backend serves as the core engine that powers the AI tutoring capabilities of the Synapse application. It handles user session and file management, communication with the Google Gemini API, and other essential backend services.
- Node.js: Runtime environment for executing JavaScript on the server.
- Express.js: Web framework for building the API.
- Socket.IO: Real-time communication between the frontend and backend.
- Google Gemini API: Used to power the AI-based tutoring services.
- Cloudinary: For storing files on another server.
Ensure you have the following installed on your machine:
- Node.js (v14.x or higher)
- npm (v6.x or higher)
- Firebase CLI (for Firebase services)
-
Clone the repository:
git clone https://github.com/riteshgharat/synapse-backend.git cd synapse-backend
-
Install dependencies:
npm install
-
Set up environment variables:
Create a
.env
file in the root directory and add the necessary environment variables. Refer to the Configuration section for details.
The backend relies on several environment variables for configuration. Below is a sample .env
file:
# FRONTEND URL
FRONTEND_URL=http://localhost:5173
# GEMINI API KEY
GEMINI_API_KEY=your-gemini-api-key
# CLOUDINARY API CONFIG
CLOUDINARY_CLOUD_NAME=your-cloudinary-cloud-name
CLOUDINARY_API_KEY=your-cloudinary-api-key
CLOUDINARY_API_SECRET=your-cloudinary-api-secret
To run the application in development mode:
npm run dev
The server will start on the port specified in your .env
file, typically http://localhost:3000
.
To run the application in production mode:
npm run start
To deploy the backend, follow these general steps:
- Set up a production environment (e.g., on AWS, Heroku, etc.).
- Configure environment variables according to your deployment setup.
- Deploy the codebase using your preferred CI/CD pipeline.
Detailed deployment instructions will vary depending on your chosen platform.
We welcome contributions! Please follow these steps:
- Fork the repository.
- Create a new branch (
feature/your-feature
). - Commit your changes.
- Push to the branch.
- Open a Pull Request.
Ensure your code follows our coding standards and is properly tested.