-
-
Notifications
You must be signed in to change notification settings - Fork 74
Description
Dear FormsLab Community
At first thank you for the creation of this awesome light weighted survey platform!
I'm a bloody beginner with TypeScript, MongoDB, Prisma and I learned a lot to make it (almost) run. I would like to support here by writing a manual on how to install and configure the project, but I would also need guidance in that process.
Here is what I did so far to make it run
-
At first I prepared my system (Ubuntu 24.04 LTS) with the needed programs I identified from the list of technologies. For my use case Docker and in addition nodejs and npm.
sudo apt update sudo apt install --no-install-recommends docker.io sudo apt install nodejs npm nodejs -v && npm -v > v18.19.1 > 9.2.0 -
I cloned FormsLab from GitHub and installed the project.
git clone https://github.com/Ryczko/FormsLab.git cd FormsLab/ npm install -
And built the project with the command.
npm run build -
I noticed that Prisma with MongoDB is used and chose to use it within Docker for the first approach. So, to use MongoDB in Docker and to satisfy Prisma with a replica set of DB's I reduced the complexity with the usage of Prisma's own workaround: running a single DB that acts like a replica set.
docker pull prismagraphql/mongo-single-replica:5.0.3 -
In another terminal I started the Docker container of that one with the command:
docker run -d --add-host host.docker.internal:host-gateway --name mongo -e MONGO_INITDB_ROOT_USERNAME=root -e MONGO_INITDB_ROOT_PASSWORD=root -e MONGO_INITDB_DATABASE=formslab -p 27017:27017 prismagraphql/mongo-single-replica:5.0.3 -
In the previous terminal I created the ".env" file in the FormsLab folder:
vim .envwith the content
DATABASE_URL="mongodb://root:root@localhost:27017/formslab?authSource=admin&directConnection=true" NEXTAUTH_JWT_SECRET=root NEXTAUTH_SECRET=root -
And in the final step I started FormsLab.
npm start
After that I can connected to FormsLab via Firefox with the address
http://localhost:3000
and everything worked as expected ✔️
But now comes the reason why I'm asking for help. When I try to access the page from another PC or even easier with the same PC, where FormsLab is running via its own IP inside the local network, it is not working as expected. Here an example:
http://192.168.0.10:3000
I can visit the page, but I cannot create any new user or sign in as a created user from the localhost session. I can fill out the credentials as name, Email and password, but after pressing the "Sign up"-button nothing happens. Attaching to the MongoDB container doesn't even show me anything and by running FormsLab with
npm run dev
I see at least the only debug message
API handler should not return a value, received object
I'm suspecting MongoDB to be not reachable from an external source, but doing
nc -zv 192.168.0.10 27017
gives me
Connection to 192.168.0.10 27017 port [tcp/*] succeeded!
What am I doing wrong here? Thank you very much in advance.