https://github.com/pathcosmos/toy02_tms
https://github.com/pathcosmos/toy02_tms
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/pathcosmos/toy02_tms
- Owner: pathcosmos
- Created: 2025-05-20T02:14:02.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-20T02:27:56.000Z (about 1 year ago)
- Last Synced: 2025-05-20T02:27:58.597Z (about 1 year ago)
- Language: JavaScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# toy02_tms
This repository contains a simple setup with a Node.js backend and a React frontend. Both are placed in separate folders:
- **backend/**: A basic Express server.
- **frontend/**: A minimal React application configured with webpack and Babel.
Each folder contains its own `package.json` with the required dependencies and scripts.
## Backend database configuration
The backend expects a MariaDB database. Environment variables are loaded from
an `.env` file. Copy `backend/.env.example` to `backend/.env` and fill in the
values. The password is stored in encrypted form. To generate the required
variables run:
```bash
node encryptPassword.js "yourPassword"
```
This will output `ENCRYPTION_KEY`, `IV` and `DB_PASSWORD_ENC` which you should
place in `backend/.env` along with the database host and user values.
When the server starts it will attempt to connect to the database and log the
result.
## OAuth table setup
After configuring the database connection, the OAuth tables will be created automatically when the backend starts. You can also create them manually by running:
```bash
node src/db/createOAuthTables.js
```
This script reads `backend/src/db/oauth_tables.sql` and ensures the `oauth_users` and `oauth_tokens` tables exist. The same logic runs during server startup so the tables are present without an extra step.
## OAuth login
The backend exposes Google OAuth endpoints under `/auth`. Configure
`GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET` in `backend/.env`. Start the
frontend and click **OAuth 로그인** to begin the login flow.