lttb-server is a backend server designed to support the ListenToThis, Bro project. This repository provides the server-side functionality, including APIs and data management, to enable seamless interaction with the client-side application.
- User Authentication: OAuth2-based authentication with Spotify.
- Playlist Management: Create and manage playlists for users and their followers.
- Follower Tracking: Scrape and store Spotify follower data.
- Rate Limiting: Protect APIs with configurable rate limits.
- Session Management: Secure session handling with MongoDB-backed storage.
-
Clone the repository:
git clone https://github.com/parthskansara/lttb-server.git cd lttb-server -
Install dependencies:
npm install
-
Set up environment variables:
- Create a
.envfile in the root directory. - Add the following variables:
PORT=3000 CLIENT_ID=your_spotify_client_id CLIENT_SECRET=your_spotify_client_secret REDIRECT_URI=your_redirect_uri CLIENT_URL=your_client_url SESSION_SECRET=your_session_secret MONGO_CONNECTION_URI=your_mongo_connection_uri APP_NAME=listentothis,bro
- Create a
-
Start the server:
npm start
- GET
/api/login: Redirects to Spotify login. - GET
/api/token: Handles Spotify OAuth2 token exchange. - DELETE
/api/logout: Logs out the user.
- GET
/api/profile: Fetches the user's Spotify profile. - GET
/api/profile/artists: Fetches the user's top artists.
- POST
/api/playlist: Creates a playlist for a follower.
- GET
/api/follower: Fetches or scrapes the user's followers.
- GET
/api/health: Returns the server's health status.
This project is configured for deployment on Vercel. The vercel.json file specifies the build and routing configuration.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request with a detailed description of your changes.
For questions or support, please reach out at parthskansara@gmail.com.