Skip to content

Commit 0025a99

Browse files
authored
Update README.md to contain a getting started with development guide
1 parent b5f025c commit 0025a99

1 file changed

Lines changed: 82 additions & 0 deletions

File tree

README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ Introducing Singularity: Your browser's karaoke stage! Gather your friends for a
3333
- [Installation](#Installation)
3434
- [Docker](#docker-)
3535
- [Upload Songs](#upload-songs)
36+
- [Local Development](#getting-started-with-local-development)
37+
- [Database Migrations](#database-migrations)
3638
- [Credits](#credits)
3739

3840

41+
3942
## Installation
4043
### Docker 🐋
4144
1. Install [Docker](https://www.docker.com/)
@@ -100,6 +103,85 @@ You can upload songs to Singularity under **Settings** > **Songs** > **+ New Son
100103

101104
Once Uploaded the Song will be playable!
102105

106+
107+
## Getting Started with local development
108+
1. Prerequisites:
109+
1. Install NodeJS: https://nodejs.org/
110+
2. Install Rust: https://rustup.rs/
111+
3. Install MariaDB: https://mariadb.org/
112+
2. Create a new Database:
113+
1. On Windows open the `MySQL Client` Software, On Linux run the `mysql` command.
114+
2. Run the following commands in mysql:
115+
```
116+
create database Singularity;
117+
grant all privileges on Singularity.* TO 'Singularity'@'%' identified by 'SECURE_PASSWORD';
118+
flush privileges;
119+
```
120+
121+
3. Clone the repository `git clone https://github.com/Singularity-Game/Singularity.git`
122+
4. Create the file `apps/singularity-api/src/config/appsettings.development.env` with the following content:
123+
```
124+
DB_HOST=localhost
125+
DB_PORT=3306
126+
DB_USERNAME=Singularity
127+
DB_PASSWORD=SECURE_PASSWORD
128+
DB_DATABASE=Singularity
129+
130+
SMTP_SECURE=
131+
SMTP_HOST=
132+
SMTP_PORT=
133+
SMTP_USERNAME=
134+
SMTP_PASSWORD=
135+
SMTP_FROM=
136+
137+
ENABLE_YOUTUBE=true
138+
139+
APP_URL=http://localhost:4200
140+
141+
SONG_DIRECTORY=../../../songs
142+
143+
AUTHENTICATION_JWT_SECRET=RANDOM_STRING_OF_CHARACTERS
144+
```
145+
5. Create the file `ormconfig.ts` in the root directory (next to `package.json`) with the following content:
146+
```ts
147+
import { DataSource } from 'typeorm';
148+
export const connectionSource = new DataSource({
149+
migrationsTableName: 'migrations',
150+
type: 'mariadb',
151+
host: 'localhost',
152+
port: 3306,
153+
username: 'Singularity',
154+
password: 'SECURE_PASSWORD',
155+
database: 'Singularity',
156+
logging: false,
157+
synchronize: false,
158+
name: 'default',
159+
entities: ['**/*.entity.ts'],
160+
migrations: ['apps/api/src/migrations'],
161+
});
162+
```
163+
6. Install Dependencies for Rust:
164+
```sh
165+
rustup install stable
166+
rustup override set stable
167+
rustup target add wasm32-unknown-emscripten --toolchain stable
168+
cargo install wasm-pack
169+
```
170+
7. Run `npm install`
171+
8. Run `npm run start`
172+
9. Run `npm run start-api`
173+
10. Open your Browser on `http://localhost:4200`
174+
11. The default credentials are Username: `admin` and Password: `admin`
175+
176+
### Database Migrations
177+
When you add, remove, or modify Entity Models, you must create a database migration. Typeorm can automatically generate Database Migrations with the following command:
178+
```
179+
npm run typeorm migration:generate -- -- ./apps/singularity-api/src/migrations/MIGRATION_NAME
180+
```
181+
182+
### Icons
183+
Icons are taken from https://iconoir.com/
184+
103185
## Credits
104186
- This project is heavily inspired by [Performous!](https://github.com/performous/performous)
105187
- This project uses the Pitch Detection library from [Vocalous](https://github.com/vocalous/app) and [pitch detection app!](https://alesgenova.github.io/pitch-detection-app/)

0 commit comments

Comments
 (0)