This is the source code for my personal website, bencan.net. Built with Next.js and Tailwind CSS.
To self-host this website, you will need the following prerequisites:
- Node.js
- pnpm
- Git Once you have the prerequisites installed, follow these steps to self-host Lantern:
- Clone the repository to your local machine:
git clone https://github.com/chimpdev/bencan.net.git
- Navigate to the cloned repository:
cd bencan.net
- Install the required dependencies:
pnpm install
- Rename the
.env.example
file to.env
and fill in the configuration values:
SPOTIFY_CLIENT_ID=
SPOTIFY_CLIENT_SECRET=
SPOTIFY_REDIRECT_URL=
SPOTIFY_REFRESH_TOKEN=
Note
- To get the Spotify API credentials, you need to create a Spotify Developer account and create a new application. After creating the application, you will get the client ID and client secret. Don't forget to set the redirect URL to
https://YOUR_DOMAIN/api/spotify/callback
whereYOUR_DOMAIN
is the domain where you are hosting the website. - To get the Spotify refresh token, after you have set the client ID, client secret, and redirect URL, skip this step and start the server in development mode with pnpm run dev. The server will automatically start at
http://localhost:3000
. Visithttp://localhost:3000/api/spotify
and log in with your Spotify account. After logging in, you will be redirected tohttp://localhost:3000/api/spotify/callback
. The refresh token will be displayed on the page. Copy the refresh token and paste it in the.env
file. After pasting the refresh token, restart the server. With this implementation, every 1 hour the server will automatically get a new access token using the refresh token and display your recently played tracks on the website. If you want to get rid of "recently played tracks" functionality, you can just use empty .env file.
- Start the server:
pnpm start
- The server should now be running on
http://localhost:3000
.
I'm always open to contributions from the community! If you'd like to contribute to the project, please follow these guidelines:
- Fork the repository and clone it locally.
- Create a new branch for your feature or bug fix.
- Make your changes and ensure the code passes any existing tests.
- Commit your changes with descriptive commit messages that follow the Conventional Commits standard.
- Push your changes to your fork and submit a pull request to the
main
branch of the original repository.
Please make sure to follow the Code of Conduct and Contributing Guidelines when contributing to this project.
If you encounter any issues with the project or have any questions, feel free to open an issue on this repository. I am always happy to help!
This project is licensed under the GNU General Public License v3.0.