Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ungdev/gala-flux-api
https://github.com/ungdev/gala-flux-api
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ungdev/gala-flux-api
- Owner: ungdev
- License: mit
- Created: 2017-03-19T18:26:20.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-05-23T00:52:48.000Z (over 1 year ago)
- Last Synced: 2023-08-16T23:21:46.360Z (over 1 year ago)
- Language: JavaScript
- Size: 1.07 MB
- Stars: 1
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# flux2-server
Sever side of the communication system created for the Gala UTT
## Prerequire
* [Yarn](https://yarnpkg.com/lang/en/docs/install/)
* NodeJS 7## Steps for dev installation
* Clone the repo
```
git clone https://github.com/ungdev/gala-flux-api
```
* install dependencies
```
cd gala-flux-api
yarn
```
* Modify the config filesyou have to created .env file based on the .env.example file. and configure it
```
cp .env.example .env
```
* Try to run the server a first time
```
yarn dev
```### Fill the database
To fill the database with half-random fixtures, run the following command.```
node cli/fixtures.js
```## Run With Docker
```
docker-compose build
docker-compose up
```## Production deployment
This app is made to have an auto deployment on master push. The app will be started as a test on travis-ci, which will then trigger the auto-deployment to a dokku server.To push on the Dokku server, travis has to get the private ssh key of a dokku user :
```
# generate new keys
ssh-keygen -f deploy_key# Use deploy_key.pub to create a new user on dokku that can push to this new repository
cat deploy_key.pub | ssh [email protected] dokku ssh-keys:add flux2-travis# Login on travis and encryp key
travis login
travis encrypt-file deploy_key --add# Clean unencrypted keys
rm deploy_key deploy_key.pub# Add and commit encrypted deploy_key
git add deploy_key.enc
```On the dokku app, you can configure EtuUTT api configuration and the JWT secret
```
dokku config:set api.flux.uttnetgroup.fr DOKKU_APP_NAME=api.flux.uttnetgroup.fr ETUUTT_ID= ETUUTT_SECRET= JWT_SECRET=
dokku config:set api.flux-dev.uttnetgroup.fr DOKKU_APP_NAME=api.flux-dev.uttnetgroup.fr ETUUTT_ID= ETUUTT_SECRET= JWT_SECRET=
```## Create an admin account
To start to use the application, you need at least one admin user.
To create an admin account from command line, the server has to be stopped. Then run thoses two commands and follow the instructions.```
node cli/createTeam.js # Not needed if you already fill the database with fixtures
node cli/createUser.js
```## Firebase setup
You have to generate a config file. [Go here and read the instructions](https://firebase.google.com/docs/admin/setup).