-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the official SJSU Course Scheduler Front-End wiki!
Before jumping into the codebase, you should have experience with the following:
- Javascript, HTML, CSS
- React.JS
- Typescript
- Next.JS
- TailwindCSS
- Git
- Github
If you are not familiar with these technologies, please check out the following videos:
- Javascript Tetris Game
- React.JS Todo App
- Next.JS Learn
- How SSR Works
- TailwindCSS Design Systems
- Reviewing Pull Requests
- Responding to Code Reviews
For additional resources, please check out the Additional Resources section.
System Requirements:
- Node.js 18.17 or later.
- macOS, Windows (including WSL), and Linux are supported.
To install the project, follow these steps:
- Clone the repository:
git clone https://github.com/SJSUCSClub/course-scheduling-client
- Install the dependencies:
npm install
- Start the development server:
npm run dev
Create a .env.local
file in the root directory and add the following environment variables:
...
Make sure you have ESLint and Prettier installed in your code editor to maintain code quality. Any internal imports should be absolute imports from the @/
directory. The .vscode
directory contains the recommended settings for VSCode. If you are using a different code editor, please configure it to match the settings in .vscode/settings.json
.
The project is structured as follows:
.
├── app/
│ ├── auth
│ ├── mock-api
│ ├── global.css
│ └── ...
├── components
├── assets
├── hooks/
│ ├── use-paginated-items.ts
│ └── use-wrapped-request.ts
├── utils/
│ ├── fake-fetch.ts
│ ├── get-customizable-components.tsx
│ ├── get-evaluation.ts
│ ├── get-paginated-items.ts
│ └── ...
├── types/
│ ├── api
│ ├── database.ts
│ └── general.ts
└── ...
The Next.JS application is located in the app/
directory. This directory contains the following subdirectories:
-
auth/
: Contains NextAuth.js authentication logic. -
mock-api/
: Contains mock API endpoints for development. Learn how to create a mock API on the Tutorials page. -
global.css
: Contains global CSS styles and color variables.
The components/
directory contains all the reusable components used throughout the application. Each component should be a self-contained unit that can be reused in different parts of the application. Organize components by their functionality. Any component that is used in multiple places should be placed in the components/
directory. If a component is only used in a single place, it should be placed in the same directory as the page that uses it.
The assets/
directory contains all the static assets used in the application, such as images, fonts, and icons.
The hooks/
directory contains custom hooks used throughout the application. The following hooks are currently available for use:
-
use-paginated-items.ts
: A custom hook that fetches paginated items from the API. The hook takes initial data and a fetch function as arguments. The initial data is used as initial state when the data is first fetched from the Next.js server. -
use-wrapped-request.ts
: A custom hook that wraps thefetch
function with error handling and loading states. The hook returns the data, error, and loading states.
The utils/
directory contains utility functions used throughout the application. The following utility functions are currently available for use:
-
fake-fetch.ts
: A fake fetch function that simulates a network request. This function is used for testing purposes. -
get-customizable-components.tsx
: If you want to create a component with overridable container props, this utility allows you to encapsulate custom props and container props seperately. It's not required to use this utility, but it can be helpful for creating more customizable components. -
get-evaluation.ts
: A function that assesses input to rendergood
,ok
, orbad
color indicators based on its value.
The types/
directory contains TypeScript type definitions used throughout the application. The following type definitions are currently available for use:
-
api/
: Contains type definitions for API responses. File structure should mirror theapp/mock-api/
directory. Each route can export a type definition for the RouteResponse, RouteParams, and RouteBody. Prefer to build as much of a type using thedatabase.ts
orgeneral.ts
types as possible. -
database.ts
: Contains type definitions for the database schema. Each table should have a corresponding type definition. Any exports indatabase.ts
should only be used in thetypes/api/
types. -
general.ts
: A file for shared type definitions reused across the application, meant for general types not specific to any module.
Please read all of these pages upon joining the team.
...
Here are some additional resources:
If you need help, please reach out to the project maintainers on discord. We are happy to help you with any questions you may have.