This document provides step-by-step instructions for setting up the GoalPost prototype on your local machine.
The prototype is built using Next.js, Neo4j, and includes optional AI features powered by OpenAI.
Before setting up GoalPost, make sure you have:
- Node.js (v18 or higher)
- Git
- Free accounts with:
- OpenAI (if using optional AI features)
- Neo4j Aura
- Resend (for email functionality)
git clone https://github.com/rdamashek/GoalPost.git
cd GoalPost
npm install- Create a Neo4j Aura account and log in
- Create a new free database
- When the database is ready, find and note your:
- Database URI (e.g.,
neo4j+s://xxxxxxxx.databases.neo4j.io) - Username (default:
neo4j) - Password (generated by Aura)
- Database URI (e.g.,
- Create or log in to your OpenAI account
- Navigate to https://platform.openai.com/api-keys
- Create a new API key and note it
- Create or log in to your Resend account at https://resend.com/
- Navigate to the API Keys section in your dashboard
- Create a new API key and note it
Create a .env.local file in the project root directory (use the .env.example file as a template).
-
JWT_SECRET: Used for signing and verifying JSON Web Tokens for authentication.
- For local development, generate a strong random string:
Copy the output and use it as your
openssl rand -base64 64
JWT_SECRETin.env.local. - For production, ensure you use a cryptographically secure random string.
- For local development, generate a strong random string:
-
PEPPER: Generate a random string (at least 32 characters). You can use
openssl rand -base64 32or an online password generator. Example:openssl rand -base64 32
Copy the output and use it as the value for
PEPPERin your.env.local. -
NEXT_PUBLIC_EMAIL_FROM: Set this to the email sender you want for transactional emails. Example:
NEXT_PUBLIC_EMAIL_FROM="Goalpost <info@goalpost.earth>"
-
NEXT_PUBLIC_BASE_URL: Set this to your local or production base URL. For local development, use:
NEXT_PUBLIC_BASE_URL=http://localhost:3000
-
RESEND_API_KEY: Required for sending transactional emails via the Resend email service. To obtain a key:
- Go to https://resend.com/ and sign up or log in.
- Navigate to the API Keys section in your Resend dashboard.
- Create a new API key and copy it.
- Add it to your
.env.localas:RESEND_API_KEY=your-resend-api-key
Run the initialization script to populate your Neo4j database if you want to use the seed data:
npm run init:dbnpm run devThe application should now be running at http://localhost:3000.
The application uses a custom JWT-based authentication system with the following features:
- User registration and login
- Password reset functionality via email
- JWT token-based session management
- Automatic token refresh
- Secure logout
Users can sign up with an email and password, and the system handles password hashing, token generation, and email verification for password resets.
If you want to deploy your application to Vercel, follow these steps:
- Create a Vercel account and log in
- Connect your GitHub repository to Vercel
- Configure the environment variables in your Vercel project settings
- Deploy your application
To enable AI features, make sure to set the OPENAI_API_KEY in your .env.local file. There is a toggle in the sidebar that will enable or disable the AI features. The AI features are currently in development and may not be fully functional.
### NOTE: The prototype is a work in progress and may not include all features or be fully functional. It is intended for demonstration purposes only. Please report any issues or suggestions to the repository's issue tracker.