T
Twentyβ€’4mo ago
Nisarg Shah

Can't able to setup project local

Install postgres using docker connect with psql, install all dependencies still not able to run. when run npx nx start it will start on 3001 but just shows blank screen & in console shows unable to connect to the database please help
18 Replies
thomast
thomastβ€’4mo ago
Hi @Nisarg Shah , did you follow https://twenty.com/developers/local-setup#step-3:-set-up-a-postgresql-database to setup the db locally?
Twenty - Local Setup
Mostly for contributors or curious developers
Nisarg Shah
Nisarg ShahOPβ€’4mo ago
Is it require to setup postgres locally ? Doesn't it work using docker? I follow complete docs but eveytime I get stuck on db connection
thomast
thomastβ€’4mo ago
What doc did you follow?
Nisarg Shah
Nisarg ShahOPβ€’4mo ago
Twenty - Local Setup
Mostly for contributors or curious developers
Nisarg Shah
Nisarg ShahOPβ€’4mo ago
No description
thomast
thomastβ€’4mo ago
so you did run make postgres-on-docker?
Nisarg Shah
Nisarg ShahOPβ€’4mo ago
I tell you what I did 1) docker pull postgres 2) docker run --name twenty -e POSTGRES_DB=twenty -e POSTGRES_USER=twenty -e POSTGRES_PASSWORD=twenty -p 5432:5432 -d postgres 3) docker exec -it twenty bash 4) psql -U twenty -d twenty 5) cp ./packages/twenty-front/.env.example ./packages/twenty-front/.env cp ./packages/twenty-server/.env.example ./packages/twenty-server/.env 6) nvm install nvm use yarn 7) npx nx database:reset twenty-server 8) npx nx start verdict : 3001 just shows me white screen & check console it gives me errors that I screenshot you before
No description
Nisarg Shah
Nisarg ShahOPβ€’4mo ago
Solved !! now graphql does not exist so please help on it
Nisarg Shah
Nisarg ShahOPβ€’4mo ago
No description
Nisarg Shah
Nisarg ShahOPβ€’4mo ago
after manually adding graphql schema again port 3001 showing only white screen after doing so many things still stuck here please help
charles
charlesβ€’4mo ago
Hi @Nisarg Shah πŸ™‚ The issue is a step 2) docker run --name twenty -e POSTGRES_DB=twenty -e POSTGRES_USER=twenty -e POSTGRES_PASSWORD=twenty -p 5432:5432 -d postgres You should not use twenty as the default postgres user, let's keep it to "postgres" twenty user will later be created by db init script (automatically run), if you already have a twenty user, this will conflict make sure to delete your existing volume before re-building your docker containers πŸ™‚ Also, please use the twenty-postgres container that comes with some extensions pre-built: https://hub.docker.com/r/twentycrm/twenty-postgres this is the docker-compose we use for production/self-host. You can use the postgres config from there even if you are looking to contribute as contribution almost never touch db setup: https://github.com/twentyhq/twenty/blob/main/packages/twenty-docker/docker-compose.yml
Nisarg Shah
Nisarg ShahOPβ€’4mo ago
Hi @charles you explain me very well first of all Thank you for that second thing I still not able to setup after following your setup what I did I start from the scratch again 1) git clone https://github.com/twentyhq/twenty.git 2) I go to the vs code 3) cp ./packages/twenty-front/.env.example ./packages/twenty-front/.env cp ./packages/twenty-server/.env.example ./packages/twenty-server/.env cp ./packages/twenty-docker/.env.example ./packages/twenty-docker/.env then uncomment some .env files ( attach screenshot of it) docker-compose pull docker-compose up --build 4) nvm install nvm use yarn 5) npx nx database:reset twenty-server 6) npx nx start errors : during migration & not able to connect to the database I tried a lot to figure out by myself sorry to ask again & again hope you will understand & help
GitHub
GitHub - twentyhq/twenty: Building a modern alternative to Salesfor...
Building a modern alternative to Salesforce, powered by the community. - twentyhq/twenty
No description
No description
No description
thomast
thomastβ€’4mo ago
Looks like you are using two different things here. Either you want to run the project using docker compose, following this doc : https://twenty.com/developers/section/self-hosting/docker-compose Either you do a local setup using nvm + npx, following that doc https://twenty.com/developers/local-setup Here you are doing a mix of both. Please remove your previous setup and choose one of the two above
Twenty - Local Setup
Mostly for contributors or curious developers
Nisarg Shah
Nisarg ShahOPβ€’4mo ago
Thank you @thomast I found where I did mistakes & follow from the scratch again & this time I am able to setup locally.
Weiko
Weikoβ€’4mo ago
Great! πŸ‘Œ
Shadab
Shadabβ€’4mo ago
I am aslo facing same issue i am tried using doc when i worte this cmd
npx nx database:reset twenty-server
npx nx database:reset twenty-server
No description
charles
charlesβ€’4mo ago
Hi @Shadab, this looks to be a different issue, could you open a new thread?
Shadab
Shadabβ€’4mo ago
hey @charles i just delete the code and again clone it now i am able to run twenty at my localhost
Want results from more Discord servers?
Add your server