This guide will walk you through setting up and running this AstroJS project. The project integrates various services including Cloudinary, Neon (PostgreSQL), Drizzle ORM, BetterAuth, and GitHub OAuth for authentication.
Ensure you have the following installed before proceeding:
- Node.js (Latest LTS recommended)
- Git
- pnpm / npm / yarn (Choose one package manager)
- PostgreSQL Database (Neon)
- Cloudinary Account
- GitHub OAuth App
git clone https://github.com/JannickPepe/TribeBlockChain.git
cd <project-directory>pnpm install # or npm install / yarn installCreate a .env.local(localhost endpoints) and a .env(deployment endpoints) file in the root directory and configure the following variables.
DATABASE_URL=""
BETTER_AUTH_SECRET=""
BETTER_AUTH_URL=""
GITHUB_CLIENT_ID=""
GITHUB_CLIENT_SECRET=""
PUBLIC_CLOUDINARY_CLOUD_NAME=""
PUBLIC_CLOUDINARY_API_KEY=""
CLOUDINARY_API_SECRET=""
🚨 Important: Do not share your env files publicly.
Run the following command to apply migrations:
pnpm drizzle push # or npm run drizzle:push / yarn drizzle pushpnpm dev # or npm run dev / yarn devThe server should now be running at http://localhost:4321/.
- Push your changes to GitHub.
- Link your repository to Netlify.
- Add your environment variables in Netlify's settings.
- Deploy your application.
For GitHub OAuth, ensure your OAuth app is set to:
- Homepage URL:
https://your-production-url.com/ - Authorization Callback URL:
https://your-production-url.com/api/auth/callback/github
- Format Code:
pnpm format - Lint Code:
pnpm lint - Build for Production:
pnpm build
Ensure that your GitHub OAuth App settings match the correct URLs (local & production). If using Netlify, check that environment variables are correctly set.
- Ensure Neon PostgreSQL credentials are correct.
- Check that your database URL is formatted correctly.
- Run
drizzle pushto apply any missing migrations.
Feel free to contribute by submitting a PR! Follow these steps:
- Fork the repository
- Create a feature branch
- Commit and push changes
- Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.
Happy coding! 🚀