Skip to content

Commit

Permalink
Merge pull request #90 from Asadaaaaa/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
Asadaaaaa authored Oct 6, 2023
2 parents 9a6e917 + 0d9f2f3 commit f44ab2b
Show file tree
Hide file tree
Showing 80 changed files with 7,775 additions and 14 deletions.
37 changes: 37 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
MULTI_THREAD = false

HOST = http://localhost
WEB_HOST = https://stg.sersow.otech.id

# Server Listen
IP = '0.0.0.0'
PORT = 3001

API_VERSION = 'v1'

# Logger
LOG_REQUEST = '' # full, medium, false

# Middlewares
MIDDLEWARE_ORIGIN = '*'
MIDDLEWARE_JSON_LIMIT_SIZE = '50mb'

# JWT
JWT_TOKEN_SECRET = ''
JWT_TOKEN_EXPIRED = '1h'

# HASHING SALT
HASH_SALT = ''

# Database
DB_DIALECT = 'mysql'
DB_LOGGING = false
DB_HOST = 'localhost'
DB_PORT = 3306
DB_USERNAME = ''
DB_PASSWORD = ''
DB_DATABASE = ''

# nodemailer
MAIL_EMAIL = ''
MAIL_ETHEREAL_PASSWORD = ''
6 changes: 4 additions & 2 deletions .github/workflows/cd-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ jobs:
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: |
cd sersow/main/sersow-controller
cd app/sersow/controller/production
git reset --hard HEAD
git switch main
git pull origin main
npm i
pm2 restart main-sersow-controller
pm2 restart sersow-controller-production
6 changes: 4 additions & 2 deletions .github/workflows/cd-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ jobs:
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: |
cd sersow/staging/sersow-controller
cd app/sersow/controller/staging
git reset --hard HEAD
git switch staging
git pull origin staging
npm i
pm2 restart stg-sersow-controller
pm2 restart sersow-controller-staging
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm i
- run: npm run start
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/node_modules
.env
.env
/server_data
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Sersow Back-end
This is the repository for the back-end of the Sersow application. It is built using Node.js and utilizes several libraries and technologies to provide the required functionality. The tech stack for the back-end includes:

- Node.js: A JavaScript runtime environment.
- Express.js: A fast and minimalist web application framework for Node.js.
- Sequelize: An ORM (Object-Relational Mapping) for interacting with the MySQL database.
- MySQL: The database management system used for storing application data.
- Nodemailer: A module for sending emails, used for various email notifications.
- AJV: A JSON Schema validator for validating and ensuring data consistency.
- JWT (JSON Web Tokens): A standard for securely transmitting information between parties as a JSON object.

## Installation
1. Clone the repository: git clone https://github.com/Asadaaaaa/sersow-controller
2. Install dependencies: npm install
3. Set up the MySQL database and configure the connection in the .env file.
4. Start the development mode: npm run dev

Make sure to update the necessary environment variables in the .env file before running the server in a production environment.

## API Documentation
The back-end provides a set of APIs for handling various functionalities in the Sersow application. For detailed information on the available endpoints and their usage, please refer to the [API documentation](https://documenter.getpostman.com/view/23736615/2s93XsX6GE).


## Contributing
Contributions to the Sersow back-end are private! If you encounter any issues or have suggestions for improvements, please submit a pull request or open an issue in this repository.
Loading

0 comments on commit f44ab2b

Please sign in to comment.