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!
58 Replies
so does the scraper and the next project share a db ?
yes
is there any auth or something else it shares ?
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
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
ignore the mobile shit
but just have your apps
like this yah
?
yea
change expo for the scraper
thank you!
will take a look at how its done here
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
each of the apps has a package.json
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 ?
no, since im not working on mobile apps
its not a mobile thing
but but will check out how they do the monorepo
GitHub
onu/monorepo at master · onugg/onu
Contribute to onugg/onu development by creating an account on GitHub.
I've structured my project a similar
way
it works really well tbh
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
either
either?
in database package
yea you can commit in any folder
and then you pull the db in as a dep
yea
which repo does the commit end up getting pushed to?
all?
just the monorepo folder
so only one repo?
?
yea its a monorepo
so i f you go into /database and make a commit there
its a got a monorepo folder and a dev environment
and push
yea
it will commit to /
yea
like at the latest commit
12 mins ago
GitHub
onu/monorepo/packages/database at master · onugg/onu
Contribute to onugg/onu development by creating an account on GitHub.
ah right there's no .git in this folder
yea
its a nice architecture tbh
its a bit 'weird'
as it kinda decouples next a bit
thank you i will explore this today 🙂
btw, if you're on the git, drop a star whilst you're there 😉
done
no worries, if you need any help setting up a turbo repo lmk. Been fucking with em all last night
cheers
awesome. ill give you a shout after i drop my kid at school 🙂
no worries, im coding all day today
MONOrepo
Mono = single
@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?
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
ok lets give it a shot
🙂
so @.mac first step was i created a repo and copied /fastmonitor into /fastmonior-monorepo/
i also changed the name on the fastmonitor package to
"name": "@fotoflo/fastmonitor",
and i created a package.json for fastmonitor-monorepo
also doesn't work
just copy my tsconfig
make sure you're importing the correct package
and the package name is correct
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
just fork this
ok started on a different backlog, will try that
another day 🙂
Ok