Server source code for http://shenyu16.com
Node + Express + PostgreSQL
- Login, Register, Email Confirmation
- Cookie for JWT
- Timeline
- Visitors tracking with ip, location..
- Node.js (version 20.3.1)
- PostgreSQL
- npm (version 9.6.7) or
- yarn (version 1.22.19)
- send grid account with an api key
- ipinfo account with a key
-
Clone the repository:
git clone git@github.com:lishenyu16/express-server.git cd express-server
-
Install dependencies
yarn install npm install
-
install a local database with pgadmin or clound db like elephantSql or aws RDS
A sample .env would be like below:
PORT=[your port number]
NODE_ENV="production"
DATABASE_URL=[a string to connecto the db, containing the username, host and port...
SENDGRID_API_KEY=[sendGrid api key]
TOKEN_SERECT=[your own secret string]
IPINFO_TOKEN=[your ipinfo token
- Start the server:
yarn start
- The server will be running at localhost:[your port] by default.