-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite with sidebase #41
base: main
Are you sure you want to change the base?
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove sidebase related stuff / replace it with old stuff where applicable (e.g.: main readme)
@@ -0,0 +1,41 @@ | |||
name: "\U0001F41E Bug report" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove these templates
@@ -1,18 +1,65 @@ | |||
# is-this-an-mlm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please:
- keep the old readme
- in the old readme already add a line like "made with sidebase" and then link sidebase
app/pages/mlms/[id]/[name].vue
Outdated
@@ -0,0 +1,29 @@ | |||
<script setup lang="ts"> | |||
import { mlms } from '../../../library/mlms' | |||
import TheMlm from '../../../components/TheMlm.vue' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to use ~
to shoerten these imports here
app/server/api/example/[id].get.ts
Outdated
@@ -0,0 +1,19 @@ | |||
import { defineEventHandler } from 'h3' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove all unused example stuff -> this is an actual project made with sidebase, actual projects would also remove / replace everything that is from sidebase but not needed
Do you have a specific question for this early review? (: |
I wanted to make sure everything's going right with you as I thought I may take more time than you expected after wandering around the main branch.😅 Now on, I'll bring it up when there are more specific questions. |
I thought (nuxt use-head example: https://v3.nuxtjs.org/examples/composables/use-head/) For
For this error, I couldn't figure out much yet but I'll keep on searching for both and will update here if I find something else that works. |
…n/is-this-an-mlm into rewrite-with-sidebase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
app/app.vue
Outdated
<div class="w-full border-t text-center py-2 px-6 text-sm bg-slate-100 dark:bg-dark-lightgray"> | ||
<span class="dark:text-neutral-500 text-neutral-600">made with </span> | ||
<a href="https://github.com/sidestream-tech/sidebase" class="text-SideBase-green" target="_blank"> | ||
SideBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's lowercase this to stay consistent with everywhere
</div> | ||
</template> | ||
|
||
<style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please always use style sacoped
where possible, see https://vue-loader.vuejs.org/guide/scoped-css.html - this way style does not pollute the global website.
please fix everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used scoped style in the other components but wanted this style to be a global style.
Which way is better to make global style if you recommend?
import { Company, companyFull } from '~/server/database/entities/Company' | ||
|
||
const paramsSchema = z.object({ | ||
id: z.string().regex(/^\d+$/).transform(Number), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice handling to check whether id
is really only numeric (:
app/server/api/company/[id].get.ts
Outdated
const params = parseParamsAs(event, paramsSchema) | ||
return parseDataAs(Company.findOneOrThrow({ where: { id: params.id } }), companyFull) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's two ways to improve this:
a)
const params = parseParamsAs(event, paramsSchema) | |
return parseDataAs(Company.findOneOrThrow({ where: { id: params.id } }), companyFull) | |
const where = parseParamsAs(event, paramsSchema) | |
return parseDataAs(Company.findOneOrThrow({ where }), companyFull) |
b)
const params = parseParamsAs(event, paramsSchema) | |
return parseDataAs(Company.findOneOrThrow({ where: { id: params.id } }), companyFull) | |
const params = parseParamsAs(event, paramsSchema) | |
return parseDataAs(Company.findOneOrThrow({ where: params }), companyFull) |
// const SUGGESTIONS_FOLDER = isProduction ? './suggestions' : '.' | ||
// const filePath = `${SUGGESTIONS_FOLDER}/suggestions.log` | ||
// fs.appendFileSync(filePath, `${now}; ${params.name}\n`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can go?
|
||
const payload = { name: params.name, date: now } | ||
|
||
console.log(params.name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and I think this can either go OR should be extended to be more informative, e.g., with a time?
|
||
@Entity() | ||
export class Company extends Base { | ||
@Column('text', { unique: true }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do not add a ynique constraint here (unless you properly handle it in the endpoint and the frontend): many people may make similar or the same suggestions, and they should eithert all go through or the user should get good feedbackl like: "thanks, but this usggestion was already made!"
I would for now just allow all suggestions to keep the scope of this re-write on point. we can think about filtering out duplicates later on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought as people can make non-make sense suggestions, adding suggestions directly to Company
could be a bit dangerous. (though suggestion endpoint is not used in frontend yet)
What do you think about this?
For now, I removed the unique constraint from Suggestion
and left it to Company
.
We talked about this in daily! I changed it as you said! :)
I couldn't reproduce this error.
|
I just re-tested and I also could not reproduce the error. So consider it fixed (: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there!
README.md
Outdated
@@ -15,4 +17,6 @@ Install `docker` and `docker-compose`. Then run: | |||
|
|||
## Development | |||
|
|||
For development instructions, please have a look at the `README.md`s in each individual service directory. | |||
This website is build with [SideBase](https://github.com/sidestream-tech/sidebase) and following the basic stacks of SideBase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This website is build with [SideBase](https://github.com/sidestream-tech/sidebase) and following the basic stacks of SideBase. | |
This website is build with [sidebase](https://github.com/sidestream-tech/sidebase) and following the basic stacks of sidebase. |
Please user all lower case sidebase everywhere
app/index.d.ts
Outdated
@@ -0,0 +1 @@ | |||
declare module 'fast-levenshtein'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this still needed?
app/package.json
Outdated
"@vueuse/core": "^9.2.0", | ||
"sqlite3": "^5.0.11", | ||
"typeorm": "^0.3.9", | ||
"zod": "^3.18.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should not be needed anymore, you can import zod
from nuxt-sidebase-parse
!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all, I really like the rewrite 😍! I feel like you did a great job using the tools provided by Nuxt3 to rewrite the app!
I have a few more questions outside of the review, that you could maybe help answer 🤗
- Do you want to take a updated version of the scaffold and copy/paste your code into it?
- Have you added a
powered by sidebase
reference yet (I could not find it)
app/components/TheMlm.vue
Outdated
<script setup lang="ts"> | ||
import type { PropType } from 'vue' | ||
import type { Mlm } from '../types' | ||
import TheShareGrid from './TheShareGrid.vue' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to use absolute imports here?
app/components/TheMlm.vue
Outdated
</h3> | ||
<p class="h4 text-2xl"> | ||
Please check out | ||
<nuxt-link to="https://en.wikipedia.org/wiki/Multi-level_marketing"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these open in a new tab? I personally prefer when external links do not move you away from our website, as this makes us lose user retention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! I updated it.
Opened new Issue #43 for updating version of the scaffold! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit picks from now on 🤗
app/components/TheMlm.vue
Outdated
@@ -0,0 +1,59 @@ | |||
<script setup lang="ts"> | |||
import type { PropType } from 'vue' | |||
import TheShareGrid from './TheShareGrid.vue' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still was not addressed. I meant we should change it to be:
import TheShareGrid from './TheShareGrid.vue' | |
import TheShareGrid from '~/components/TheShareGrid.vue' |
This way, if we ever move the component, we won't have to reformat the imports (or at least it will be easier)
Edit: Only test and story files should use the relative imports, as these will always be in the same folder as the component.
app/components/TheSearchBar.vue
Outdated
<script setup lang="ts"> | ||
import type { PropType } from 'vue' | ||
import type { SelectValue } from 'ant-design-vue/es/select' | ||
import type { Mlm } from '../types' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we import this using
import type { Mlm } from '../types' | |
import type { Mlm } from '~/types' |
app/components/TheShareGrid.vue
Outdated
<script setup lang="ts"> | ||
import { useClipboard } from '@vueuse/core' | ||
import type { PropType } from 'vue' | ||
import type { Mlm } from '../types' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
app/components/TheShareGrid.vue
Outdated
> | ||
<span v-if="!showIsCopied">Copy link</span> | ||
<span v-else class="items-center justify-center" style="display: flex"> | ||
<CheckOutlined /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to use a margin here instead of the
?
<CheckOutlined /> | |
<CheckOutlined class="mr-1" /> |
@@ -0,0 +1,68 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we add some more infos about the project here? Like project name, github url, issue url etc.?
closes nuxt/framework#38 & #12 & #39 & nuxt/framework#42
README.md