Skip to content

Commit

Permalink
chore: project rename
Browse files Browse the repository at this point in the history
  • Loading branch information
tericcabrel committed Nov 1, 2023
1 parent 0f8a8ff commit 7d0d781
Show file tree
Hide file tree
Showing 143 changed files with 379 additions and 390 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"space-in-parens": "warn",
"no-multiple-empty-lines": "warn",
"prefer-const": "warn",
"no-use-before-define": "warn",
"no-use-before-define": "error",
"max-len": [
"warn", 120, {
"ignoreComments": true,
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/-bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Bug Report
description: Create a bug report for the Sharingan team
description: Create a bug report for the Snipcode team
labels: "template: bug"
body:
- type: markdown
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Sharingan Build
name: Snipcode Build
on:
pull_request:
branches: [ main ]
Expand All @@ -24,10 +24,10 @@ jobs:
CONVERTKIT_FORM_ID: form_id
steps:
- uses: actions/checkout@v3
- name: Set up Node 16
- name: Set up Node 18
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '18'

- name: Install projects dependencies
uses: bahmutov/npm-install@v1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-code-embed.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Sharingan Deploy Code Embed
name: Snipcode Deploy Code Embed
on:
push:
branches:
Expand Down Expand Up @@ -26,10 +26,10 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- uses: actions/checkout@v3
- name: Set up Node 16
- name: Set up Node 18
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '18'

- name: Install projects dependencies
uses: bahmutov/npm-install@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-core.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Sharingan Deploy Core
name: Snipcode Deploy Core
on:
push:
branches:
Expand Down Expand Up @@ -26,7 +26,7 @@ jobs:
env:
REGISTRY: public.ecr.aws/x9y5g9l2
REGION: us-east-1 # Public ECR aren't region specific
REPOSITORY: ${{ (github.ref == 'refs/heads/main' && 'sharingan') || 'sharingan-dev' }}
REPOSITORY: ${{ (github.ref == 'refs/heads/main' && 'snipcode') || 'snipcode-dev' }}
IMAGE_TAG: latest
run: |
aws ecr-public get-login-password --region $REGION | docker login --username AWS --password-stdin $REGISTRY
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-embed.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Sharingan embed assets to npmjs
name: Publish Snipcode embed assets to npmjs
on:
push:
branches: [main]
Expand All @@ -14,7 +14,7 @@ jobs:
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'

- name: Install projects dependencies
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sentry-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node 16
- name: Set up Node 18
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '18'

- name: Install projects dependencies
uses: bahmutov/npm-install@v1

- name: Generate sourcemaps from build
run: yarn build:prod --filter=@sharingan/core
run: yarn build:prod --filter=@snipcode/core

- name: Create a Sentry release
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: sharingan
SENTRY_ORG: snipcode
SENTRY_PROJECT: backend
VERSION: ${{ github.sha }}
run: |
Expand Down
Empty file added .husky/_/.gitignore
Empty file.
Empty file added .husky/_/husky.sh
Empty file.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.17.1
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to Sharingan
# Contributing to Snipcode
We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:

- Reporting a bug
Expand All @@ -9,7 +9,7 @@ We love your input! We want to make contributing to this project as easy and tra
## Local Setup
Follow the instructions in the page below to set up the project on your local environment

[Set up Sharingan Locally](https://github.com/tericcabrel/sharingan/wiki/Local-setup)
[Set up Snipcode Locally](https://github.com/tericcabrel/snipcode/wiki/Local-setup)

## Pick an existing issue to contribute
Add a comment on the issue and wait for the issue to be assigned before you start working on it. This helps to avoid multiple people working on similar issues.
Expand All @@ -32,8 +32,8 @@ We actively welcome your pull requests, below is the process to add a change:
## Contributions License
When you submit code changes, your submissions are understood to be under the same [MIT License](https://opensource.org/licenses/MIT) that covers the project.

## Report bugs using GitHub's [issues](https://github.com/tericcabrel/sharingan/issues)
We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/tericcabrel/sharingan/issues/new). It's that easy!
## Report bugs using GitHub's [issues](https://github.com/tericcabrel/snipcode/issues)
We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/tericcabrel/snipcode/issues/new). It's that easy!

**Great Bug Reports** tend to have:

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Sharingan
# Snipcode

Sharingan is an open-source code-sharing platform that makes it easy to create code snippets and sharing it with the world.
Snipcode is an open-source code-sharing platform that makes it easy to create code snippets and sharing it with the world.

[![Website](https://sharingan.dev/assets/og.png)](https://sharingan.dev)
[![Website](https://snipcode.dev/assets/og.png)](https://snipcode.dev)


## Key Features
Expand All @@ -24,7 +24,7 @@ Sharingan is an open-source code-sharing platform that makes it easy to create c

## Project Structure
```text
sharingan
snipcode
├─ apps
│ ├─ core
│ ├─ functions
Expand All @@ -45,7 +45,7 @@ vercel.json
```

## Contributing
Kindly read our [Contributing Guide](./CONTRIBUTING.md) to learn and understand about our development process, how to propose bug fixes and improvements, and how to build and test your changes to Sharingan.
Kindly read our [Contributing Guide](./CONTRIBUTING.md) to learn and understand about our development process, how to propose bug fixes and improvements, and how to build and test your changes to Snipcode.

## License

Expand Down
2 changes: 1 addition & 1 deletion apps/core/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ NODE_ENV=development
HOST=http://localhost
PORT=7501
ENABLE_INTROSPECTION=true
DATABASE_URL="mysql://root:@127.0.0.1:3311/sharingan"
DATABASE_URL="mysql://root:@127.0.0.1:3311/snipcode"
ADMIN_PASSWORD=nwHSvXuQxjey43Bp
CONVERTKIT_API_KEY=convertKitApiKey
CONVERTKIT_FORM_ID=formId
Expand Down
6 changes: 3 additions & 3 deletions apps/core/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16-buster as builder
FROM node:18-buster as builder

RUN mkdir app

Expand All @@ -14,7 +14,7 @@ WORKDIR /app/apps/core

RUN yarn build:prod

FROM node:16-alpine as schema-builder
FROM node:18-alpine as schema-builder

WORKDIR /app

Expand All @@ -24,7 +24,7 @@ COPY --chown=node:node --from=builder /app/packages/database/prisma/schema.prism
RUN npx prisma generate --schema=./app/prisma/schema.prisma


FROM node:16-alpine AS sharingan
FROM node:18-alpine AS snipcode

ENV NODE_ENV=production

Expand Down
12 changes: 6 additions & 6 deletions apps/core/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sharingan Core
# Snipcode Core

This is the core backend of Sharingan. All the business logic behind this application is implemented here.
This is the core backend of Snipcode. All the business logic behind this application is implemented here.

## Tech Stack
* Node.js
Expand All @@ -21,10 +21,10 @@ We use Yarn workspace to create packages we can share with other applications.
These packages are located in the folder `packages`, so you might need to change the code of one or many packages to implement a feature.
Here are the packages used in this project:

* [@sharingan/database](../../packages/database)
* [@sharingan/domain](../../packages/domain)
* [@sharingan/logger](../../packages/logger)
* [@sharingan/utils](../../packages/utils)
* [@snipcode/database](../../packages/database)
* [@snipcode/domain](../../packages/domain)
* [@snipcode/logger](../../packages/logger)
* [@snipcode/utils](../../packages/utils)

## Set up the project
Delete the existing folders output from build commands
Expand Down
6 changes: 3 additions & 3 deletions apps/core/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ start=$(date +"%s")
DOCKER_IMAGE_TAG=$IMAGE_TAG

ssh -p ${SPORT} ${SUSER}@${SNAME} -i key.txt -t -t -o StrictHostKeyChecking=no << ENDSSH
cd sharingan
cd snipcode
docker pull $DOCKER_IMAGE_TAG
API_CONTAINER_NAME=sharingan-core
API_CONTAINER_NAME=snipcode-core
if [ "$(docker ps -qa -f name=\$API_CONTAINER_NAME)" ]; then
if [ "$(docker ps -q -f name=\$API_CONTAINER_NAME)" ]; then
echo "[API] Container is running -> stopping it..."
Expand All @@ -18,7 +18,7 @@ if [ "$(docker ps -qa -f name=\$API_CONTAINER_NAME)" ]; then
docker rm \$API_CONTAINER_NAME;
fi
docker run -d -p 7501:7501 -v $(pwd)/logs:/app/logs --name sharingan-core --rm --env-file .env $DOCKER_IMAGE_TAG
docker run -d -p 7501:7501 -v $(pwd)/logs:/app/logs --name snipcode-core --rm --env-file .env $DOCKER_IMAGE_TAG
exit
ENDSSH
Expand Down
14 changes: 7 additions & 7 deletions apps/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sharingan/core",
"name": "@snipcode/core",
"version": "1.0.1",
"description": "Sharingan core backend",
"description": "Snipcode core backend",
"main": "dist/index.js",
"license": "MIT",
"scripts": {
Expand All @@ -15,11 +15,11 @@
},
"dependencies": {
"@graphql-tools/schema": "^8.5.0",
"@sharingan/database": "*",
"@sharingan/domain": "*",
"@sharingan/embed": "*",
"@sharingan/logger": "*",
"@sharingan/utils": "*",
"@snipcode/database": "*",
"@snipcode/domain": "*",
"@snipcode/embed": "*",
"@snipcode/logger": "*",
"@snipcode/utils": "*",
"apollo-server-core": "^3.9.0",
"apollo-server-express": "^3.9.0",
"axios": "^0.27.2",
Expand Down
2 changes: 1 addition & 1 deletion apps/core/src/configs/authentication.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { errors } from '@sharingan/utils';
import { errors } from '@snipcode/utils';

import { AppContext } from '../types/common';
import AppError from '../utils/errors/app-error';
Expand Down
2 changes: 1 addition & 1 deletion apps/core/src/configs/env.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getEnv } from '@sharingan/utils';
import { getEnv } from '@snipcode/utils';
import dotenv from 'dotenv';

import { AppEnvironmentVariables } from '../types/common';
Expand Down
2 changes: 1 addition & 1 deletion apps/core/src/configs/logger.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import { fileLogger } from '@sharingan/logger';
import { fileLogger } from '@snipcode/logger';

import { env } from './env';

Expand Down
2 changes: 1 addition & 1 deletion apps/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import http from 'http';

import { dbClient } from '@sharingan/database';
import { dbClient } from '@snipcode/database';
import express from 'express';

import { env } from './configs/env';
Expand Down
6 changes: 3 additions & 3 deletions apps/core/src/resources/authentication/handlers/github.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { User } from '@sharingan/database';
import { User } from '@snipcode/database';
import {
CreateUserDto,
CreateUserRootFolderDto,
UpdateUserDto,
folderService,
roleService,
userService,
} from '@sharingan/domain';
import { errors } from '@sharingan/utils';
} from '@snipcode/domain';
import { errors } from '@snipcode/utils';
import { AxiosRequestConfig } from 'axios';
import { Response } from 'express';

Expand Down
2 changes: 1 addition & 1 deletion apps/core/src/resources/folders/mutations/create-folder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CreateFolderDto } from '@sharingan/domain';
import { CreateFolderDto } from '@snipcode/domain';

import { getAuthenticatedUser } from '../../../configs/authentication';
import { logger } from '../../../configs/logger';
Expand Down
2 changes: 1 addition & 1 deletion apps/core/src/resources/folders/mutations/update-folder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UpdateFolderDto } from '@sharingan/domain';
import { UpdateFolderDto } from '@snipcode/domain';

import { getAuthenticatedUser } from '../../../configs/authentication';
import { logger } from '../../../configs/logger';
Expand Down
2 changes: 1 addition & 1 deletion apps/core/src/resources/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const resolvers: Resolvers = {
authenticatedUser,
findFolder,
findSnippet,
hello: () => 'Hello from Sharingan',
hello: () => 'Hello from Snipcode',
listDirectory,
listFolders,
mySnippets,
Expand Down
4 changes: 2 additions & 2 deletions apps/core/src/resources/snippets/handlers/generate-oembed.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { snippetService } from '@sharingan/domain';
import { generateOembedMetadata } from '@sharingan/embed';
import { snippetService } from '@snipcode/domain';
import { generateOembedMetadata } from '@snipcode/embed';
import { Request, Response } from 'express';

import { env } from '../../../configs/env';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CreateSnippetDto } from '@sharingan/domain';
import { CreateSnippetDto } from '@snipcode/domain';

import { getAuthenticatedUser } from '../../../configs/authentication';
import { logger } from '../../../configs/logger';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DeleteSnippetDto } from '@sharingan/domain';
import { DeleteSnippetDto } from '@snipcode/domain';

import { getAuthenticatedUser } from '../../../configs/authentication';
import { logger } from '../../../configs/logger';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UpdateSnippetDto } from '@sharingan/domain';
import { UpdateSnippetDto } from '@snipcode/domain';

import { getAuthenticatedUser } from '../../../configs/authentication';
import { logger } from '../../../configs/logger';
Expand Down
2 changes: 1 addition & 1 deletion apps/core/src/resources/types/date.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { errors } from '@sharingan/utils';
import { errors } from '@snipcode/utils';
import { ApolloError } from 'apollo-server-express';
import { GraphQLScalarType, Kind } from 'graphql';

Expand Down
2 changes: 1 addition & 1 deletion apps/core/src/resources/users/mutations/signup-user.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CreateUserDto, CreateUserRootFolderDto } from '@sharingan/domain';
import { CreateUserDto, CreateUserRootFolderDto } from '@snipcode/domain';

import { logger } from '../../../configs/logger';
import { MutationResolvers } from '../../../types/graphql';
Expand Down
2 changes: 1 addition & 1 deletion apps/core/src/server/config/build-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
sessionService,
snippetService,
userService,
} from '@sharingan/domain';
} from '@snipcode/domain';
import { Request, Response } from 'express';

import { env } from '../../configs/env';
Expand Down
2 changes: 1 addition & 1 deletion apps/core/src/server/middleware/error-middleware.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { errors } from '@sharingan/utils';
import { errors } from '@snipcode/utils';
import { NextFunction, Request, Response } from 'express';

import { logger } from '../../configs/logger';
Expand Down
Loading

0 comments on commit 7d0d781

Please sign in to comment.