This repository contains the backend code for the JobLK job application platform.
This project is built using the following technologies:
- Node.js
- Express.js
- MySQL
Prerequisites:
- Node.js 19 or later
- Clone the repository:
git clone https://github.com/DEXOW/joblk-backend.git
- Install dependencies:
cd joblk-backend
npm install
- Create a copy of the
.env.example
file and rename it to.env
:
cp .env.example .env
- Configure the
AUTH_TOKEN
andSESSION_TOKEN
with a random string:
AUTH_TOKEN=''
SESSION_TOKEN_KEY=''
- Optionally if you want to use rollbar insert your rollbar project id in the .env file:
ROLLBAR_TOKEN=''
- Configure your database connection in the .env file:
DB_HOST='HOSTNAME'
DB_PORT=PORT
DB_USERNAME='USERNAME'
DB_PASSWORD='PASSWORD'
DB_NAME='DATABASE_NAME'
- Start the server:
npm start
- Or to start the development server with nodemon:
npm install nodemon
npm run dev
To deploy the application to a production environment, you will need to set up a MySQL database and a web server. You can then configure the application to connect to the database and use the web server to serve the application's static files.
Headers
- auth_token: Provide the valid auth token for authenticated requests
Request Body :
{
"username": "johndoe",
"email": "[email protected]",
"password": "password123"
}
Response Body :
{
code: "SUCCESS",
message: 'User registered successfully'
}
Request Body :
{
"email": "[email protected]",
"password": "password123"
}
- Or
{
"username": "JohnDoe",
"password": "password123"
}
Response Body :
{
code: "SUCCESS",
message: 'Logged in successfully'
}
Request Body :
No request body
Response Body :
{
code: "SUCCESS",
message: 'Logged out successfully'
}