Yet another project about creating a 3D virtual world and stuff.
Powered with Nest (or Quart), Angular and Three.js.
First we need to fetch all dependencies for the frontend, go to frontend
and do the following:
$ npm ci
Then we build and run the project:
# You can also use build:prod to build a production-ready bundle
$ npm run build
To avoid CORS issues when accessing static files from a web browser, go to backend-py
and do the following:
$ python tools/serve_path.py
This will run a script to serve files in backend-py
on port 8181
Here you will find a few steps to follow in order to create and populate a working database for Lemuria.
There are two different implementations for the backend server.
$ cd backend
$ npm ci
$ npx prisma generate --generator client
$ cd backend-py
$ pip3 install --user -r requirements.txt
$ prisma generate --schema ../backend/prisma/schema.prisma --generator client-py
$ cd backend
$ npx prisma db push --skip-generate
There is no node script to import worlds yet, so you can use the python one instead.
$ cd backend-py
$ prisma db push --schema ../backend/prisma/schema.prisma
$ python tools/import_lemuria.py
This will create and init the database backend/app.db
using the data in dumps/atlemuria.txt
and dumps/proplemuria.txt
.
You will also need the village2
resource path to be served, to do so you can go to backend-py
and create a symlink by running the following (but set the path correctly first):
$ ln -s /my/path/to/resource/folder/for/village2 village2
The API backend is listening on port 8080
.
Go to backend
and run the following:
$ npm run start
Go to backend-py
and run the following:
$ prisma generate --schema ../backend/prisma/schema.prisma --generator client-py
$ python3 app.py
You can also generate a docker image to build the project and run the server in a container:
# Build with the node backend
$ docker build --target backend -t lemuria .
# OR with the python backend
$ docker build --target backend-py -t lemuria .
$ docker run -it -p 8080:8080 -v $PWD/backend-py/app.db:/app/app.db -v $PWD/dumps:/app/dumps lemuria
Once npm run build
, npm run start
(or app.py
) and serve_path.py
are running: open your favorite web browser and go to http://localhost:8080
,
you should be prompted with a login screen, put whatever nickname you want, the password you provide doesn't matter as
there's no proper authentication for the moment.