Lansing Codes is a website of resources for coders and other tech enthusiasts in and around Lansing, Michigan.
These resources include a calendar of tech events, a list of meetup groups, local beginner-friendly resources, shout-outs of our gracious sponsors, and other ways to get involved in the Lansing tech community.
This repository combines the frontend and data-sync backend into a single Next.js application deployed to Netlify.
All participants are expected to treat others with respect and follow our Code of Conduct.
For general support, direct your questions to the Lansing Codes Slack team. The issue list for this project is exclusively for bug reports and feature requests.
If you want to run this website and make changes to it on your computer, some initial setup is required.
- git
- Node.js 20+ — nvm is recommended for macOS/Linux users
- Visual Studio Code with these extensions:
Fork the repository on GitHub, then clone your fork:
git clone https://github.com/YOUR_USERNAME/website.git
cd websiteOr clone the main repository directly if you have commit access:
git clone https://github.com/lansingcodes/website.git
cd websitenpm installCopy the example environment file:
cp .env.local.example .env.localThen fill in the values as described below.
This app uses the Firebase Admin SDK to read and write Firestore data server-side. Each developer sets up their own Firebase project for local development.
1. Create a Firebase project
- Go to the Firebase Console and sign in with a Google account.
- Click Add project, give it a name (e.g.
lansing-codes-dev), and follow the prompts. You can disable Google Analytics when asked.
2. Enable Firestore
- In the left sidebar, click Firestore Database (under Databases).
- Click Create database.
- Choose Start in test mode for local development, then click Next.
- Pick any region and click Enable.
3. Get service account credentials
- In the left sidebar, click Settings (the gear icon).
- From the dropdown, click Service accounts.
- Scroll down and click Generate new private key, then confirm. A JSON file will download to your computer.
- Open the downloaded JSON file. Copy these three fields into
.env.local:
# "project_id" in the JSON
FIREBASE_PROJECT_ID=lansingcodes-dev-36daf
# "client_email" in the JSON
FIREBASE_CLIENT_EMAIL=firebase-adminsdk-xxxxx@lansingcodes-dev-36daf.iam.gserviceaccount.com
# "private_key" in the JSON — paste the full value wrapped in double quotes
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nMIIE...\n-----END PRIVATE KEY-----\n"The private_key value in the JSON already contains \n sequences — just
copy it as-is and wrap it in double quotes. Do not expand the \n into real
newlines.
| Variable | Description |
|---|---|
SYNC_SECRET |
A random string used to protect the /api/sync/* routes. Generate one with openssl rand -base64 32. |
NEXT_PUBLIC_BASE_URL |
Public URL of the site. Use http://localhost:3000 for local development. |
npm run devOpen http://localhost:3000 in your browser to see the site. The page will reload automatically as you edit files.
Note: The site will look empty until you sync data (next step). That's normal — the events, groups, and sponsors all come from Firestore.
The site reads event, group, and sponsor data from Firebase Firestore. Your Firestore database starts empty, so you need to populate it. With the dev server running, open a second terminal and run:
npm run syncThis scrapes Meetup iCal feeds and writes events, groups, and sponsors to your Firestore database. Refresh the browser and you should see the full site.
You can also sync individual collections:
npm run sync:events # just events
npm run sync:groups # just groups
npm run sync:sponsors # just sponsorsThese scripts automatically read SYNC_SECRET from your .env.local file.
Build for production (also runs TypeScript type checking):
npm run buildVerify your code passes linting rules:
npm run lintAfter a pull request is reviewed and merged to main, Netlify automatically
builds and publishes the site. The Netlify scheduled function runs every 2 hours
to sync the latest Meetup events into Firestore.
For both staging and production, Netlify runs npm run build and deploys the
resulting .next directory via @netlify/plugin-nextjs.
"Firebase credentials are missing" error on startup
Make sure all three FIREBASE_* variables are set in .env.local. The
FIREBASE_PRIVATE_KEY value must be wrapped in double quotes.
Sync returns 401 Unauthorized
Check that SYNC_SECRET in .env.local matches what the sync scripts send.
Regenerate it with openssl rand -base64 32 if needed, and restart the dev
server after changing .env.local.
Node version errors
This project requires Node.js 20 or later. Check your version with
node --version. If you use nvm, run nvm install 20 and nvm use 20.
Site looks empty after starting dev server
You need to sync data first. Run npm run sync in a second terminal while the
dev server is running (see Syncing data above).
You are welcome and encouraged to make changes to this website by submitting pull requests or forking our code to make your own community website! See the Contributing Guide for details.
Copyright (c) 2015-Present, Humanity Codes LLC