{"id":18283455,"url":"https://github.com/ungdev/gala-api","last_synced_at":"2025-04-05T07:30:46.032Z","repository":{"id":43133227,"uuid":"125115759","full_name":"ungdev/gala-api","owner":"ungdev","description":"API pour le site web, l'application et les TV du Gala","archived":true,"fork":false,"pushed_at":"2022-05-02T18:23:10.000Z","size":10039,"stargazers_count":0,"open_issues_count":2,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-15T00:18:41.857Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ungdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-13T21:16:25.000Z","updated_at":"2024-03-27T14:15:13.000Z","dependencies_parsed_at":"2022-09-22T06:32:44.610Z","dependency_job_id":null,"html_url":"https://github.com/ungdev/gala-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ungdev%2Fgala-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ungdev%2Fgala-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ungdev%2Fgala-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ungdev%2Fgala-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ungdev","download_url":"https://codeload.github.com/ungdev/gala-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305153,"owners_count":20917192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T13:09:38.533Z","updated_at":"2025-04-05T07:30:41.025Z","avatar_url":"https://github.com/ungdev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API Gala\n\nAPI pour la gestion des données du gala\n\n## Requirements\n\n* [Node.js](https://nodejs.org/)\n* [yarn](https://yarnpkg.com/)\n\n## Installation\n\n```\ngit clone \n# or\ngit clone \n\ncd api.gala.uttnetgroup.fr\nyarn\n```\n\n## Database\n\n```\n# create the databse 'gala' and user gala\nCREATE DATABASE gala;\nCREATE user gala@localhost IDENTIFIED BY 'gala';\ngrant all privileges on gala.* to gala@localhost;\nflush privileges\n\n# run migrations (before running server !!!) :\nyarn migrate\n\n# run seeds\nyarn seed\n```\n\n## Configuration\n\n```\n# copy env file for all environments\ncp .env .env.local\n# makes your changes in .env.local, which will not be pushed\nnano .env.local\n# you should change DB settings for your database\n\n\n# setup email : put your smtp. WARNING : UTT's Network is blocking all smtp, you can use utt's SMTP from UNG's network, but no others.\nEMAIL_SMTP=\n# Set sender name, appear in client's mailbox\nEMAIL_FROM=Gala UTT \u003cgala@utt.fr\u003e\n# Set destination mail, where mail should go\nEMAIL_CONTACT_TO=Gala UTT \u003cgala@utt.fr\u003e\n```\n\n\n## Modify database\n\n```\n# If you want to edit the database (add/remove/update column, table, ...), you need to create a new migration. This will be like a commit for the database state, and it will be possible to roll back to a previous state of the structure (not data)\n\nsequelize migration:generate --name name_of_your_migration\n\n# Edit the migration generated in database/migrations/timestamp-name_of_your_migration.js\n# Than, run the migration to apply changes in the database :\nyarn migrate\n# note : this will not change you models, you will have to change them accordingly\n\n```\n\n## Setup etuutt login\n\n```\n# Setup etu baseurl (in case someday etu.utt.fr change dns, or if you want to use a local version for example)\nETU_BASEURL=https://etu.utt.fr\n# Setup Etu Application :\n# Go to https://etu.utt.fr/api/panel and create an application\n* Name is what appear when logging in\n* Redirection URL MUST BE localhost:3000/api/v1/etuutt/redirect, it redirects to the API not the front ! So put this app's url (for local use it's localhost:3000 by default, but in prod it could be api.yourapp.com or whatever)\n* image is optional but swag\n* you only need public data\n# Go to your application created, get th id and secret and set it :\nETU_CLIENT_ID=\nETU_CLIENT_SECRET=\nETU_CLIENT_ID=public\n# Finally, setup the redirect url, where this app should redirect user at the end, it's the baseurl of the front : \nLOGIN_REDIRECT_URL=http://localhost:8080\n\n```\n\n## Commands\n\n```\nyarn dev    # development server\nyarn start  # production server\nyarn serve  # pm2 production server (load balancing)\nyarn reload # pm2 hot reload\nyarn lint   # prettier lint\n```\n\n## Structure (generated with 'tree' command)\n\n```\narena.utt.fr-api/\n├── src/                          # base directory\n│   ├── api/                         # api files\n│   │   ├── controllers/                # endpoints controllers\n│   │   ├── middlewares/                # endpoints middlewares\n│   │   ├── models/                     # database models\n│   │   └── utils/                      # utils files\n│   ├── main.js                       # create express server\n│   ├── database.js                  # create sequelize connection\n│   ├── env.js                       # convert .env and .env.local to JSON\n│   ├── index.js                     # entry point\n├── .editorconfig                 # define your editor options\n├── .env                          # global configuration\n└── .env.local                    # override global configuration (not pushed to repository)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fungdev%2Fgala-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fungdev%2Fgala-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fungdev%2Fgala-api/lists"}