-
Notifications
You must be signed in to change notification settings - Fork 4
Getting Started with Advanced Development
The .env file is used to store sensitive information such as API keys and database credentials. The .env file is not included in the repository for security reasons. You will need to create your own .env file in the root directory of the project. The .env file can copy the .env.example file in the root of the project and should contain the following information:
# Required
BLUE_ALLIANCE_API_KEY="key"
FIRST_API_KEY="key"
# Optional
DATABASE_URL=http://
NEXT_PUBLIC_SECRET="key"
NEXTAUTH_URL=http://localhost:3000/api/auth
GOOGLE_CLIENT_ID="key"
GOOGLE_CLIENT_SECRET="key"
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY="key"
GITHUB_CLIENT_ID="key"
GITHUB_CLIENT_SECRET="key"
It is your responsibility to fill out the .env file with the correct information. The following sections will explain where to acquire the necessary API keys and how to set up the database.
The Blue Alliance API key is used to access the Blue Alliance API. You can get a Blue Alliance API key by creating an account on The Blue Alliance. Once you have created an account, you can find your API key on at thebluealliance.com
The FRC Events API key is used to access the FRC Events read only API. You can get an FRC Events API key by creating an account on frc-events.firstinspires.org. Once you have created an account, you need to request an API key from frc-events.firstinspires.org. and confirm your email address. Once you have confirmed your email address, you will be sent an API key within 24 hours.
Please note that you need to take your FRC events API key and base64 encode it you can do so through many methods but a simple online encoder is available at base64encode.org.
The Google Maps API key is used to access the Google Maps API. You can get a Google Maps API key by creating a project on Google Cloud Platform. Once you have created a project, you can find your API key on the Google Cloud Platform dashboard. You will also need to enable the following maps API and sign up for a billing account.
The Google OAuth credentials are used to allow users to sign in with Google. You can get Google OAuth credentials by creating a Google OAuth app on Google Cloud Platform. Once you have created a Google OAuth app, you can find your client ID and client secret on the Google Cloud Platform dashboard.
The GitHub OAuth credentials are used to allow users to sign in with GitHub. You can get GitHub OAuth credentials by creating a GitHub OAuth app on GitHub under your account settings navigate to developer settings and click on OAuth Apps. Once you have created a GitHub OAuth app, you can find your client ID and client secret on the OAuth Apps page.
The NextAuth URL is used to redirect users to the correct URL after signing in. The NextAuth URL should be in the following format:
http://localhost:3000/api/auth
But may be changed if you are running a production build.
The database URL is used to connect to the database. You can get a database URL by creating a database on PostgreSQL. Once you have created a database, you can find your database URL on the database dashboard. The database URL should be in the following format:
postgres://username:password@host:port/database
Note: Be sure to run the npx prisma db push
command afterward, to synchronize your Prisma schema with your database schema.
GitHub Actions are used to automate the build and deployment process. The GitHub Actions are located in the ".github/workflows" directory. The GitHub Actions are configured to run on every push to the main branch. The GitHub Actions are configured to run the following jobs:
- Linting the code for formatting issues including Markdown files
- Running security checks and reporting any vulnerabilities