Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/THUSAAC/tuoj-web


https://github.com/THUSAAC/tuoj-web

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

        

TUOJ Web Server
===

Let's make Tri-UOJ

# How to init
## Using docker
If you have docker on your local computer, you can run

```
tools/startdb.sh
tools/build.sh
```

separately to initialize the project.

## Manually
TUOJ web server depends on `npm`, `bower`, `grunt-cli`.

By default, you should concat client files using grunt.

You should run following commands to initialize the app.

Install npm

```
sudo apt-get install nodejs npm mongodb # maybe other packman tools
```

Install nrm and nrm to switch your npm source to taobao (which is faster)

```
sudo npm install -g nrm
nrm use taobao
```

Install packages

```
cd ./oj
npm install
sudo npm install -g bower grunt-cli
bower install
```

There is no user by default, while registeration is not allowed currently.

Therefore, you should run

```
node oj/tools/initdb.js
```

to create a user with both his username and passwrod set as `root`.

You may change that script to register more users.

# How to start the app
## Docker
We have a `docker-compose` startup config file. You may run

```
tools/compose.sh
```

to start two docker containers.

## Manually
You need to start mongodb server manually if needed (on mac and windows for example).

It is usually not needed on linux. You may run `mongo` to test if you already have had a mongodb server running.

```
mongod
```

And then start the nodejs app by running

```
cd ./oj
grunt
```