- It was created with Node.js and Express.js
- MongoDB was used as database. And Mongoose.js for Object Data Modelling
- Developed with Typescript
- OAuth 2.0 was used for the authorization protocol. (with Google and Github)
- Passport.js library was used, which provides convenience in the authentication process
- Helmet.js for security of HTTP headers.
- Cookie-Session, Nodemon, Dotenv and more...
- Create file named
.env
in main directory (not src).
PORT = YOUR_PORT
GOOGLE_CLIENT_ID = YOUR_GOOGLE_CLIENT_ID
GOOGLE_CLIENT_SECRET = YOUR_GOOGLE_CLIENT_SECRET
GITHUB_CLIENT_ID = YOUR_GITHUB_CLIENT_ID
GITHUB_CLIENT_SECRET = YOUR_CLIENT_SECRET
COOKIE_KEY_1 = YOUR_SECRET_KEY_1_FOR_COOKIE
COOKIE_KEY_2 = YOUR_SECRET_KEY_2_FOR_COOKIE
MONGODB_URL = YOUR_MONGODB_URL
- On main directory run this command
npm run dev
ornpm run start
GET
- /auth/github --- http://localhost:8000/auth/github (Sign-in with Github)
- /auth/google --- http://localhost:8000/auth/google (Sign-in with Google)
- /auth/logout --- http://localhost:8000/auth/logout (Log out)
GET
- /user/all --- http://localhost:8000/user/all (Get all user records)
- /user/:userID --- http://localhost:8000/user/1 (Get an user with user id)
- /user/username/:username --- http://localhost:8000/user/username/eeguney (Get an user with username)
- /user/providerID/:providerID --- http://localhost:8000/user/providerID/58622182 (Get an user with provider id. e.g: Your Github user id)
POST
- /user --- http://localhost:8000/user (Create new user manually)