Skip to content

uclaacm/opensource

Repository files navigation

open-source at acm (at ucla)

hello friends! this is a ~ top-secret ~ project that has three key goals:

  1. to showcase the open-source projects, events, and culture at acm at UCLA
  2. so that matt (@mattxwang) can test out Next.js (for possible use in other acm projects)!
  3. to test out WestwoodCSS, a CSS framework made by acm at ucla!

Eventually, matt's got bigger ideas - he'd love to showcase how awesome OSS is at UCLA!

Dev Notes

Setup

We use the typical node project workflow, but with yarn. To run a local dev copy,

$ git clone https://github.com/uclaacm/opensource.git # or use ssh!
...
$ cd opensource
...
$ yarn install
...
$ yarn dev
...

Stack

This app is built with Next.js, a framework built on top of React. We enforce Typescript throughout the project, and have a strict linter with ESLint - enforced as a pre-commit hook with Husky and lint-staged. The CSS framework used is an alpha version WestwoodCSS, ACM Design's own CSS framework!

We bootstrapped this app with create-next-app using the with-typescript-eslint-jest template. There are some other goodies too, like Prettier and Jest (the latter we'd use more seriously in production).

This app is deployed on Netlify using their Next.js plugin; in particular, this let's us (kind of) take advantage of ISR.

misc

Some small notes on how I've been writing the app so far:

  • I use octokit to wrap GitHub's API to get information about the uclaacm org. So far, all of this is ISR'd :)
  • WestwoodCSS is still in early alpha, so:
    • there is no documentation (other than reading the source file)
    • there is no guarantee of forwards-compatability with new versions of WestwoodCSS
  • so far, there is no unified types file; most component types live in the component file, and there is some relevant typing in util/types.ts
  • the mapping of event data to human-readable components in components/GitHubEventAction.tsx is manually done (and currently, manually typed). I haven't really looked into it, but...
    • I'm sure there are ways we can use the generated types for octokit to flesh out the event types, instead of manually picking/resolving fields
    • there may even be a way to programatically explore types and do the string generation in a much more natural way!
  • most of the actual copy isn't here yet! i'm mostly just fiddling with code :)

Want to give a quick shoutout to Bryan Pan of Creative Labs - he's been a big pusher of Next and a great friend to ACM!

Licensing

This code is under the MIT License, so you can generally use it as you see fit (including forking, copying, etc.). I would love to know if you did - send matt an email at matt@matthewwang.me.