snowballtools-base/packages/frontend
Vivian Phung a684743bd6
feat(template projects): generate git repo on backend (#218)
### TL;DR

- Still cretaes app if user migrates from page

The PR introduces a new `AddProjectFromTemplate` mutation to facilitate project creation using a repository template. This change centralizes the template project creation logic within the backend, improving code maintainability by removing redundant client-side code.

### What changed?
- Added `AddProjectFromTemplate` input type in `schema.gql` and corresponding TypeScript interfaces.
- Implemented `addProjectFromTemplate` resolver with error handling and Octokit integration for repository creation.
- Updated `service.ts` to include the new `addProjectFromTemplate` method.
- Created new GraphQL `Mutation` for `addProjectFromTemplate` in the GraphQL schema.
- Adjusted the client-side GQLClient to support the new mutation.
- Modified frontend to utilize the new backend mutation for project creation from a template.

### How to test?
1. Ensure your backend server is running.
2. Use a GraphQL client like Postman to call the `addProjectFromTemplate` mutation with appropriate input.
3. Verify that the new project is created using the specified template, and appropriate error messages are returned for failures.
4. Check the frontend flow for creating a project from a template to ensure it is working correctly.

### Why make this change?
This change enhances code maintainability by centralizing template project creation logic within the backend, thereby reducing redundancy and potential inconsistencies in client-side implementations.

---
2024-06-24 18:38:01 -04:00
..
.storybook chore(storybook): icons to correct folder (#216) 2024-06-22 17:27:37 -04:00
public format prettier 2024-05-09 16:18:52 -04:00
src feat(template projects): generate git repo on backend (#218) 2024-06-24 18:38:01 -04:00
.env.example chore(storybook): icons to correct folder (#216) 2024-06-22 17:27:37 -04:00
.eslintrc.cjs storybook 2024-05-09 16:22:03 -04:00
.gitignore storybook 2024-05-09 16:22:03 -04:00
.node-version Switch from cra to vite 2024-04-11 21:48:58 -05:00
.prettierignore Add dist/ to .prettierignore (#195) 2024-05-22 14:50:37 -04:00
.prettierrc.json Create react app with tailwind, typescript, eslint and prettier (#4) 2023-12-08 10:50:55 +05:30
chromatic.config.json storybook 2024-05-09 16:22:03 -04:00
index.html Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
package.json [1/n][Storybook] Settings (#72) 2024-05-16 20:33:33 -04:00
postcss.config.js Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
README.md fix(readme) 2024-06-24 15:00:45 -04:00
reload-dev.sh Fix dev script 2024-05-02 15:47:23 -05:00
tailwind.config.js fix duplicate styling (#67) 2024-05-16 20:16:31 -04:00
tsconfig.json resolve aliases 2024-05-14 13:27:23 -04:00
tsconfig.node.json Switch from cra to vite 2024-04-11 21:48:58 -05:00
vite.config.ts Log commit hash 2024-06-04 15:56:52 -05:00

frontend

This is a vite react nextjs project in a yarn workspace.

Getting Started

Install dependencies

In the root of the project, run:

yarn

Build backend

yarn build --ignore frontend

Environment variables

Local

Copy the .env.example file to .env:

cp .env.example .env

Staging environment variables

Change in deployer/deploy-frontend.staging.sh

Production environment variables

Change in deployer/deploy-frontend.sh

Run development server

yarn dev

Deployment

From the root of the project, run:

Staging

cd packages/deployer && ./deploy-frontend.staging.sh

Production

cd packages/deployer && ./deploy-frontend.sh

Deployment status

Check the status of the deployment here