you need this setup only once
npm install
# after install with npm/yarn/pnpm
./script/db-setup.sh
After running db-setup.sh, you are inside mongodb shell.
replicaSet initialization
rs.initial();
Create admin database
use admin;
//see the manual for more infos
db.createUser({})
db.createUser({
user:"admin",
pwd:passwordPhrase(),
roles:[{
role:"root",
db:"admin"
}]
})
db.auth("admin")
//enter the password
Create new Users for the actual database.
The default Mongodb port for this project is 27001, if you want change to port you need in all 4 files: below
- ./prisma/config1.yaml
- ./prisma/config2.yaml
- ./prisma/config3.yaml
- ./script/db-setup.sh
npx prisma generate
- generate a keyFile in ./prisma/config
openssl rand -base64 756 > keyfile
-
create database and logs directories inside ./prisma
-
change permission of keyFile
chmod 400 keyfile
mkdir data/db{1..3} && touch data/db{1..3} mongodb.log
- Run the yaml files with mongod
mongod -f config1.yaml
- Run mongo instance on given port for example 27001, which is defined in Config file
mongo admin --host localhost:27001
- initiate the ReplcaSet
rs.initiate();
- Create the root User
- authenticate the root user
- create another user
How to run ?
check if database is on 27001 or your given running
ps -aux | grep mongod
if it is not running
./script/run-db.sh
Start the Remix development asset server and the Express server by running:
npm run dev
This starts your app in development mode, which will purge the server require cache when Remix rebuilds assets so you don't need a process manager restarting the express server.
First, build your app for production:
npm run build
Then run the app in production mode:
npm start
Now you'll need to pick a host to deploy it to.