-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# NPO Template Merged | ||
|
||
A simple React, Vite, and Node.js monorepo built with Yarn workspaces. Uses Firebase for authentication, Chakra UI for components, and your choice of database (i.e. Postgres). | ||
|
||
## Getting Started | ||
|
||
### 1. Clone this repository, then `cd` into the directory | ||
|
||
```shell | ||
> git clone https://github.com/ctc-uci/YOUR-REPO.git | ||
> cd YOUR-REPO | ||
``` | ||
|
||
> [!TIP] | ||
> `npo-template-merged` is a template repository. [You can create a copy through Github.](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) | ||
### 2. Install dependencies | ||
|
||
Install [Node.js, version 18.20.4)](https://nodejs.org/en/download/package-manager). | ||
|
||
> [!TIP] | ||
> On MacOS and Linux, installing Node with `nvm` is recommended! | ||
Install [Yarn](https://classic.yarnpkg.com/lang/en/), our package manager of choice. | ||
|
||
```shell | ||
> npm install --global yarn | ||
``` | ||
|
||
Now, install packages: | ||
|
||
```shell | ||
> yarn install | ||
``` | ||
|
||
> [!TIP] | ||
> This monorepo uses [Yarn Workspaces](https://classic.yarnpkg.com/lang/en/docs/workspaces/) to manage dependencies across repositories. Unless you know what you're doing, you should install dependencies (`yarn install`) at the root of the repository (i.e. not in `/client` or `/server`). | ||
> | ||
> However, you should add _new_ dependencies (`yarn add`) in the directory which actually uses them. | ||
### 3. Get environment secrets | ||
|
||
Both the `client` and `server` directories have their own `env.local` and `.env` files, respectively. If you're a general member, these secrets should be provided to you by your tech leads. | ||
|
||
**Client** | ||
|
||
The `client` `.env` consists primarily of your Firebase secrets. An example is provided in `/client/.env.example`. Copy the contents into a new file named `.env`, then fill in the keys with the appropriate values. | ||
|
||
> [!TIP] | ||
> The code block below is an example of what your `.env` should (partially) look like. | ||
```shell | ||
VITE_FIREBASE_APIKEY=my-api-key | ||
VITE_FIREBASE_AUTHDOMAIN=localhost:3000 | ||
VITE_FIREBASE_PROJECTID=my-project-id | ||
... | ||
``` | ||
|
||
> [!CAUTION] | ||
> Due to recent changes to 3rd party cookies, `VITE_FIREBASE_AUTHDOMAIN` should point to where you're currently running your project (whether that be locally or deployed), and **not** the typically Firebase-provided auth domain. | ||
```shell | ||
+ VITE_FIREBASE_AUTHDOMAIN=localhost:3000 | ||
- VITE_FIREBASE_AUTHDOMAIN=my-project.firebaseapp.com | ||
``` | ||
Examples of what your secrets should look like are provided in `client/.env.example` and `server/.env.example`. | ||
|
||
**Server** | ||
|
||
The `server` `.env` consists primarily of your database secrets. An example is provided in `/server/.env.example`. Copy the contents into a new file named `.env`, then fill in the keys with the appropriate values. | ||
|
||
### 4. Start developing! | ||
|
||
Start the development server by running this command: | ||
|
||
```shell | ||
yarn run dev | ||
``` |