Loading repository data…
Loading repository data…
cyntaria / repository
A REST API backend system for the UniPal app, made with NodeJS
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
The documentation was generated using Postman and is divided into collections at the following URLs:
# Clone this repo to your local machine using
git clone https://github.com/cyntaria/UniPal-Backend
# Get into the directory
cd UniPal-Backend
# Make it your own
rm -rf .git && git init (For Linux/MacOS)
rm .git -r -fo; git init (For Windows PowerShell)
# Copy example.env and create your own .env file in envs folder
cp .env.example envs/.env
# Move into the envs dir
cd envs
# Edit .env file and add your mysql username, password and db name, host,
# port, jwt_secret
vscode .env
# Create different .env.{NODE_ENV} file for each environment and override only your
# required variables. The missing ones will be loaded from .env by default.
# For example if you want dev, production and test environments:
cp .env .env.dev
cp .env.dev .env.production
cp .evn.dev .env.test
# When the NODE_ENV variable is set while running, the correct .env loads automatically.
# e.g. Setting NODE_ENV=production is going to load the .env.production file
# Add a gitignore to ignore node_modules and your .env file
echo -e 'node_modules \n envs \n' >> .gitignore
# Install dependencies
npm install
# Run the server locally with default .env file
npm start
# Run the server in dev mode with nodemon with .env.dev file
npm run dev
# While deploying to production with .env.production file
npm run production
If you want to run the github testing and PR labelling workflows in the CI then:
Create the following repository secrets:
.env + .env.production fileshealthcheck endpoint is to ensure the status of the API from the CI so we can be sure we are deploying a working API only.Enjoy :)
Take the following steps to ensure security of configurations
# 1. Convert the envs folder to zip file
# 2. Encrypt it using gpg passphrase
gpg --output encrypted_envs.gpg --symmetric envs.rar
# 3. Decrypt it using gpg passphrase
gpg --output envs.rar --decrypt encrypted_envs.gpg
This example uses a number of open source projects to work properly:
UniPal-Backend © 2021 by Abdur Rafay Saleem is licensed under CC BY 4.0
| Reaction Types | https://documenter.getpostman.com/view/13348269/UV5WCdMP |
| Posts | https://documenter.getpostman.com/view/13348269/UV5ZAw6H |
| Subjects | https://documenter.getpostman.com/view/13348269/UV5cAbDZ |
| Timeslots | https://documenter.getpostman.com/view/13348269/UV5cAvrF |
| Classrooms | https://documenter.getpostman.com/view/13348269/UVBzmUFC |
| Teachers | https://documenter.getpostman.com/view/13348269/UVC2HUx5 |
| Teacher Reviews | https://documenter.getpostman.com/view/13348269/UVJZmxLn |
| Terms | https://documenter.getpostman.com/view/13348269/UVJigZ54 |
| Classes | https://documenter.getpostman.com/view/13348269/UVR5q8Xn |
| Timetables | https://documenter.getpostman.com/view/13348269/UVXgKwEp |