Moving a repo inside a repo!

Hi guys, I have two projects that i want to merge: 1. A nodejs scraper 2. A Next project They both share a single prisma schema... - The node js scraper was a bit legacy but has been rewritten with prisma! - the next project plans to read data from the scraper, so wants to share a single prisma instance I was planing to do this: 1. Merge the prisma schema (done) - db pull from the scraper into the next project, resulting in a schma with both users, and the data they want access to, yay! 2. Merge the files (structure outline below) I managed to do this successfully (the scraper and the next project run) , but it behaves like /scraper is is in the .gitignore of /nextProject - is this the reccomended way to do it? - can i have just one .git, tsconfig, env and package.json or will everything get messed up (dependancies get heavy, etc) Thank you!
/nextProject
.git
.env
.tsconfig
package.json
prisma.schema
/src. - all the usual stuff
/scraper
.git
.env
.tsconfig
.git
package.json
// NO PRISMA SCHEMA
/nextProject
.git
.env
.tsconfig
package.json
prisma.schema
/src. - all the usual stuff
/scraper
.git
.env
.tsconfig
.git
package.json
// NO PRISMA SCHEMA
58 Replies
mac
mac2y ago
so does the scraper and the next project share a db ?
fotoflo
fotoflo2y ago
yes
mac
mac2y ago
is there any auth or something else it shares ?
fotoflo
fotoflo2y ago
the auth is for next the scraper gets a bunch of data the next will then create charts... both use prisma the scraper data will have a relation to the users in auth
mac
mac2y ago
you could do something like https://github.com/t3-oss/create-t3-turbo
GitHub
GitHub - t3-oss/create-t3-turbo: Clean and simple starter repo usin...
Clean and simple starter repo using the T3 Stack along with Expo React Native - GitHub - t3-oss/create-t3-turbo: Clean and simple starter repo using the T3 Stack along with Expo React Native
mac
mac2y ago
ignore the mobile shit but just have your apps
fotoflo
fotoflo2y ago
fotoflo
fotoflo2y ago
like this yah ?
mac
mac2y ago
yea change expo for the scraper
fotoflo
fotoflo2y ago
thank you! will take a look at how its done here
mac
mac2y ago
not sure if its right yea I mean , take what I say with a grain of salt, im a junior like I cant even get a dev job lmao
fotoflo
fotoflo2y ago
each of the apps has a package.json
mac
mac2y ago
so hopefully someone with a higher status will come along and correct me yea so you'd make a db package and parse it in each app (scraper and nextapp) have you used turbo before ?
fotoflo
fotoflo2y ago
no, since im not working on mobile apps
mac
mac2y ago
its not a mobile thing
fotoflo
fotoflo2y ago
but but will check out how they do the monorepo
mac
mac2y ago
GitHub
onu/monorepo at master · onugg/onu
Contribute to onugg/onu development by creating an account on GitHub.
mac
mac2y ago
I've structured my project a similar way it works really well tbh
fotoflo
fotoflo2y ago
im not fond of the idea of 4 tsconfigs when you make a change to your dashboard, do you commit to the dashboard or to the parent? and where do you keep your schema? Thank you btw
mac
mac2y ago
either
fotoflo
fotoflo2y ago
either?
mac
mac2y ago
in database package yea you can commit in any folder
fotoflo
fotoflo2y ago
and then you pull the db in as a dep
mac
mac2y ago
yea
fotoflo
fotoflo2y ago
which repo does the commit end up getting pushed to? all?
mac
mac2y ago
just the monorepo folder
fotoflo
fotoflo2y ago
so only one repo?
mac
mac2y ago
GitHub
GitHub - onugg/onu
Contribute to onugg/onu development by creating an account on GitHub.
mac
mac2y ago
? yea its a monorepo
fotoflo
fotoflo2y ago
so i f you go into /database and make a commit there
mac
mac2y ago
its a got a monorepo folder and a dev environment
fotoflo
fotoflo2y ago
and push
mac
mac2y ago
yea
fotoflo
fotoflo2y ago
it will commit to /
mac
mac2y ago
yea like at the latest commit 12 mins ago
fotoflo
fotoflo2y ago
ah right there's no .git in this folder
mac
mac2y ago
yea its a nice architecture tbh its a bit 'weird' as it kinda decouples next a bit
fotoflo
fotoflo2y ago
thank you i will explore this today 🙂
mac
mac2y ago
btw, if you're on the git, drop a star whilst you're there 😉
fotoflo
fotoflo2y ago
done
mac
mac2y ago
no worries, if you need any help setting up a turbo repo lmk. Been fucking with em all last night cheers
fotoflo
fotoflo2y ago
awesome. ill give you a shout after i drop my kid at school 🙂
mac
mac2y ago
no worries, im coding all day today pepesaxophone
kwargs
kwargs2y ago
MONOrepo Mono = single
fotoflo
fotoflo2y ago
@kwargs haha yeah i get that exactly how it works in practice is another story hi @.mac im back 🙂 can i ask you about how this works aka if its not in its own package, how do you reference by package name? it just works? "name": "@onu/database", just this?
fotoflo
fotoflo2y ago
mac
mac2y ago
Yea so import like how I’ve imported the packages Import xyz from “@onu/package” Make sure the exported components are in an index file in root dir of the packages
fotoflo
fotoflo2y ago
ok lets give it a shot 🙂 so @.mac first step was i created a repo and copied /fastmonitor into /fastmonior-monorepo/
fotoflo
fotoflo2y ago
fotoflo
fotoflo2y ago
i also changed the name on the fastmonitor package to "name": "@fotoflo/fastmonitor", and i created a package.json for fastmonitor-monorepo
fotoflo
fotoflo2y ago
fotoflo
fotoflo2y ago
also doesn't work
mac
mac2y ago
just copy my tsconfig make sure you're importing the correct package and the package name is correct
mac
mac2y ago
GitHub
GitHub - t3-oss/create-t3-turbo: Clean and simple starter repo usin...
Clean and simple starter repo using the T3 Stack along with Expo React Native - GitHub - t3-oss/create-t3-turbo: Clean and simple starter repo using the T3 Stack along with Expo React Native
mac
mac2y ago
just fork this
fotoflo
fotoflo2y ago
ok started on a different backlog, will try that another day 🙂
mac
mac2y ago
Ok
Want results from more Discord servers?
Add your server