The project is built with:
- Vite React
- TailwindCSS
Clone the repository using your preferred method.
git clone [email protected]:hubba-lubba/hubba.git
Install packages:
npm i
Run the dev environment:
npm run dev
Then visit the url printed in the terminal. Default is http://localhost:5173/.
We use Prettier to keep our code pretty formatted consistently for seamless collaboration. Make sure this is done!
- In vscode, install the Prettier extension.
- Head to
File > Preferences > Settings
- Search for "default formatter"
- Set your
Editor: Default Formatter
toPrettier - Code formatter
- Now, everytime you save with
Ctrl+s
, you should see your filthy code glow up~
We'll be following the linked directory structures in our code. Please review them:
In short:
@/components
: reusable components (buttons, form fields)@/features
: specific pages and features- each feature will contain its own directory structure of components, api, routes, and types
@/assets
: assets like pdfs and images@/config
: clientside secrets to be exported for use@/contexts
: react contexts@/lib
: clientside api functions@/pages
: a temporary folder for Home. Will be replaced by proper implementation of@/features
.@/routes
: high-level page routing (aka middleware)@/types
: types for object data, likeuser
ororganization
. Not for React Header types.@/utils
: for any custom javascript or react utilities
- To modularize components and export the ones we need to be used globally, we have an
index.ts
in some directories.- When creating new components or functions that may need to be used globally, please export them in
index.ts
. - Don't include them in
index.ts
if they are only to be used in their local scope and nowhere else.
- When creating new components or functions that may need to be used globally, please export them in
- Scopes are primarily folder-based, then can be category based according to our implementation. So each
/features/*/routes/
is its own scope, while/features/
and/features/auth/
are also their own scopes. - Use the
@
symbol instead relative path to reference components far from current scope. The@
symbol basically just replaces/src
.- For example, if I'm accessing a
Button
component from@/features/components/SigninForm
, I'll useimport @/components/buttons
instead ofimport ../../components/buttons
- For example, if I'm accessing a
- Use relative path instead of
@
when dealing with components from current scope.- For example, if I'm accessing
@/features/components/SignupForm
from@/features/components/Layout
, I'll useimport ./SignupForm
instead ofimport @/features/auth/components/SignupForm
.- Failing to do this may also result in errors - in our example, SigninForm is locally scoped and not exported, so the compiler will whine about not being able t find
@/features/auth/components/SignupForm
.
- Failing to do this may also result in errors - in our example, SigninForm is locally scoped and not exported, so the compiler will whine about not being able t find
- For example, if I'm accessing
Our theme variables are specified in tailwind.config.js
. Use those instead of hardcoding colors.
We didn't bother integrating Twitch and YouTube API for our MVP (costs and keys). Currently, we simply utilize Twitch embeds and a third-party YouTube thumbnail and title service called "Noembed." Please Integrate the Twitch and Youtube API for authorization, extended capabilities, and more features. Should prolly all be done in the backend though.
Our primary goal was a fully functional website fulfilling the 'discovery' aspect of the business value proposition, with passable UI design. There will be shitty looking pages and some UI bugs (I think pfps can be non-circular rn) that I'll leave to our dear successors. Also, several TODOs can be found within the project code that should be addressed, as well as shitty repeated code that I couldn't bother to modularize due to time constraints, like the settings pages or api calls.
Please develop your own environment variables and api keys. For this app, we only use the Firebase API for Auth.
Here is an example .env.local
file:
VITE_FIREBASE_CONFIG='{
"apiKey": "your api key",
"authDomain": "your auth domain",
"projectId": "your project id",
"storageBucket": "your storage bucket",
"messagingSenderId": "some numbers",
"appId": "some letters and numbers"
}'
That's it. Good luck.