forked from cerc-io/snowballtools-base
a684743bd6
### 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. --- |
||
---|---|---|
.. | ||
environments | ||
src | ||
test | ||
.eslintignore | ||
.eslintrc.json | ||
.gitignore | ||
.node-version | ||
.prettierignore | ||
.prettierrc.json | ||
package.json | ||
README.md | ||
tsconfig.json |
backend
This backend is a node.js express.js apollo server 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 envionments/local.toml.example
file to envionments/local.toml
:
cp envionments/local.toml.example envionments/local.toml
Staging environment variables
In the deployment repository, update staging staging/configmaps/config/prod.toml
Production environment variables
In the deployment repository, update production production/configmaps/config/prod.toml
Run development server
yarn start
Deployment
Clone the deployer repository:
git clone git@git.vdb.to:cerc-io/snowballtools-base-api-deployments.git
Staging
echo trigger >> .gitea/workflows/triggers/staging-deploy
git commit -a -m "Deploy v0.0.8" # replace with version number
git push
Production
echo trigger >> .gitea/workflows/triggers/production-deploy
git commit -a -m "Deploy v0.0.8" # replace with version number
git push
Deployment status
Dumb for now
Update version number manually in routes/staging.ts