7185 / lemuria

Yet another project about creating a 3D virtual world and stuff

Home Page:https://lemuria.7185.fr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lemuria

Lemuria CI

Yet another project about creating a 3D virtual world and stuff.

Powered with Nest (or Quart), Angular and Three.js.

Installation

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

First DB and server setup

Here you will find a few steps to follow in order to create and populate a working database for Lemuria.

Install various dependencies for the server

There are two different implementations for the backend server.

Node backend

$ cd backend
$ npm ci
$ npx prisma generate --generator client

Python backend

$ cd backend-py
$ pip3 install --user -r requirements.txt
$ prisma generate --schema ../backend/prisma/schema.prisma --generator client-py

Create an empty database and import the dump files

Node backend

$ 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.

Python backend

$ 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

Run the server

The API backend is listening on port 8080.

Node backend

Go to backend and run the following:

$ npm run start

Python backend

Go to backend-py and run the following:

$ prisma generate --schema ../backend/prisma/schema.prisma --generator client-py
$ python3 app.py

Docker

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

Try it out!

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.

About

Yet another project about creating a 3D virtual world and stuff

https://lemuria.7185.fr

License:MIT License


Languages

Language:TypeScript 79.7%Language:Python 10.7%Language:HTML 6.6%Language:SCSS 2.3%Language:Dockerfile 0.3%Language:JavaScript 0.3%