This project is an attempt to resurrect and preserve Cybertown, a VRML based community from the mid-90s/early-00s. This repository contains the entire codebase for the new platform, built by the community.
We always welcome others to help out with VRML and the Single Page Application (SPA) and API. Take a look at our issue, fork this repository and start contributing. When you are ready, create a pull request, and we will review your changes to be merged into the official master branch.
Submitting bugs, feedback and commenting on issues is the best way for non-developers to help with the project.
- Node.js
- Vue.js
- Tailwind.css
- MySQL
- Nginx
- socket.io
- docker
- VRML
We utilise docker to manage the entire development environment and to make it easy to set up and run.
You will need to have the following already installed on your machine and a basic understanding in order to run the development environment:
You may also wish to install Docker for Desktop if you wish. For beginners, there are plenty of tutorials and videos online on installation and the basics of node, npm and docker.
- Clone this repository to your machine.
- Rename
spa/.env.example
tospa/.env
andapi/.env.example
toapi/.env
. - In the cloned directory, run
docker-compose up
from command line. This will install the docker environment, install node dependencies via npm and start the servers. - Navigate to the
spa/
directory and runnpm run dev
to compile the SPA. - In your browser, visit http://localhost:8001/ to confirm it's running.
To run the environment again in the future, simple repeat steps 2 onwards.
To initialize a database within the mysql container, run the command below from
within the api/
directory.
Running this will create a new database using settings configured in api/knexfile.ts
:
npm run db:init
After the database is created, the schema and some necessary seed data are created automatically.
When making changes to the SPA, provided you have ran npm run dev
from spa/
all your changes will be
automatically re-compiled.
- 2 space indentation
- 100-110 max line length
- wrapped lines can have +1 space indentation
- use single quotes for strings, excluding SQL queries.
- use triple equals (
===
) for comparisons - no trailing spaces
- always leave a trailing (
,
) comma in lists - blank line at the end of files