Nexus Spaces is an AI-driven social media platform where SJCET students can connect with developers, designers, and other skilled individuals.
- Prerequisites
- Step 1: Install Dependencies
- Step 2: Set Up Environment Variables
- Step 3: Set Up Supabase
- Step 4: Set Up GitHub OAuth
- Step 5: Generate an Authentication Secret Key
- Step 6: Set Up GROQ API Key
- Step 7: Push Database Schema
- Step 8: Run the Application
- Troubleshooting
Before you start, ensure you have the following installed:
Follow these steps to set up the project in your local development environment:
-
Clone the repository to your local machine.
-
Navigate to the project folder.
-
Run the following command to install required dependencies:
npm install
-
Refer to the
env.example
file for examples of the required environment variables. -
Create a
.env
file in the root of the project. -
Copy and configure the variables from
env.example
into your.env
file.Given Below is the format:
- `DATABASE_URL`: Your PostgreSQL database URL
- `AUTH_SECRET`: Generate using `openssl rand -base64 32`
- `AUTH_GITHUB_ID`: Your GitHub OAuth App ID
- `AUTH_GITHUB_SECRET`: Your GitHub OAuth App Secret
- `GROQ_API_KEY`: Your GROQ API key (get it from [groq.com](https://console.groq.com/keys)
⚠️ Caution: Do not include your secret keys in the example .env.example file. Keep them private in your .env file.
- Create a Supabase account.
- Create a new project within Supabase.
- Navigate to Connect > ORMs.
- Under Tools, select Drizzle.
- Copy the database URL into the
DATABASE_URL
variable in your.env
file. - Enter the password you set for the project into your
.env
file.
- Go to GitHub Developers.
- Create a New OAuth App.
- Provide the following details:
- Homepage URL:
http://localhost:3000
- Authorization Callback URL:
http://localhost:3000/api/auth/callback/github
- Homepage URL:
- Copy the generated Client ID and paste it into
AUTH_GITHUB_ID
in your.env
file. - Copy the generated Client Secret and paste it into
AUTH_GITHUB_SECRET
in your.env
file.
-
Open your terminal in the project directory.
-
Run the following command to install any necessary packages:
npx auth
-
Generate the secret key by running:
npx auth secret
-
Copy and paste the generated key into
AUTH_SECRET
in your.env
file.
- Go to GROQ Console.
- Create a new account or sign in if you already have one.
- Navigate to the API Keys section in the dashboard.
- Click on Create API Key.
- Give your API key a name (e.g., "Nexus Spaces Development").
- Copy the generated API key.
- Paste the key into
GROQ_API_KEY
in your.env
file.
Note: Keep your API key secure and never commit it to version control.
-
Push the database schema to Supabase by running:
npm run db:push
Note: The
db:push
command synchronizes your Schema with your database schema without using migrations. This is particularly useful during prototyping and local development.
-
Start the development server by running:
npm run dev
-
Open your browser and navigate to:
If you encounter any issues during setup, double-check:
- Your
.env
file configuration. - That you’ve run
npm install
andnpm run db:push
correctly. - Your Supabase project setup.
For further assistance, refer to the official documentation of Supabase or Next.js.